Ejemplo n.º 1
0
        internal static object CreateStatic(object parent, object configContext, XmlNode section)
        {
            object obj2 = parent;

            if (section != null)
            {
                obj2 = CloneParent(parent as NameValueCollection);
                bool flag = false;
                System.Data.Common.HandlerBase.CheckForUnrecognizedAttributes(section);
                foreach (XmlNode node in section.ChildNodes)
                {
                    if (!System.Data.Common.HandlerBase.IsIgnorableAlsoCheckForNonElement(node))
                    {
                        string str;
                        if (((str = node.Name) == null) || !(str == "settings"))
                        {
                            throw ADP.ConfigUnrecognizedElement(node);
                        }
                        if (flag)
                        {
                            throw ADP.ConfigSectionsUnique("settings");
                        }
                        flag = true;
                        DbProviderDictionarySectionHandler.CreateStatic(obj2 as NameValueCollection, configContext, node);
                    }
                }
            }
            return(obj2);
        }
Ejemplo n.º 2
0
        static internal object CreateStatic(object parent, object configContext, XmlNode section)
        {
            object config = parent;

            if (null != section)
            {
                config = CloneParent(parent as NameValueCollection);
                bool foundSettings = false;

                HandlerBase.CheckForUnrecognizedAttributes(section);
                foreach (XmlNode child in section.ChildNodes)
                {
                    if (HandlerBase.IsIgnorableAlsoCheckForNonElement(child))
                    {
                        continue;
                    }
                    string sectionGroup = child.Name;
                    switch (sectionGroup)
                    {
                    case DbProviderConfigurationHandler.settings:
                        if (foundSettings)
                        {
                            throw ADP.ConfigSectionsUnique(DbProviderConfigurationHandler.settings);
                        }
                        foundSettings = true;
                        DbProviderDictionarySectionHandler.CreateStatic(config as NameValueCollection, configContext, child);
                        break;

                    default:
                        throw ADP.ConfigUnrecognizedElement(child);
                    }
                }
            }
            return(config);
        }
Ejemplo n.º 3
0
        private static void HandleProviders(DataSet config, object configContext, XmlNode section, string sectionName)
        {
            DataTableCollection tables = config.Tables;
            DataTable           table  = tables[sectionName];
            bool flag = null != table;

            table = DbProviderDictionarySectionHandler.CreateStatic(table, configContext, section);
            if (!flag)
            {
                tables.Add(table);
            }
        }
Ejemplo n.º 4
0
        // sectionName - i.e. "providerconfiguration"
        private static void HandleProviders(DataSet config, object configContext, XmlNode section, string sectionName)
        {
            DataTableCollection tables    = config.Tables;
            DataTable           dataTable = tables[sectionName];
            bool tableExisted             = (null != dataTable);

            dataTable = DbProviderDictionarySectionHandler.CreateStatic(dataTable, configContext, section);
            if (!tableExisted)
            {
                tables.Add(dataTable);
            }
        }