c# Programming Glossary: type.emptytypes
C# Get property value without creating instance? http://stackoverflow.com/questions/11162652/c-sharp-get-property-value-without-creating-instance var dynamicMethod new DynamicMethod Ugly typeof string Type.EmptyTypes var generator dynamicMethod.GetILGenerator generator.Emit OpCodes.Ldnull..
What is the __DynamicallyInvokable attribute for? http://stackoverflow.com/questions/12550749/what-is-the-dynamicallyinvokable-attribute-for ConstructorInfo ctor invocableAttribute.GetConstructor Type.EmptyTypes Contract.Assert ctor null int token ctor.MetadataToken Contract.Assert..
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 il.Emit OpCodes.Newobj typeof List string .GetConstructor Type.EmptyTypes bool isValueType typeof T .IsValueType OpCode callType isValueType..
Dynamically create a class in C# http://stackoverflow.com/questions/3862226/dynamically-create-a-class-in-c-sharp MethodAttributes.HideBySig propertyType Type.EmptyTypes ILGenerator getIl getPropMthdBldr.GetILGenerator getIl.Emit..
Specifying generic collection type param at runtime http://stackoverflow.com/questions/513952/specifying-generic-collection-type-param-at-runtime
C# Using Activator.CreateInstance http://stackoverflow.com/questions/5262693/c-sharp-using-activator-createinstance ConstructorInfo constructorInfo type.GetConstructor Type.EmptyTypes works with public instance static methods MethodInfo mi type.GetMethod..
Get all inherited classes of an abstract class [duplicate] http://stackoverflow.com/questions/5411694/get-all-inherited-classes-of-an-abstract-class Find all Constructors with no arguments Type.EmptyTypes and call them with no arguments null AbstractDataExport abcde.. abcde AbstractDataExport type.GetConstructor Type.EmptyTypes .Invoke null abcde.ExportData c# reflection inheritance ..
How to create LINQ Expression Tree with anonymous type in it http://stackoverflow.com/questions/606104/how-to-create-linq-expression-tree-with-anonymous-type-in-it Expression.New dynamicType.GetConstructor Type.EmptyTypes bindings sourceItem return source.Provider.CreateQuery Expression.Call..
Fast creation of objects instead of Activator.CreateInstance(type) http://stackoverflow.com/questions/6582259/fast-creation-of-objects-instead-of-activator-createinstancetype ilGen.Emit OpCodes.Newobj objType.GetConstructor Type.EmptyTypes ilGen.Emit OpCodes.Ret return Func T dynMethod.CreateDelegate..
How to find all the classes which implement a given interface? http://stackoverflow.com/questions/699852/how-to-find-all-the-classes-which-implement-a-given-interface .Contains typeof ISomething t.GetConstructor Type.EmptyTypes null select Activator.CreateInstance t as ISomething foreach..
How to inject an attribute using a PostSharp attribute? http://stackoverflow.com/questions/7851365/how-to-inject-an-attribute-using-a-postsharp-attribute typeof DataContractAttribute .GetConstructor Type.EmptyTypes introduceDataContractAspect.CustomAttribute.NamedArguments.Add.. typeof DataMemberAttribute .GetConstructor Type.EmptyTypes Add the DataContract attribute to the type. yield return new.. typeof XmlIgnoreAttribute .GetConstructor Type.EmptyTypes public IEnumerable AspectInstance ProvideAspects object targetElement..
|