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); }
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)); }
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)); } }
public int CompareTo(ProductNameComboBoxItem other) { return(ProductName.CompareTo(other.ProductName)); }