This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Nemerle; | |
using Nemerle.Collections; | |
using Nemerle.Text; | |
using Nemerle.Utility; | |
using System; | |
using System.IO; | |
using System.Collections.Generic; | |
using System.Linq; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ShouldMatchGivenHeaderBytesWhenWrittenToTargetStream() : void | |
{ | |
def bytes = array[ // dos header start | |
0x4d : byte, 0x5a, 0x90, 0x00, 0x03, 0x00, 0x00, | |
0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, | |
0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Nemerle.Collections; | |
using Nemerle.Text; | |
using Nemerle.Utility; | |
using System; | |
using System.Collections.Generic; | |
using System.Console; | |
using System.Linq; | |
public class FizzBuzzer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class FunctionalBindingExtensions | |
{ | |
public static Action<T2> Bind<T1, T2>(this Action<T1, T2> action, Func<T1> getValueFunc) | |
{ | |
return action.Bind(getValueFunc()); | |
} | |
public static Action<T1> Bind<T1, T2>(this Action<T1, T2> action, Func<T2> getValueFunc) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using System.Text; | |
using System.Threading.Tasks; | |
using LinFu.Finders; | |
using LinFu.Finders.Interfaces; | |
using LinFu.Reflection; | |
using CLRDynamicObject = System.Dynamic.DynamicObject; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace FunctifyBench | |
{ | |
using Functify; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace FunctifyBench | |
{ | |
using System.Reflection; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Yep. If you want app-wide AOP, here's the interface that you need to implement that does the method replacement: | |
public interface IMethodCallProvider | |
{ | |
void AddMethodCalls(object target, MethodBase hostMethod, IEnumerable<MethodBase> interceptedMethods, | |
IMethodCallMap methodCallMap, StackTrace stackTrace); | |
} | |
Most of the parameters on the AddMethodCalls method are self explanatory, except for the methodCallMap parameter, which looks like this: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using SampleLibrary; | |
namespace Deflector.Demos | |
{ | |
class Program |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Reflection; | |
using System.Collections.Generic; | |
public static class Program { | |
public static void Main (string[] args) { | |
Common.Util.ListMembers<MethodInfo>( | |
typeof(T), | |
BindingFlags.DeclaredOnly | BindingFlags.Static | BindingFlags.Public | |
); |