private async IAsyncEnumerable <KeyValuePair <String, IPropertyBinding> > GetBindings(
            Type dataContextType,
            IMarkupNode node,
            Dictionary <String, String>
            nameSpaceAssemblySearch)
        {
            foreach (var kvp in node.GetAllAttributes())
            {
                BindingType bindingType;

                var valTrim = kvp.Value.Trim();
                if (valTrim.Length < 3 ||
                    valTrim[0] != '{' || valTrim[valTrim.Length - 1] != '}')
                {
                    continue;
                }

                var valExpression = valTrim.Substring(1, valTrim.Length - 2);

                var expressionGroups = valExpression.Split(',');

                var expressionTokens = expressionGroups[0].Split();

                String propName;

                switch (expressionTokens.Length)
                {
                case 2 when expressionTokens[0] == DATA_BINDING:
Exemple #2
0
        private static Dictionary <String, String> GetNamespaceAssemblySearchImpl(IMarkupNode node,
                                                                                  Dictionary <String, String> nsAsmSearch)
        {
            foreach (var attribute in node.GetAllAttributes())
            {
                if (!attribute.Key.StartsWith("xmlns:"))
                {
                    continue;
                }
                var tokens = attribute.Value.Split(';');


                String?asmName = null;
                String?ns      = null;

                for (var t = 0; t < tokens.Length; t++)
                {
                    var subTokens = tokens[t].Split(_namespaceSplitters);
                    if (subTokens.Length != 2)
                    {
                        continue;
                    }

                    switch (subTokens[0])
                    {
                    case "clr-namespace":
                        ns = subTokens[1];
                        break;

                    case "assembly":
                        asmName = subTokens[1];
                        //if (!asmName.EndsWith(".dll", StringComparison.OrdinalIgnoreCase) &&
                        //    !asmName.EndsWith(".exe", StringComparison.OrdinalIgnoreCase))
                        //{
                        //    asmName += ".dll";
                        //}
                        break;
                    }
                }

                if (ns == null)
                {
                    continue;
                }

                if (asmName == null)
                {
                    continue;
                }

                nsAsmSearch[ns] = asmName;
            }

            return(nsAsmSearch);
        }