Microsoft.Web.Administration.ServerManager.GetAdministrationConfiguration C# (CSharp) Method

GetAdministrationConfiguration() public method

public GetAdministrationConfiguration ( WebConfigurationMap configMap, string configurationPath ) : Configuration
configMap WebConfigurationMap
configurationPath string
return Configuration
        public Configuration GetAdministrationConfiguration(WebConfigurationMap configMap, string configurationPath)
        {
            return null;
        }

Same methods

ServerManager::GetAdministrationConfiguration ( ) : Configuration

Usage Example

Exemplo n.º 1
0
        public static void AddUIModuleProvider(string name, string type)
        {
            using (ServerManager mgr = new ServerManager())
            {

                // First register the Module Provider  
                Configuration adminConfig = mgr.GetAdministrationConfiguration();

                ConfigurationSection moduleProvidersSection = adminConfig.GetSection("moduleProviders");
                ConfigurationElementCollection moduleProviders = moduleProvidersSection.GetCollection();
                if (FindByAttribute(moduleProviders, "name", name) == null)
                {
                    ConfigurationElement moduleProvider = moduleProviders.CreateElement();
                    moduleProvider.SetAttributeValue("name", name);
                    moduleProvider.SetAttributeValue("type", type);
                    moduleProviders.Add(moduleProvider);
                }

                // Now register it so that all Sites have access to this module 
                ConfigurationSection modulesSection = adminConfig.GetSection("modules");
                ConfigurationElementCollection modules = modulesSection.GetCollection();
                if (FindByAttribute(modules, "name", name) == null)
                {
                    ConfigurationElement module = modules.CreateElement();
                    module.SetAttributeValue("name", name);
                    modules.Add(module);
                }

                mgr.CommitChanges();
            }
        }
All Usage Examples Of Microsoft.Web.Administration.ServerManager::GetAdministrationConfiguration