Ejemplo n.º 1
0
        public void AddAppPlugin(Type type, string name)
        {
            if (this.appConfigurationSection.AppPlugins == null)
            {
                this.appConfigurationSection.AppPlugins = new AppPluginElementCollection();
            }

            foreach (AppPluginElement appPluginItem in this.appConfigurationSection.AppPlugins)
            {
                if (appPluginItem.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase) ||
                    appPluginItem.Type.Equals(type.AssemblyQualifiedName, StringComparison.InvariantCultureIgnoreCase))
                {
                    return;
                }
            }

            AppPluginElement modulePlugin = new AppPluginElement();

            modulePlugin.Type = type.AssemblyQualifiedName;
            modulePlugin.Name = name;
            this.appConfigurationSection.AppPlugins.Add(modulePlugin);
        }
Ejemplo n.º 2
0
        public void AddAppPlugin(Type type, string name) 
        {
            if (this.appConfigurationSection.AppPlugins == null)
            {
                this.appConfigurationSection.AppPlugins = new AppPluginElementCollection();
            }

            foreach (AppPluginElement appPluginItem in this.appConfigurationSection.AppPlugins) 
            {
                if (appPluginItem.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase) ||
                    appPluginItem.Type.Equals(type.AssemblyQualifiedName, StringComparison.InvariantCultureIgnoreCase))
                {
                    return;
                }
            }

            AppPluginElement modulePlugin = new AppPluginElement();
            modulePlugin.Type = type.AssemblyQualifiedName;
            modulePlugin.Name = name;
            this.appConfigurationSection.AppPlugins.Add(modulePlugin);
        }