¡@

Home 

c# Programming Glossary: propinfo

Clone Controls - C# (Winform) [duplicate]

http://stackoverflow.com/questions/10266589/clone-controls-c-sharp-winform

T instance Activator.CreateInstance T foreach PropertyInfo propInfo in controlProperties if propInfo.CanWrite if propInfo.Name.. T foreach PropertyInfo propInfo in controlProperties if propInfo.CanWrite if propInfo.Name WindowTarget propInfo.SetValue.. propInfo in controlProperties if propInfo.CanWrite if propInfo.Name WindowTarget propInfo.SetValue instance propInfo.GetValue..

How to sort databound DataGridView column?

http://stackoverflow.com/questions/1699642/how-to-sort-databound-datagridview-column

FindCore PropertyDescriptor prop object key PropertyInfo propInfo typeof T .GetProperty prop.Name T item if key null for int.. item if key null for int i 0 i Count i item T Items i if propInfo.GetValue item null .Equals key return i return 1 public int..

C# Turning magic string into lambda expression

http://stackoverflow.com/questions/17770114/c-sharp-turning-magic-string-into-lambda-expression

type string propPath property.Split '.' var propInfo type.GetProperty propPath 0 if propInfo null throw new Exception.. '.' var propInfo type.GetProperty propPath 0 if propInfo null throw new Exception String.Format Could not find property..

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

FastPropertyGetHandler GetPropertyGetter PropertyInfo propInfo generates a dynamic method to generate a FastPropertyGetHandler.. string.Empty typeof object new Type typeof object propInfo.DeclaringType.Module ILGenerator ilGenerator dynamicMethod.GetILGenerator.. calls the getter ilGenerator.EmitCall OpCodes.Callvirt propInfo.GetGetMethod null creates code for handling the return value..

Silverlight DataGrid: Export to excel or csv

http://stackoverflow.com/questions/304322/silverlight-datagrid-export-to-excel-or-csv

grid string colPath System.Reflection.PropertyInfo propInfo System.Windows.Data.Binding binding System.Text.StringBuilder.. as DataGridBoundColumn .Binding colPath binding.Path.Path propInfo data.GetType .GetProperty colPath if propInfo null csvRow.Add.. propInfo data.GetType .GetProperty colPath if propInfo null csvRow.Add FormatCSVField propInfo.GetValue data null..

What's the difference between System.Type and System.RuntimeType in C#?

http://stackoverflow.com/questions/5737840/whats-the-difference-between-system-type-and-system-runtimetype-in-c

index Type runtimeType val.GetType PropertyInfo propInfo runtimeType.GetProperty UnderlyingSystemType Type type Type.. UnderlyingSystemType Type type Type propInfo.GetValue val null Since val is already a Type object val.GetType..

Retrieving Property name from lambda expression

http://stackoverflow.com/questions/671968/retrieving-property-name-from-lambda-expression

not a property. propertyLambda.ToString PropertyInfo propInfo member.Member as PropertyInfo if propInfo null throw new ArgumentException.. PropertyInfo propInfo member.Member as PropertyInfo if propInfo null throw new ArgumentException string.Format Expression '.. to a field not a property. propertyLambda.ToString if type propInfo.ReflectedType type.IsSubclassOf propInfo.ReflectedType throw..

Cast a property to its actual type dynamically using reflection

http://stackoverflow.com/questions/907882/cast-a-property-to-its-actual-type-dynamically-using-reflection

Main string args ClassB tester new ClassB PropertyInfo propInfo typeof ClassB .GetProperty MyProperty get a type unsafe reference.. type unsafe reference to ClassB`s property Object property propInfo.GetValue tester null get the type safe reference to the property..