Ejemplo n.º 1
0
        private static ExtensionProviderCollection GenerateChildExtensionProvider(XmlNodeList childNodes, Extension extension, string extensionPoint)
        {
            ExtensionProviderCollection extensionProviders = new ExtensionProviderCollection();

            foreach (XmlNode xmlNode in childNodes)
            {
                if (xmlNode is XmlComment)
                {
                    continue;
                }

                NameValueCollection attributesCollection = new NameValueCollection();
                foreach (XmlAttribute attr in xmlNode.Attributes)
                {
                    attributesCollection.Add(attr.Name, attr.Value);
                }

                ExtensionProvider extensionProvider = new ExtensionProvider {
                    ExtensionPoint = extensionPoint, AttributesCollection = attributesCollection, Bundle = extension.Owner, ChildExtensionProvider = GenerateChildExtensionProvider(xmlNode.ChildNodes, extension, extensionPoint)
                };
                extensionProviders.AddExtensionProvider(extensionProvider);
            }

            return(extensionProviders);
        }
Ejemplo n.º 2
0
        public static void BuildBootstrapLayout(Extension extension, ExtensionProviderCollection extensionProviders)
        {
            foreach (var xmlNode in extension.Data)
            {
                if (xmlNode is XmlComment)
                {
                    continue;
                }

                NameValueCollection attributesCollection = new NameValueCollection();
                foreach (XmlAttribute attr in xmlNode.Attributes)
                {
                    attributesCollection.Add(attr.Name, attr.Value);
                }

                var extensionPoint = xmlNode.ParentNode.FirstChild.ParentNode.Attributes["Point"].Value;
                ExtensionProvider extensionProvider = new ExtensionProvider {
                    ExtensionPoint = extensionPoint, AttributesCollection = attributesCollection, Bundle = extension.Owner, ChildExtensionProvider = GenerateChildExtensionProvider(xmlNode.ChildNodes, extension, extensionPoint)
                };
                extensionProviders.AddExtensionProvider(extensionProvider);
            }
        }