Пример #1
0
        public override bool Equals(object obj)
        {
            KdbxGroup other = obj as KdbxGroup;

            if (other == null)
            {
                return(false);
            }

            if (Parent != null)
            {
                if (other.Parent == null)
                {
                    return(false);
                }
                if (!Parent.Uuid.Equals(other.Parent.Uuid))
                {
                    return(false);
                }
            }
            else
            {
                if (other.Parent != null)
                {
                    return(false);
                }
            }

            if (!Uuid.Equals(other.Uuid))
            {
                return(false);
            }

            if (!Title.Equals(other.Title) || !Notes.Equals(other.Notes))
            {
                return(false);
            }

            if (IconID != other.IconID)
            {
                return(false);
            }

            if (CustomIconUuid != null)
            {
                if (!CustomIconUuid.Equals(other.CustomIconUuid))
                {
                    return(false);
                }
            }
            else
            {
                if (other.CustomIconUuid != null)
                {
                    return(false);
                }
            }

            if (!Times.Equals(other.Times))
            {
                return(false);
            }

            if (IsExpanded != other.IsExpanded || !LastTopVisibleEntry.Equals(other.LastTopVisibleEntry))
            {
                return(false);
            }

            if (DefaultAutoTypeSequence != other.DefaultAutoTypeSequence ||
                EnableAutoType != other.EnableAutoType ||
                EnableSearching != other.EnableSearching)
            {
                return(false);
            }

            int childCount = Children.Count;

            if (childCount != other.Children.Count)
            {
                return(false);
            }

            for (int i = 0; i < childCount; i++)
            {
                if (!Children[i].Equals(other.Children[i]))
                {
                    return(false);
                }
            }

            if (CustomData != null)
            {
                if (!CustomData.Equals(other.CustomData))
                {
                    return(false);
                }
            }
            else
            {
                if (other.CustomData != null)
                {
                    return(false);
                }
            }

            return(true);
        }