Ejemplo n.º 1
0
        public TypedTextElement(string word, string type, IElementFormatter elementFormatter)
        {
            if (elementFormatter == null)
            {
                throw new ArgumentException($"{nameof(elementFormatter)} can't be null");
            }

            if (string.IsNullOrEmpty(word))
            {
                throw new ArgumentException("Element can't be null or empty");
            }

            Word = elementFormatter.ConvertToUsedForm(word)
                   ?? throw new ArgumentException("Element after formatting can't be null");
            Type = type ?? throw new ArgumentException("Element type can't be null");
        }
Ejemplo n.º 2
0
 public YandexElementParser(IEnumerable <IElementValidator> elementValidators,
                            IElementFormatter elementFormatter, YandexToolUser toolUser) :
     base(elementValidators, elementFormatter)
 {
     this.toolUser = toolUser;
 }
Ejemplo n.º 3
0
 protected BaseElementParser(IElementFormatter elementFormatter)
 {
     ElementFormatter = elementFormatter;
 }
Ejemplo n.º 4
0
 protected ElementParserWithRules(IEnumerable <IElementValidator> elementValidators, IElementFormatter elementFormatter) :
     base(elementFormatter)
 {
     ElementValidators = elementValidators;
 }