Пример #1
0
        public static string Format(string format,
                                    IPropertyProvider propertyProvider)
        {
            if (string.IsNullOrEmpty(format))
            {
                return(string.Empty);
            }
            var ppf = PropertyProviderFormat.Parse(format);

            return(ppf.Format(propertyProvider));
        }
Пример #2
0
        static Exception _TryParse(string text, out PropertyProviderFormat result)
        {
            var items = ParseCore(text).ToArray();

            if (items.OfType <Error>().Any())
            {
                result = null;
                return(Failure.NotParsable("text", typeof(PropertyProviderFormat)));
            }

            result = new PropertyProviderFormat(items);
            return(null);
        }
Пример #3
0
 public static bool TryParse(string text, out PropertyProviderFormat result)
 {
     return(_TryParse(text, out result) == null);
 }
Пример #4
0
 public override string Eval(IPropertyProvider pp)
 {
     return(Convert.ToString(PropertyProviderFormat.Eval(pp, _text)));
 }