¡@

Home 

c# Programming Glossary: reflection

Public Fields versus Automatic Properties

http://stackoverflow.com/questions/1180860/public-fields-versus-automatic-properties

differently on variables vs. properties so if you rely on reflection it's easier to use all properties. You can't databind against..

Get property value from string using reflection in C#

http://stackoverflow.com/questions/1196991/get-property-value-from-string-using-reflection-in-c-sharp

property value from string using reflection in C# I am trying implement the Data transformation using Reflection.. resolve the value of the property. Is this possible c# reflection share improve this question public static object GetPropValue..

How can I find the method that called the current method?

http://stackoverflow.com/questions/171970/how-can-i-find-the-method-that-called-the-current-method

like Assembly.GetCallingAssembly but for methods. c# .net reflection logging stack trace share improve this question Try this..

How to use reflection to call generic Method?

http://stackoverflow.com/questions/232535/how-to-use-reflection-to-call-generic-method

to use reflection to call generic Method What's the best way to call a generic.. ... public static void StaticMethod T ... c# generics reflection share improve this question You need to use reflection to.. reflection share improve this question You need to use reflection to get the method to start with then construct it by supplying..

Getting all types that implement an interface with C# 3.0

http://stackoverflow.com/questions/26733/getting-all-types-that-implement-an-interface-with-c-sharp-3-0

all types that implement an interface with C# 3.0 Using reflection how can I get all types that implement an interface with C#.. if t is IMyInterface do stuff c# optimization reflection lambda c# 3.0 share improve this question Mine would be this..

Dynamic LINQ OrderBy on IEnumerable<T>

http://stackoverflow.com/questions/41244/dynamic-linq-orderby-on-ienumerablet

x Expression expr arg foreach string prop in props use reflection not ComponentModel to mirror LINQ PropertyInfo pi type.GetProperty..

How can I read the properties of a C# class dynamically?

http://stackoverflow.com/questions/4629/how-can-i-read-the-properties-of-a-c-sharp-class-dynamically

way to do this with C# Edit Oh and I am using C# 2.0 c# reflection properties share improve this question Unfortunately C# isn't.. teaches me to read the questions thoroughly first. Yes reflection would be able to give you some help here. If you split the string..

How do I get the path of the assembly the code is in?

http://stackoverflow.com/questions/52797/how-do-i-get-the-path-of-the-assembly-the-code-is-in

.Location gives the same as the previous. c# .net reflection share improve this question I've defined the following property..

Convert generic List/Enumerable to DataTable?

http://stackoverflow.com/questions/564366/convert-generic-list-enumerable-to-datatable

Yes this is pretty much the exact opposite of this one reflection would suffice or if you need quicker HyperDescriptor in 2.0.. one line you can make this many many times faster than reflection by enabling HyperDescriptor for the object type T . edit re..

.Net - Reflection set object property

http://stackoverflow.com/questions/619767/net-reflection-set-object-property

object property Is there a way in .Net c# 3.5 I can use reflection to set a object property Ex MyObject obj new MyObject obj.Name.. new MyObject obj.Name MyName I want to set obj.Name with reflection. Something like Reflection.SetProperty obj Name MyName Is there.. obj Name MyName Is there a way of doing this c# .net reflection share improve this question Yes you can use Type.InvokeMember..

Is it possible to dynamically compile and execute C# code fragments?

http://stackoverflow.com/questions/826398/is-it-possible-to-dynamically-compile-and-execute-c-sharp-code-fragments

want to then run the code you just need to use a bit of reflection to dynamically load the assembly and execute it. Here is another..

Why is Multiple Inheritance not allowed in Java or C#?

http://stackoverflow.com/questions/995255/why-is-multiple-inheritance-not-allowed-in-java-or-c

access serialization identity comparisons verifiability reflection generics and probably lots of other places. You can read the..

C# Reflection: How to get class reference from string?

http://stackoverflow.com/questions/1044455/c-sharp-reflection-how-to-get-class-reference-from-string

Reflection How to get class reference from string I want to do this in.. Here is a very simple example using System using System.Reflection class Program static void Main Type t Type.GetType Foo MethodInfo..

Public Fields versus Automatic Properties

http://stackoverflow.com/questions/1180860/public-fields-versus-automatic-properties

some differences. Properties vs. Public Variables Reflection works differently on variables vs. properties so if you rely..

Get property value from string using reflection in C#

http://stackoverflow.com/questions/1196991/get-property-value-from-string-using-reflection-in-c-sharp

in C# I am trying implement the Data transformation using Reflection example in my code. The GetSourceValue function has a switch..

C# Using Reflection to copy base class properties

http://stackoverflow.com/questions/1198886/c-sharp-using-reflection-to-copy-base-class-properties

Using Reflection to copy base class properties I would like to update all properties.. to update all properties from MyObject to another using Reflection. The problem I am coming into is that the particular object..

Should I use public properties and private fields or public fields for data?

http://stackoverflow.com/questions/1277572/should-i-use-public-properties-and-private-fields-or-public-fields-for-data

blog archives 000654.html Specifically Reflection works differently on variables vs. properties so if you rely..

Cast to Anonymous Type

http://stackoverflow.com/questions/1409734/cast-to-anonymous-type

I know there are other and also better ways to get the Id Reflection reading the value from the ComboBox not using anonymous tpyes..

How can I easily convert DataReader to List<T>? [duplicate]

http://stackoverflow.com/questions/1464883/how-can-i-easily-convert-datareader-to-listt

share improve this question I have seen systems that use Reflection and attributes on Properties or fields to maps DataReaders to.. œhigh road if you are doing this a lot. See A Defense of Reflection in .NET for one example of this. You can then write code like..

How can I find the method that called the current method?

http://stackoverflow.com/questions/171970/how-can-i-find-the-method-that-called-the-current-method

that called the current method I know all about System.Reflection.MethodBase.GetCurrentMethod but I want to go one step beneath..

Reflection: How to Invoke Method with parameters

http://stackoverflow.com/questions/2202381/reflection-how-to-invoke-method-with-parameters

How to Invoke Method with parameters I am trying to invoke.. Do something... Executing Assembly.exe public class TestReflection public void Test string methodName Assembly assembly Assembly.LoadFile..

Is it possible to “steal” an event handler from one control and give it to another?

http://stackoverflow.com/questions/293007/is-it-possible-to-steal-an-event-handler-from-one-control-and-give-it-to-anoth

improve this question Yeah it's technically possible. Reflection is required because many of the members are private and internal... using System.Windows.Forms using System.Reflection namespace WindowsFormsApplication1 public partial class Form1..

Reflection to Identify Extension Methods

http://stackoverflow.com/questions/299515/reflection-to-identify-extension-methods

to Identify Extension Methods In C# is there a technique using.. System using System.Runtime.CompilerServices using System.Reflection using System.Linq using System.Collections.Generic public static..

Early and late binding

http://stackoverflow.com/questions/484214/early-and-late-binding

Everything is early bound in C# unless you go through the Reflection interface. Early bound just means the target method is found..

Convert generic List/Enumerable to DataTable?

http://stackoverflow.com/questions/564366/convert-generic-list-enumerable-to-datatable

into a datatable The only thing that i can imagine is use Reflection to do this. IF i have this List Whatever whatever new List Whatever..

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

question This can be done as mentioned with the help of Reflection Emit and a helper class I've included below. The code below.. static readonly ILog log LogManager.GetLogger System.Reflection.MethodBase.GetCurrentMethod .DeclaringType private static AssemblyName..

.Net - Reflection set object property

http://stackoverflow.com/questions/619767/net-reflection-set-object-property

Reflection set object property Is there a way in .Net c# 3.5 I can use.. I want to set obj.Name with reflection. Something like Reflection.SetProperty obj Name MyName Is there a way of doing this c#.. question Yes you can use Type.InvokeMember using System.Reflection MyObject obj new MyObject obj.GetType .InvokeMember Name BindingFlags.Instance..

Create instance of generic type?

http://stackoverflow.com/questions/731452/create-instance-of-generic-type

there are three candidate solutions Factory Pattern Reflection Activator I tend to think reflection is the least clean one..

Find a private field with Reflection?

http://stackoverflow.com/questions/95910/find-a-private-field-with-reflection

a private field with Reflection Given this class class Foo Want to find _bar with reflection..

How can I get the value of a string property via Reflection?

http://stackoverflow.com/questions/987982/how-can-i-get-the-value-of-a-string-property-via-reflection

can I get the value of a string property via Reflection public class Foo public string Bar get set How do I get the..