Exemplo n.º 1
0
 /// <summary>
 /// Checks whether this element type is the same as the other element type.
 /// </summary>
 /// <param name="otherType">The other element type.</param>
 /// <returns>True if this element type is the same as the other element type.</returns>
 public bool Equals(IScenarioElementType otherType)
 {
     if (object.ReferenceEquals(otherType, null))
     {
         return(false);
     }
     return(this.Name == otherType.Name);
 }
Exemplo n.º 2
0
        /// <see cref="Object.Equals"/>
        public override bool Equals(object obj)
        {
            /// If parameter is null -> return false.
            if (object.ReferenceEquals(obj, null))
            {
                return(false);
            }

            /// If parameter cannot be cast to IScenarioElementType -> return false.
            IScenarioElementType type = obj as IScenarioElementType;

            if (object.ReferenceEquals(type, null))
            {
                return(false);
            }

            /// Return true if the names are equal.
            return(this.Name == type.Name);
        }