Esempio n. 1
0
        public int CompareTo(Product other)
        {
            if (Id == other.Id)
            {
                return(0);
            }
            int x = ProductName.CompareTo(other.ProductName);

            if (x == 0)
            {
                return(Section.CompareTo(other.Section));
            }
            return(x);
        }
Esempio n. 2
0
 public int CompareTo(object obj)
 {
     if (!(obj is Category category))
     {
         return(1);
     }
     if (ProductName != category.ProductName)
     {
         return(ProductName == null ? -1 : ProductName.CompareTo(category.ProductName));
     }
     if (MessageType != category.MessageType)
     {
         return(MessageType.CompareTo(category.MessageType));
     }
     return(MessageTopic.CompareTo(category.MessageTopic));
 }
Esempio n. 3
0
        public int CompareTo(object obj)
        {
            if (obj is null || this is null)
            {
                return(0);
            }
            var cat = obj as Category;

            if (ProductName != null && cat.ProductName != null && !ProductName.Equals(cat.ProductName))
            {
                return(ProductName.CompareTo(cat.ProductName));
            }
            if (!Type.Equals(cat.Type))
            {
                return(Type.CompareTo(cat.Type));
            }
            else
            {
                return(Topic.CompareTo(cat.Topic));
            }
        }
Esempio n. 4
0
 public int CompareTo(ProductNameComboBoxItem other)
 {
     return(ProductName.CompareTo(other.ProductName));
 }