Пример #1
0
        public int CompareTo(object obj)
        {
            //return 0;
            if (obj == null)
            {
                return(1);
            }
            PathCardN fp = (PathCardN)obj;

            if (fp.Parent == null && Parent != null)
            {
                return(-1);
            }
            if (fp.Parent != null && Parent == null)
            {
                return(1);
            }
            int i = 0;

            if (Parent != null)
            {
                i = Parent.CompareTo(fp.Parent);
            }
            return((i == 0) ? CodeN.CompareTo(fp.CodeN) : i);
        }
Пример #2
0
        public override bool Equals(object obj)
        {
            if (obj == null || obj == DBNull.Value)
            {
                return(false);
            }
            PathCardN cp = (PathCardN)obj;

            return(PathTreeN.Equals(Parent, cp.Parent) && int.Equals(CodeN, cp.CodeN));
        }
Пример #3
0
        public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
        {
            if (destinationType == typeof(System.String) && value is PathCardN)
            {
                PathCardN so = (PathCardN)value;

                return(so.ToString());
            }
            return(base.ConvertTo(context, culture, value, destinationType));
        }
Пример #4
0
 public static bool Equals(PathCardN a, PathCardN b)
 {
     if (a == null || b == null)
     {
         return(false);
     }
     if (a.CodeN != b.CodeN)
     {
         return(false);
     }
     return(PathTree.Equals(a.Parent, b.Parent));
 }
Пример #5
0
 public static int Compare(PathCardN a, PathCardN b)
 {
     if (a == null && b == null)
     {
         return(0);
     }
     if (a != null)
     {
         return(a.CompareTo(b));
     }
     else
     {
         return(-b.CompareTo(a));
     }
 }