/// <summary> /// Initializes a new instance of the <see cref="WeakDelegate"/> class. /// </summary> /// <param name="del">The delegate to wrap.</param> public WeakDelegate(Delegate del) { if (del == null) { throw new ArgumentNullException("del"); } this.Method = del.Method; this.Target = del.Target; this.hashCode = HashCodeOperations.Combine(del.Target, del.Method); }
public override int GetHashCode() { if (this.hashCode == null) { this.hashCode = HashCodeOperations.Combine(BitConverter.ToInt32(this.Bytes, 0), BitConverter.ToInt32(this.Bytes, 4), BitConverter.ToInt32(this.Bytes, 8), BitConverter.ToInt32(this.Bytes, 12)); } return(this.hashCode.Value); }
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); }
/// <summary> /// Returns a hash code for this instance. /// </summary> /// <returns> /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. /// </returns> public override int GetHashCode() { return(HashCodeOperations.Combine(this.BindingToSource, this.Target)); }
/// <summary> /// Returns a hash code for this instance. /// Used object class's GetHashCode() method. /// </summary> /// <returns> /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. /// </returns> public override int GetHashCode() { return(HashCodeOperations.Combine(this.PropertyChangedHandle, this.Callback)); }
/// <summary> /// Returns a hash code for this instance. /// </summary> /// <returns> /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. /// </returns> public override int GetHashCode() { return(HashCodeOperations.Combine(this.Binding, this.Callback, this.KeepAlive)); }
public override int GetHashCode() { return(HashCodeOperations.Combine(this.TargetObject, this.TargetType, this.TargetProperty, this.TargetPropertyIndex)); }