public bool Equals(SpecialRule r) { if ((object)r == null) { return(false); } //If the names of the rules match, they are considered equal if (this.Name == r.Name) { return(true); } return(false); }
public override bool Equals(object obj) { //If the param is null, return False if (obj == null) { return(false); } //If param cannot be cast as SpecialRule, return false SpecialRule r = obj as SpecialRule; if ((System.Object)r == null) { return(false); } //If the names of the rules match, they are considered equal if (this.Name == r.Name) { return(true); } return(false); }