Пример #1
0
        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);
        }
Пример #2
0
 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" };
 }