Inheritance: FormatSpecifier
示例#1
0
        public VariableFormatSpecifier(StaticFormatSpecifier defaultFormatSpecifier,
                                       Func<string, StaticFormatSpecifier, StaticFormatSpecifier> getFormatSpecifier)
        {
            DefaultFormatSpecifier = defaultFormatSpecifier;

            if (getFormatSpecifier == null)
                throw new ArgumentNullException("getFormatSpecifier.", "VariableFormatSpecifier is missing Tag-to-FormatSpecifier function.");

            GetFormatSpecifier = getFormatSpecifier;
        }
示例#2
0
        public VariableFormatSpecifier(StaticFormatSpecifier defaultFormatSpecifier,
                                       Func <string, StaticFormatSpecifier, StaticFormatSpecifier> getFormatSpecifier)
        {
            DefaultFormatSpecifier = defaultFormatSpecifier;

            if (getFormatSpecifier == null)
            {
                throw new ArgumentNullException("getFormatSpecifier.", "VariableFormatSpecifier is missing Tag-to-FormatSpecifier function.");
            }

            GetFormatSpecifier = getFormatSpecifier;
        }
示例#3
0
        public override FormatSpecifier Recalc(string tag)
        {
            if (string.IsNullOrEmpty(tag))
            {
                return(this);
            }

            StaticFormatSpecifier newFormatSpecifier = GetFormatSpecifier(tag, DefaultFormatSpecifier);

            if (newFormatSpecifier == null)
            {
                return(this);
            }

            return(new VariableFormatSpecifier(newFormatSpecifier, GetFormatSpecifier));
        }