예제 #1
0
 [RefreshProperties(RefreshProperties.All)] public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value)
 {
     if (context == null || provider == null || context.Instance == null)
     {
         return(base.EditValue(provider, value));
     }
     if (m_MethodDelegate == null)
     {
         DelegateAttribute attr = (DelegateAttribute)context.PropertyDescriptor.Attributes[typeof(DelegateAttribute)];
         m_MethodDelegate = attr.GetMethod;
     }
     if (m_sender == null)
     {
         m_sender = context.PropertyDescriptor as CustomProperty.CustomPropertyDescriptor;
     }
     return(m_MethodDelegate.Invoke(m_sender, null));
 }
 public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value)
 {
     if (context == null || provider == null || context.Instance == null)
     {
         return base.EditValue(provider, value);
     }
     if (m_MethodDelegate == null)
     {
         DelegateAttribute attr =  (DelegateAttribute) context.PropertyDescriptor.Attributes[typeof(DelegateAttribute)];
         m_MethodDelegate = attr.GetMethod;
     }
     if (m_sender == null)
     {
         m_sender = context.PropertyDescriptor as CustomProperty.CustomPropertyDescriptor;
     }
     return m_MethodDelegate.Invoke(m_sender, null);
 }
예제 #3
0
 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     if (context != null)
     {
         if (provider != null)
         {
             if (context.Instance != null)
             {
                 if (this.m_MethodDelegate == null)
                 {
                     UICustomEventEditor.DelegateAttribute delegateAttribute = (UICustomEventEditor.DelegateAttribute)context.PropertyDescriptor.Attributes[typeof(UICustomEventEditor.DelegateAttribute)];
                     this.m_MethodDelegate = delegateAttribute.GetMethod;
                 }
                 if (this.m_sender == null)
                 {
                     this.m_sender = (context.PropertyDescriptor as CustomProperty.CustomPropertyDescriptor);
                 }
                 return(this.m_MethodDelegate(this.m_sender, null));
             }
         }
     }
     return(base.EditValue(provider, RuntimeHelpers.GetObjectValue(value)));
 }
예제 #4
0
 public DelegateAttribute(UICustomEventEditor.OnClick MethodDelegate)
 {
     this.m_MethodDelegate = MethodDelegate;
 }
 public DelegateAttribute(UICustomEventEditor.OnClick MethodDelegate)
 {
     this.m_MethodDelegate = MethodDelegate;
 }