示例#1
0
 /// <summary>
 /// Equals() - pro použití GID v Hashtabulkách
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public override bool Equals(object obj)
 {
     if (!(obj is GId))
     {
         return(false);
     }
     return(GId._IsEqual(this, (GId)obj));
 }
示例#2
0
        /// <summary>
        /// Porovnání dvou instancí této struktury, zda obsahují shodná data
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <returns></returns>
        private static bool _IsEqual(GId a, GId b)
        {
            bool an = ((object)a) == null;
            bool bn = ((object)b) == null;

            if (an && bn)
            {
                return(true);                    // null == null
            }
            if (an || bn)
            {
                return(false);                   // (any object) != null
            }
            return(a.Name == b.Name);
        }
示例#3
0
 /// <summary>
 /// Operátor "není rovno"
 /// </summary>
 /// <param name="a"></param>
 /// <param name="b"></param>
 /// <returns></returns>
 public static bool operator !=(GId a, GId b)
 {
     return(!GId._IsEqual(a, b));
 }