private void SetFlags(bool @value, EFlag flag) { if (@value) { if (!this._flags.Exists(o => o.Type == flag)) { this._flags.Add(new MessageFlag(flag)); } } else { if (this._flags.Exists(o => o.Type == flag)) { MessageFlag messageFlag = this._flags.Find(o => o.Type == flag); this._flags.Remove(messageFlag); } } }
public bool Equals(MessageFlag other) { if (object.ReferenceEquals(null, other)) { return(false); } if (!object.ReferenceEquals(this, other)) { if (other._type != this._type) { return(false); } if (other._type == EFlag.NonStandart) { return(string.Equals(other.flagString, this.flagString, StringComparison.OrdinalIgnoreCase)); } } return(true); }