コード例 #1
0
        public override void SetValue(object theObject, object theValue)
        {
            PropertyDescriptor descriptor;
            IVariablePropertiesCategorizedItem item = (IVariablePropertiesCategorizedItem)theObject;

            if (this.TryGetPropertyDescriptor(item, out descriptor))
            {
                descriptor.SetValue(item.PropertyValueStore, theValue);
            }
        }
コード例 #2
0
        public override object GetValue(object theObject)
        {
            PropertyDescriptor descriptor;
            IVariablePropertiesCategorizedItem item = (IVariablePropertiesCategorizedItem)theObject;

            if (this.TryGetPropertyDescriptor(item, out descriptor))
            {
                return(descriptor.GetValue(item.PropertyValueStore));
            }
            return(null);
        }
コード例 #3
0
 private bool TryGetPropertyDescriptor(IVariablePropertiesCategorizedItem obj, out PropertyDescriptor propertyDescriptor)
 {
     try
     {
         propertyDescriptor = obj.GetPropertyDescriptorContainer().PropertyDescriptors[this.descriptor.Name];
     }
     catch
     {
         propertyDescriptor = null;
     }
     return(propertyDescriptor != null);
 }