Esempio n. 1
0
        public int SimpleCompare(Credential other)
        {
            Int32 nameCompare = Name.CompareTo(other.Name);

            if (nameCompare != 0)
            {
                return(nameCompare);
            }

            Int32 descriptionCompare = Description.CompareTo(other.Description);

            if (descriptionCompare != 0)
            {
                return(descriptionCompare);
            }

            Int32 websiteCompare = Website.CompareTo(other.Website);

            if (websiteCompare != 0)
            {
                return(websiteCompare);
            }

            Int32 usernameCompare = Username.CompareTo(other.Username);

            if (usernameCompare != 0)
            {
                return(usernameCompare);
            }

            Int32 passwordCompare = Password.CompareTo(other.Password);

            if (passwordCompare != 0)
            {
                return(passwordCompare);
            }

            Int32 notesCompare = Notes.CompareTo(other.Notes);

            if (notesCompare != 0)
            {
                return(notesCompare);
            }

            return(0);
        }
Esempio n. 2
0
        public int CompareTo(Credential other)
        {
            Int32 idCompare = ID.CompareTo(other.ID);

            if (idCompare != 0)
            {
                return(idCompare);
            }

            Int32 glyphKeyCompare = GlyphKey.CompareTo(other.GlyphKey);

            if (glyphKeyCompare != 0)
            {
                return(glyphKeyCompare);
            }

            Int32 glyphColourCompare = GlyphColour.CompareTo(other.GlyphColour);

            if (glyphColourCompare != 0)
            {
                return(glyphColourCompare);
            }

            Int32 nameCompare = Name.CompareTo(other.Name);

            if (nameCompare != 0)
            {
                return(nameCompare);
            }

            Int32 descriptionCompare = Description.CompareTo(other.Description);

            if (descriptionCompare != 0)
            {
                return(descriptionCompare);
            }

            Int32 websiteCompare = Website.CompareTo(other.Website);

            if (websiteCompare != 0)
            {
                return(websiteCompare);
            }

            Int32 createdAtCompare = CreatedAt.CompareTo(other.CreatedAt);

            if (createdAtCompare != 0)
            {
                return(createdAtCompare);
            }

            Int32 lastUpdatedAtCompare = LastModifiedAt.CompareTo(other.LastModifiedAt);

            if (lastUpdatedAtCompare != 0)
            {
                return(lastUpdatedAtCompare);
            }

            Int32 usernameCompare = Username.CompareTo(other.Username);

            if (usernameCompare != 0)
            {
                return(usernameCompare);
            }

            Int32 passwordCompare = Password.CompareTo(other.Password);

            if (passwordCompare != 0)
            {
                return(passwordCompare);
            }

            if (Tags.Count == other.Tags.Count)
            {
                if (!Tags.OrderBy(i => i).SequenceEqual(other.Tags.OrderBy(i => i)))
                {
                    return(-1);
                }
            }
            else
            {
                return(-1);
            }

            Int32 notesCompare = Notes.CompareTo(other.Notes);

            if (notesCompare != 0)
            {
                return(notesCompare);
            }

            return(0);
        }