Наследование: IronRuby.Runtime.Calls.RubyMemberInfo
Пример #1
0
        public RubyEvent(object/*!*/ target, RubyEventInfo/*!*/ info, string/*!*/ name) {
            ContractUtils.RequiresNotNull(target, "target");
            ContractUtils.RequiresNotNull(info, "info");
            ContractUtils.RequiresNotNull(name, "name");

            _target = target;
            _info = info;
            _name = name;
        }
Пример #2
0
        private bool TryGetClrEvent(Type/*!*/ type, BindingFlags bindingFlags, bool inherited, string/*!*/ name, out RubyMemberInfo method) {
            Assert.NotNull(type, name);

            EventInfo eventInfo;
            if (inherited) {
                eventInfo = type.GetInheritedEvents(name).WithBindingFlags(bindingFlags).FirstOrDefault();
            } else {
                eventInfo = type.GetDeclaredEvent(name).WithBindingFlags(bindingFlags);
            }
            
            if (eventInfo != null) {
                // creates detached info if only declared members are requested (used by Kernel#clr_member):
                method = new RubyEventInfo((EventTracker)MemberTracker.FromMemberInfo(eventInfo), RubyMemberFlags.Public, this, isDetached: inherited);
                return true;
            }

            method = null;
            return false;
        }
Пример #3
0
        private bool TryGetClrEvent(Type/*!*/ type, BindingFlags bindingFlags, string/*!*/ name, out RubyMemberInfo method) {
            Assert.NotNull(type, name);

            EventInfo eventInfo = type.GetEvent(name, bindingFlags);
            if (eventInfo != null) {
                // creates detached info if only declared members are requested (used by Kernel#clr_member):
                bool createDetached = (bindingFlags & BindingFlags.DeclaredOnly) != 0;
                method = new RubyEventInfo((EventTracker)MemberTracker.FromMemberInfo(eventInfo), RubyMemberFlags.Public, this, createDetached);
                return true;
            }

            method = null;
            return false;
        }
Пример #4
0
 public static RubyEvent/*!*/ CreateEvent(RubyEventInfo/*!*/ eventInfo, object/*!*/ target, string/*!*/ name) {
     return new RubyEvent(target, eventInfo, name);
 }
Пример #5
0
 public static Proc/*!*/ HookupEvent(RubyEventInfo/*!*/ eventInfo, object/*!*/ target, Proc/*!*/ proc) {
     eventInfo.Tracker.AddHandler(target, proc, eventInfo.Context);
     return proc;
 }
Пример #6
0
        private bool TryGetClrEvent(Type/*!*/ type, BindingFlags bindingFlags, string/*!*/ name, out RubyMemberInfo method) {
            Assert.NotNull(type, name);

            EventInfo eventInfo = type.GetEvent(name, bindingFlags);
            if (eventInfo != null) {
                method = new RubyEventInfo((EventTracker)MemberTracker.FromMemberInfo(eventInfo), RubyMemberFlags.Public, this);
                return true;
            }

            method = null;
            return false;
        }