示例#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");
        }
 public static SourceEventDescriptor GetEvent(Type sourceType, string eventName)
 {
     return(GetOrCreateMember(sourceType, eventName, (type, evn) =>
     {
         var property = new SourceEventDescriptor(type.GetEvent(evn, 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");
 }