void AddTagToBody(string str) { var indexOfNextCloseParenthesis = str.IndexOf("}"); if (indexOfNextCloseParenthesis == -1) { throw new ArgumentException("Incorrect mask"); } var item = new MaskItem() { Type = MaskItemType.TagName, Value = str.Substring(0, indexOfNextCloseParenthesis) }; if (_body.Contains(item)) { throw new ArgumentException("Incorrect mask"); } _body.AddLast(item); }
public void Init() { _item1 = new MaskItem() { Type = MaskItemType.Delimiter, Value = "item" }; _item2 = new MaskItem() { Type = MaskItemType.Delimiter, Value = "item" }; _item3 = new MaskItem() { Type = MaskItemType.TagName, Value = "item" }; }