示例#1
0
文件: Pair.cs 项目: htna/explsolv
        public override int GetHashCode()
        {
            HDebug.Depreciated();
            int hashFirst  = (first != null) ?  first.GetHashCode() : 0;
            int hashSecond = (second != null) ? second.GetHashCode() : 0;
            int hash       = hashFirst + hashSecond;

            return(hash);
        }
示例#2
0
 public static int[] HIndexOfReference_depreciated <T>(this IList <T> values, IList <T> searchFrom)
     where T : class
 {
     HDebug.Depreciated();
     int[] index = new int[values.Count];
     for (int i = 0; i < values.Count; i++)
     {
         index[i] = values[i].HIndexOfReference_depreciated(searchFrom);
     }
     return(index);
 }
示例#3
0
 public static int HIndexOfReference_depreciated <T>(this T values, IList <T> searchFrom)
     where T : class
 {
     HDebug.Depreciated();
     for (int i = 0; i < searchFrom.Count; i++)
     {
         if (object.ReferenceEquals(values, searchFrom[i]))
         {
             return(i);
         }
     }
     return(-1);
 }
示例#4
0
文件: Pair.cs 项目: htna/explsolv
 public static bool operator ==(Pair <T, U> left, Pair <T, U> right)
 {
     HDebug.Depreciated();
     if (((object)left) == null && ((object)right) == null)
     {
         return(true);                                                   // true, if both of them are null
     }
     if (((object)left) == null || ((object)right) == null)
     {
         return(false);                                                  // false, if only one of them
     }
     return(left.Equals(right));
 }
示例#5
0
文件: Pair.cs 项目: htna/explsolv
        public override bool Equals(object obj)
        {
            HDebug.Depreciated();
            // If parameter is null return false.
            if (obj == null)
            {
                return(false);
            }

            // If parameter cannot be cast to Point return false.
            if (obj.GetType() != typeof(Pair <T, U>))
            {
                return(false);
            }
            Pair <T, U> pair = (Pair <T, U>)obj;

            // Return true if the fields match:
            return(Equals(pair));
        }
示例#6
0
文件: Pair.cs 项目: htna/explsolv
 public Pair(Pair <T, U> pair)
 {
     HDebug.Depreciated();
     this.first  = pair.first;
     this.second = pair.second;
 }
示例#7
0
文件: Pair.cs 项目: htna/explsolv
 public Pair(T first, U second)
 {
     HDebug.Depreciated();
     this.first  = first;
     this.second = second;
 }