コード例 #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
ファイル: HLib2Static.HIndexOf.cs プロジェクト: htna/explsolv
 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
ファイル: HLib2Static.HIndexOf.cs プロジェクト: htna/explsolv
 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;
 }