Пример #1
0
        public static ProviderConfiguration GetProvider(System.Xml.XPath.XPathNavigator nav)
        {
            ProviderConfiguration providers = new ProviderConfiguration();

            providers.GetProviders(nav);
            return(providers);
        }
Пример #2
0
        internal static ProviderConfiguration GetProvider(System.Xml.XmlNode node)
        {
            ProviderConfiguration providers = new ProviderConfiguration();

            providers.GetProviders(node);
            return(providers);
        }
Пример #3
0
        /// <summary>
        /// 从xml文件流中得到提供信息
        /// </summary>
        /// <param name="reader">可读流</param>
        public static ProviderConfiguration GetProvider(System.IO.TextReader reader)
        {
            ProviderConfiguration providers = new ProviderConfiguration();

            //providers._ProviderAttribute = filename;
            System.Xml.XmlDocument doc = new XmlDocument();
            doc.Load(reader);
            providers._ProviderType = doc.DocumentElement.Attributes["providerType"] == null ? "" : doc.DocumentElement.Attributes["providerType"].Value;
            foreach (XmlNode node2 in doc.DocumentElement.ChildNodes)
            {
                if (node2.Name == "providers")
                {
                    providers.GetProviders(node2);
                }
            }
            return(providers);
        }
Пример #4
0
        /// <summary>
        /// 从xml文件流中得到提供信息
        /// </summary>
        /// <param name="reader">可读文本流</param>
        /// <param name="group">组</param>
        /// <returns></returns>
        public static ProviderConfiguration GetProvider(System.IO.TextReader reader, string group)
        {
            ProviderConfiguration providers = new ProviderConfiguration();

            //providers._ProviderAttribute = filename;
            System.Xml.XmlDocument doc = new XmlDocument();
            doc.Load(reader);
            XmlNodeList list = doc.DocumentElement.SelectNodes(String.Format("providers[@group='{0}']", group));

            providers._ProviderType = doc.DocumentElement.Attributes["providerType"] == null ? "" : doc.DocumentElement.Attributes["providerType"].Value;
            foreach (XmlNode node2 in list)
            {
                if (node2.Name == "providers")
                {
                    if (node2.Attributes["providerType"] != null)
                    {
                        providers._ProviderType = node2.Attributes["providerType"].Value;
                    }
                    providers.GetProviders(node2);
                }
            }
            return(providers);
        }