Beispiel #1
0
        /// <inheritdoc />
        public bool Equals([AllowNull] Button other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Visible == other.Visible ||
                     Visible != null &&
                     Visible.Equals(other.Visible)
                     ) &&
                 (
                     Method == other.Method ||
                     Method != null &&
                     Method.Equals(other.Method)
                 ) &&
                 (
                     Equals(Args, other.Args) ||
                     Args != null && other.Args != null &&
                     Args.SequenceEqual(other.Args)
                 ) &&
                 (
                     Equals(Args2, other.Args2) ||
                     Args2 != null && other.Args2 != null &&
                     Args2.SequenceEqual(other.Args2)
                 ) &&
                 (
                     Label == other.Label ||
                     Label != null &&
                     Label.Equals(other.Label)
                 ) &&
                 (
                     Execute == other.Execute ||
                     Execute != null &&
                     Execute.Equals(other.Execute)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     TemplateItemName == other.TemplateItemName ||
                     TemplateItemName != null &&
                     TemplateItemName.Equals(other.TemplateItemName)
                 ));
        }
Beispiel #2
0
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;

                if (Visible != null)
                {
                    hashCode = hashCode * 59 + Visible.GetHashCode();
                }

                if (Method != null)
                {
                    hashCode = hashCode * 59 + Method.GetHashCode();
                }

                if (Args != null)
                {
                    hashCode = hashCode * 59 + Args.GetHashCode();
                }

                if (Args2 != null)
                {
                    hashCode = hashCode * 59 + Args2.GetHashCode();
                }

                if (Label != null)
                {
                    hashCode = hashCode * 59 + Label.GetHashCode();
                }

                if (Execute != null)
                {
                    hashCode = hashCode * 59 + Execute.GetHashCode();
                }

                if (Name != null)
                {
                    hashCode = hashCode * 59 + Name.GetHashCode();
                }

                if (TemplateItemName != null)
                {
                    hashCode = hashCode * 59 + TemplateItemName.GetHashCode();
                }

                return(hashCode);
            }
        }