Sarcasm.Reflection.MetaFormatter.MetaFormatter C# (CSharp) Method

MetaFormatter() public method

public MetaFormatter ( Type formatterType ) : System
formatterType System.Type
return System
        public MetaFormatter(Type formatterType)
        {
            var formatterAttribute = formatterType.GetCustomAttribute<FormatterAttribute>();

            if (!IsFormatterType(formatterType))
                throw new ArgumentException("Type should be a formatter type, i.e. a subclass of Formatter with FormatterAttribute", "type");

            this.FormatterType = formatterType;
            this.FormatterAttribute = formatterAttribute;
            this.GrammarType = formatterAttribute.GrammarType;
        }