示例#1
0
        /// <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);
        }
示例#2
0
        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);
        }
示例#3
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);
        }
示例#4
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);
        }
示例#5
0
 /// <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));
 }
示例#7
0
 /// <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));
 }
示例#8
0
 public override int GetHashCode()
 {
     return(HashCodeOperations.Combine(this.TargetObject, this.TargetType, this.TargetProperty, this.TargetPropertyIndex));
 }