public LinkedPropertyDescriptor(CustomPropertyDescriptor propertyDescriptor, LinkedDescriptorContextItem contextItem) : base(propertyDescriptor.EditingContext, propertyDescriptor.Component, propertyDescriptor.Name , PropertyWindowViewModelHelper.GetArrayFromCollection<Attribute>(propertyDescriptor.Attributes)) { _wrappedCustomPropertyDescriptor = propertyDescriptor; _contextItem = contextItem; // Since we need to call the protected methods but we still want the methods to be remained protected in other cases, use the reflector to do so. _setEFElementValueMethod = typeof(CustomPropertyDescriptor).GetMethod( "SetEFElementValue", BindingFlags.Instance | BindingFlags.NonPublic); Debug.Assert(_setEFElementValueMethod != null, "Type CustomPropertyDescriptor does not have 'SetEFElementValue' method."); _resetEFElementValue = typeof(CustomPropertyDescriptor).GetMethod( "ResetEFElementValue", BindingFlags.Instance | BindingFlags.NonPublic); Debug.Assert(_resetEFElementValue != null, "Type CustomPropertyDescriptor does not have 'ResetEFElementValue' method."); }
public LinkedPropertyDescriptor(CustomPropertyDescriptor propertyDescriptor, LinkedDescriptorContextItem contextItem) : base(propertyDescriptor.EditingContext, propertyDescriptor.Component, propertyDescriptor.Name , PropertyWindowViewModelHelper.GetArrayFromCollection <Attribute>(propertyDescriptor.Attributes)) { _wrappedCustomPropertyDescriptor = propertyDescriptor; _contextItem = contextItem; // Since we need to call the protected methods but we still want the methods to be remained protected in other cases, use the reflector to do so. _setEFElementValueMethod = typeof(CustomPropertyDescriptor).GetMethod( "SetEFElementValue", BindingFlags.Instance | BindingFlags.NonPublic); Debug.Assert(_setEFElementValueMethod != null, "Type CustomPropertyDescriptor does not have 'SetEFElementValue' method."); _resetEFElementValue = typeof(CustomPropertyDescriptor).GetMethod( "ResetEFElementValue", BindingFlags.Instance | BindingFlags.NonPublic); Debug.Assert(_resetEFElementValue != null, "Type CustomPropertyDescriptor does not have 'ResetEFElementValue' method."); }