c# Programming Glossary: opcodes.ret
C# Get property value without creating instance? http://stackoverflow.com/questions/11162652/c-sharp-get-property-value-without-creating-instance generator.Emit OpCodes.Call method generator.Emit OpCodes.Ret var ugly Func string dynamicMethod.CreateDelegate typeof Func..
General purpose FromEvent method http://stackoverflow.com/questions/12865848/general-purpose-fromevent-method OpCodes.Call setResultMethodInfo and return ilgen.Emit OpCodes.Ret s_emittedHandlers.Add eventDelegateType handler Delegate dEmitted..
Anyone know a quick way to get to custom attributes on an enum value? http://stackoverflow.com/questions/17772/anyone-know-a-quick-way-to-get-to-custom-attributes-on-an-enum-value returns the value to the caller ilGenerator.Emit OpCodes.Ret converts the DynamicMethod to a FastPropertyGetHandler delegate..
Get an IDataReader from a typed List http://stackoverflow.com/questions/2258310/get-an-idatareader-from-a-typed-list OpCodes.Callvirt setMethod null generator.Emit OpCodes.Ret Create the delegate and return it return GenericSetter setter.CreateDelegate.. OpCodes.Box propertyInfo.PropertyType generator.Emit OpCodes.Ret Create the delegate and return it return GenericGetter getter.CreateDelegate..
Comparing 2 objects and retrieve a list of fields with different values http://stackoverflow.com/questions/3060382/comparing-2-objects-and-retrieve-a-list-of-fields-with-different-values OpCodes.Callvirt add null il.MarkLabel next il.Emit OpCodes.Ret getDeltas Func T T List string dyn.CreateDelegate typeof Func..
How to invoke (non virtually) the original implementation of a virtual method? http://stackoverflow.com/questions/3378010/how-to-invoke-non-virtually-the-original-implementation-of-a-virtual-method il.Emit OpCodes.Ldarg_0 il.Emit OpCodes.Call m il.Emit OpCodes.Ret var action Action C dm.CreateDelegate typeof Action C action..
Dynamically create a class in C# http://stackoverflow.com/questions/3862226/dynamically-create-a-class-in-c-sharp getIl.Emit OpCodes.Ldfld fieldBuilder getIl.Emit OpCodes.Ret MethodBuilder setPropMthdBldr tb.DefineMethod set_ propertyName.. setIl.Emit OpCodes.Nop setIl.MarkLabel exitSet setIl.Emit OpCodes.Ret propertyBuilder.SetGetMethod getPropMthdBldr propertyBuilder.SetSetMethod..
Fast creation of objects instead of Activator.CreateInstance(type) http://stackoverflow.com/questions/6582259/fast-creation-of-objects-instead-of-activator-createinstancetype objType.GetConstructor Type.EmptyTypes ilGen.Emit OpCodes.Ret return Func T dynMethod.CreateDelegate typeof Func T I'm wondering..
Looking for a fast and easy way to coalesce all properties on a POCO http://stackoverflow.com/questions/7422861/looking-for-a-fast-and-easy-way-to-coalesce-all-properties-on-a-poco null nix il.MarkLabel end incoming nix il.Emit OpCodes.Ret merge Action T T method.CreateDelegate typeof Action T T ..
How can I write a generic container class that implements a given interface in C#? http://stackoverflow.com/questions/847809/how-can-i-write-a-generic-container-class-that-implements-a-given-interface-in-c il.Emit OpCodes.Ldarg_1 il.Emit OpCodes.Stfld fld il.Emit OpCodes.Ret foreach var method in typeof T .GetMethods var args method.GetParameters.. il.MarkLabel endFinally il.EndExceptionBlock il.Emit OpCodes.Ret Cache T .Type type.CreateType #if DEBUG for inspection purposes.....
|