ImpromptuInterface is a framework for .net that uses the DLR's api, normally hidden by the compiler, for meta programming purposes such as adding interfaces at runtime.
ImpromptuInterface is a framework for .net that uses the DLR's api, normally hidden by the compiler, for meta programming purposes such as adding interfaces at runtime, Late Binding via API, Inline Fluent Syntaxes, Currying, and Pre-canned DynamicObjects.
Apache Licensed and available at http://code.google.com/p/impromptu-interface/
Examples:
Adding an interface at runtime:
//Dynamic Expando object
dynamic expando = Build<ExpandoObject>.NewObject(
Prop1: "Test",
Prop2: 42L,
Prop3: Guid.NewGuid(),
Meth1: Return<bool>.Arguments<int>(it => it > 5)
);
IMyInterface myInterface = Impromptu.ActLike(expando);
Late binding a method at via API:
var relUri = Impromptu.InvokeMember(baseUri, "MakeRelativeUri", absUri);
.NET Framework support
ImpromptuInterface runs on .NET 4.0 or later, Mono 2.10 or later,and Silverlight 4 or Later.
Nuget package
There is a binary distribution of ImpromptuInterface on nuget at http://nuget.org/packages/ImpromptuInterface.
Extensions
ImpromptuInterface also includes the following extensions:
ImpromptuInterface.MVVM - meta programming to avoid MVVM boilerplate
ImpromptuInterface.FSharp - api to use DLR from F#