public IEnumerable<MvxBindingDescription> Parse(string text, IMvxBindingParser parser)
        {
            MvxSerializableBindingSpecification specification;
            if (!parser.TryParseBindingSpecification(text, out specification))
            {
                MvxBindingTrace.Trace(MvxTraceLevel.Error,
                                      "Failed to parse binding specification starting with {0}",
                                      text == null ? "" : (text.Length > 20 ? text.Substring(0, 20) : text));
                return null;
            }

            if (specification == null)
                return null;

            return from item in specification
                   select SerializableBindingToBinding(item.Key, item.Value);
        }
Ejemplo n.º 2
0
        public IEnumerable <MvxBindingDescription> Parse(string text, IMvxBindingParser parser)
        {
            MvxSerializableBindingSpecification specification;

            if (!parser.TryParseBindingSpecification(text, out specification))
            {
                MvxBindingLog.Error("Failed to parse binding description starting with {0}",
                                    GetErrorTextParameter(text));
                return(Array.Empty <MvxBindingDescription>());
            }

            if (specification == null)
            {
                return(Array.Empty <MvxBindingDescription>());
            }

            return(from item in specification
                   select SerializableBindingToBinding(item.Key, item.Value));
        }
        public IEnumerable <MvxBindingDescription> Parse(string text, IMvxBindingParser parser)
        {
            MvxSerializableBindingSpecification specification;

            if (!parser.TryParseBindingSpecification(text, out specification))
            {
                MvxBindingTrace.Trace(MvxTraceLevel.Error,
                                      "Failed to parse binding specification starting with {0}",
                                      text == null ? "" : (text.Length > 20 ? text.Substring(0, 20) : text));
                return(null);
            }

            if (specification == null)
            {
                return(null);
            }

            return(from item in specification
                   select SerializableBindingToBinding(item.Key, item.Value));
        }
 public MvxCompositeBindingParser()
 {
     _jsonBindingParser  = new MvxJsonBindingParser();
     _swissBindingParser = new MvxSwissBindingParser();
 }
 public MvxCompositeBindingParser()
 {
     _jsonBindingParser = new MvxJsonBindingParser();
     _swissBindingParser = new MvxSwissBindingParser();
 }