Inheritance: FormatSpecifier
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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));
        }