Пример #1
0
        private UniversalEventHandle(Binding binding, UniversalEventCallback callback)
        {
            if (binding == null)
            {
                throw new ArgumentNullException("binding");
            }
            if (callback == null)
            {
                throw new ArgumentNullException("callback");
            }

            this.UniversalEventType    = UniversalEventType.PropertyChange;
            this.PropertyChangedHandle = PropertyChangedHandle.GetDistinctInstance(binding, this.OnPropertyChanged);
            this.Callback = callback;

            this.hashCode = HashCodeOperations.Combine(this.PropertyChangedHandle, callback);
        }
Пример #2
0
        private UniversalEventHandle(object source, EventInfo eventInfo, UniversalEventCallback callback)
        {
            if (eventInfo == null)
            {
                throw new ArgumentNullException("eventInfo");
            }
            if (callback == null)
            {
                throw new ArgumentNullException("callback");
            }

            this.UniversalEventType = UniversalEventType.Event;
            this.EventInfo          = eventInfo;
            GenericAction.AddGenericEventHandler(source, eventInfo, this.OnEventChanged);
            this.Callback = callback;

            this.hashCode = HashCodeOperations.Combine(source ?? 0, eventInfo, callback);
        }
Пример #3
0
 public static UniversalEventHandle GetInstance(Binding binding, UniversalEventCallback callback)
 {
     return(DistinctInstanceProvider <UniversalEventHandle> .Instance.GetDistinctInstance(new UniversalEventHandle(binding, callback)));
 }
Пример #4
0
 public static UniversalEventHandle GetInstance(object source, EventInfo eventInfo, UniversalEventCallback callback)
 {
     return(DistinctInstanceProvider <UniversalEventHandle> .Instance.GetDistinctInstance(new UniversalEventHandle(source, eventInfo, callback)));
 }