コード例 #1
0
ファイル: WeakDelegate.cs プロジェクト: SmaSTra/SmaSTra
        /// <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
ファイル: MD5Checksum.cs プロジェクト: SmaSTra/SmaSTra
        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
ファイル: DumbBinding.cs プロジェクト: SmaSTra/SmaSTra
 /// <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));
 }
コード例 #6
0
 /// <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));
 }