This question is locked. New answers and comments are not allowed.
Hi,
I cannot get Descriptor property using reflection:
i get exception in IE Console:
Message: System.MethodAccessException: Attempt by method 'ProIntegra.UDC.Frontend.GUI.DCRoom.Controls.DCObjectPropertiesControl.SetUnitsInRadPropertyGriditems(System.Tuple`3<ProIntegra.Frameworks.GlobalHelpers.CapacityUnits,ProIntegra.Frameworks.GlobalHelpers.LengthUnits,ProIntegra.Frameworks.GlobalHelpers.WeightUnits>)' to access method 'Telerik.SilverlightExtensions.PropertyDescriptor.get_Attributes()' failed.
w System.RuntimeMethodHandle.PerformSecurityCheck(Object obj, RuntimeMethodHandleInternal method, RuntimeType parent, UInt32 invocationFlags)
w System.RuntimeMethodHandle.PerformSecurityCheck(Object obj, IRuntimeMethodInfo method, RuntimeType parent, UInt32 invocationFlags)
w System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
w System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
w System.Reflection.RuntimePropertyInfo.GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
w System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)
Anyone can help me?
I cannot get Descriptor property using reflection:
PropertyInfo[] propertiesInfo;PropertyInfo attributePropertyInfo;foreach (var propertyDefinition in infrastructureItemPropertyGrid.PropertyDefinitions){ propertiesInfo = propertyDefinition.SourceProperty.Descriptor.GetType().GetProperties(); attributePropertyInfo = propertiesInfo.FirstOrDefault(x => x.Name == "Attributes"); (Attribute[])(attributePropertyInfo.GetValue(propertyDefinition.SourceProperty.Descriptor, null));}i get exception in IE Console:
Message: System.MethodAccessException: Attempt by method 'ProIntegra.UDC.Frontend.GUI.DCRoom.Controls.DCObjectPropertiesControl.SetUnitsInRadPropertyGriditems(System.Tuple`3<ProIntegra.Frameworks.GlobalHelpers.CapacityUnits,ProIntegra.Frameworks.GlobalHelpers.LengthUnits,ProIntegra.Frameworks.GlobalHelpers.WeightUnits>)' to access method 'Telerik.SilverlightExtensions.PropertyDescriptor.get_Attributes()' failed.
w System.RuntimeMethodHandle.PerformSecurityCheck(Object obj, RuntimeMethodHandleInternal method, RuntimeType parent, UInt32 invocationFlags)
w System.RuntimeMethodHandle.PerformSecurityCheck(Object obj, IRuntimeMethodInfo method, RuntimeType parent, UInt32 invocationFlags)
w System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
w System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
w System.Reflection.RuntimePropertyInfo.GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
w System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)