Problem : I am trying to subscribe to ALL events exposed by a WPF GridView-like 3rd party component in order […]
Tag: reflection
Lazy implementation and .NET generics
Problem : I was looking for ways to do lazy initialization and found Lazy<T> which is included in .NET 4. […]
Why does typeof(Object[,][]).Name equal “Object[][,]”?
Problem : Evaluating typeof(Object[,][]).Name gives Object[][,] Similarly, typeof(Object[][,]).Name gives Object[,][] Seems like the comma is moving for no reason. What […]
How to get a custom attribute from object instance in C#
Problem : Let’s say I have a class called Test with one property called Title with a custom attribute: public […]
Can I use Activator.CreateInstance with an Interface?
Problem : I have an example: Assembly asm = Assembly.Load(“ClassLibrary1”); Type ob = asm.GetType(“ClassLibrary1.UserControl1”); UserControl uc = (UserControl)Activator.CreateInstance(ob); grd.Children.Add(uc); There […]
How to access the Index Of A Generic.List By Reflection?
Problem : ok, ive a class and i pass an object as property. the object that i pass is a […]
Determine whether assembly is a gui application
Problem : I am trying to determine whether a C# assembly is a GUI or a Console application in order […]
A good and complete tutorial about reflection in .NET? [closed]
Problem : Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Questions asking us […]
How to create an instance for a given Type? [duplicate]
Problem : This question already has answers here: How to create a new object instance from a Type (11 answers) […]
Getting the type of a MemberInfo with reflection
Problem : I’m using reflection to load a treeview with the class structure of a project. Each of the members […]