コード例 #1
0
        internal CommandTarget(Component component)
        {
            Component = component;
            var eventName = GetDefaultEventName(component.GetType());

            _defaultEvent    = Internals.SourceTypeDescriptor.GetEvent(component, eventName);
            _enabledProperty = Internals.SourceTypeDescriptor.GetProperty(component, "Enabled");
        }
コード例 #2
0
 public static SourcePropertyDescriptor GetProperty(Type sourceType, string propertyName)
 {
     return(GetOrCreateMember(sourceType, propertyName, (type, pro) =>
     {
         var property = new SourcePropertyDescriptor(type.GetProperty(pro, Reflection.BindingFlags.Public | Reflection.BindingFlags.NonPublic | Reflection.BindingFlags.Instance | Reflection.BindingFlags.Static));
         return property;
     }));
 }
コード例 #3
0
 internal CommandTarget(Component component, string eventName)
 {
     Component        = component;
     _defaultEvent    = Internals.SourceTypeDescriptor.GetEvent(component, eventName);
     _enabledProperty = Internals.SourceTypeDescriptor.GetProperty(component, "Enabled");
 }
コード例 #4
0
 /// <summary>
 /// 初始化 <see cref="ComponentProperty"/> 新实例。
 /// </summary>
 /// <param name="component"></param>
 /// <param name="propertyName"></param>
 public ComponentProperty(Component component, string propertyName)
 {
     Component       = component;
     PropertyName    = propertyName;
     bindingProperty = Internals.SourceTypeDescriptor.GetProperty(component, propertyName);
 }