Esempio n. 1
0
 public int CompareTo(ProjectData other)
 {
     if (Object.ReferenceEquals(other, null))
     {
         return(1);
     }
     return(ProjectName.CompareTo(other.ProjectName));
 }
Esempio n. 2
0
        public override int CompareTo(object obj)
        {
            var target = obj as Project;

            if (target == null)
            {
                throw new InvalidCastException("Must compare to same type.");
            }
            return(ProjectName.CompareTo(target.ProjectName));
        }
Esempio n. 3
0
 public int CompareTo(ProjectData other)
 {
     if (other is null)
     {
         return(1);
     }
     if (ProjectName.CompareTo(other.ProjectName) == 0)
     {
         return(Description.CompareTo(other.Description));
     }
     return(ProjectName.CompareTo(other.ProjectName));
 }
Esempio n. 4
0
 int IComparable <PeriodReport> .CompareTo(PeriodReport other)
 {
     if (other == null)
     {
         return(-1);
     }
     else
     {
         if (ProjectID == other.ProjectID)
         {
             if (Date == other.Date)
             {
                 return(Message.CompareTo(other.Message));
             }
             else
             {
                 return(Date.CompareTo(other.Date));
             }
         }
         else if (ProjectName == other.ProjectName)
         {
             if (Version == other.Version)
             {
                 Console.WriteLine("shouldn't go here...");
                 return(0);
             }
             else
             {
                 return(Version.CompareTo(other.Version));
             }
         }
         else
         {
             return(ProjectName.CompareTo(other.ProjectName));
         }
     }
 }