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); }
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); }
public static UniversalEventHandle GetInstance(Binding binding, UniversalEventCallback callback) { return(DistinctInstanceProvider <UniversalEventHandle> .Instance.GetDistinctInstance(new UniversalEventHandle(binding, callback))); }
public static UniversalEventHandle GetInstance(object source, EventInfo eventInfo, UniversalEventCallback callback) { return(DistinctInstanceProvider <UniversalEventHandle> .Instance.GetDistinctInstance(new UniversalEventHandle(source, eventInfo, callback))); }