Пример #1
0
        public static MarkupExtension Parse(string src)
        {
            src = src.Trim();
            var result = new MarkupExtension();

            if (src.StartsWith("{") && src.EndsWith("}"))
            {
                var t   = src.TrimStart('{').TrimEnd('}');
                var spl = t.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

                result.Name = spl[0];

                if (spl.Length > 0)
                {
                    var args = spl[1].Split(new[] { ',' });

                    result.Arguments.AddRange(args);
                }

                return(result);
            }
            return(MarkupExtension.Empty);
        }
        public static MarkupExtension Parse(string src)
        {
            src = src.Trim();
            var result = new MarkupExtension();

            if(src.StartsWith("{") && src.EndsWith("}"))
            {
                var t = src.TrimStart('{').TrimEnd('}');
                var spl = t.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

                result.Name = spl[0];

                if (spl.Length > 0)
                {
                    var args = spl[1].Split(new[] { ',' });

                    result.Arguments.AddRange(args);
                }

                return result;
            }
            return MarkupExtension.Empty;
        }
Пример #3
0
 public abstract object ProvideValue(MarkupExtension me);