Exemplo n.º 1
0
        private void PreprocessForTypeArguments(List <XamlAttribute> attrList)
        {
            int typeArgsIdx = -1;

            for (int i = 0; i < attrList.Count; i++)
            {
                XamlAttribute attr = attrList[i];

                // Find x:TypeArguments if it was present.
                if (KS.Eq(attr.Name.Name, XamlLanguage.TypeArguments.Name))
                {
                    string     attrNamespace     = _parserContext.FindNamespaceByPrefix(attr.Name.Prefix);
                    XamlMember directiveProperty = _parserContext.ResolveDirectiveProperty(attrNamespace, attr.Name.Name);
                    if (directiveProperty != null)
                    {
                        typeArgsIdx            = i;
                        _typeArgumentAttribute = attr;
                        break;
                    }
                }
            }
            if (typeArgsIdx >= 0)
            {
                attrList.RemoveAt(typeArgsIdx);
            }
        }
Exemplo n.º 2
0
        // Enqueue nodes from the "settings".
        // I.e  move state from the setting into the node stream.
        private void EnqueueInitialXmlState()
        {
            string            xmlNs         = _context.FindNamespaceByPrefix(KnownStrings.XmlPrefix);
            XamlSchemaContext schemaContext = _context.SchemaContext;

            if (_settings.XmlSpacePreserve == true)
            {
                EnqueueOneXmlDirectiveProperty(XamlLanguage.Space, KnownStrings.Preserve);
            }
            if (!String.IsNullOrEmpty(_settings.XmlLang))
            {
                EnqueueOneXmlDirectiveProperty(XamlLanguage.Lang, _settings.XmlLang);
            }
            if (_settings.BaseUri != null)
            {
                EnqueueOneXmlDirectiveProperty(XamlLanguage.Base, _settings.BaseUri.ToString());
            }
        }