예제 #1
0
        /// <summary>
        /// Initialize a new instance of the <see cref="ConfigurationUIHierarchy"/> class.
        /// </summary>
        /// <param name="rootNode">The root node of the hierarchy.</param>
        /// <param name="serviceProvider">The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param>
        public ConfigurationUIHierarchy(ConfigurationApplicationNode rootNode, IServiceProvider serviceProvider)
        {
            if (rootNode == null)
            {
                throw new ArgumentNullException("rootNode");
            }
            if (serviceProvider == null)
            {
                throw new ArgumentNullException("serviceProvider");
            }

            this.storageSerivce  = new StorageService();
            this.configDomain    = new ConfigurationDesignManagerDomain(serviceProvider);
            this.serviceProvider = serviceProvider;
            nodesByType          = new Dictionary <Guid, NodeTypeEntryArrayList>();
            nodesById            = new Dictionary <Guid, ConfigurationNode>();
            nodesByName          = new Dictionary <Guid, Dictionary <string, ConfigurationNode> >();
            handlerList          = new EventHandlerList();
            this.rootNode        = rootNode;
            this.storageSerivce.ConfigurationFile = this.rootNode.ConfigurationFile;
            this.rootNode.Renamed += new EventHandler <ConfigurationNodeChangedEventArgs>(OnConfigurationFileChanged);
            selectedNode           = rootNode;
            AddNode(rootNode);
            if (null != rootNode.FirstNode)
            {
                rootNode.UpdateHierarchy(rootNode.FirstNode);
            }
        }
예제 #2
0
 public UIHierarchy(IServiceProvider serviceProvider, ConfigurationContext configurationContext)
 {
     if (serviceProvider == null)
     {
         throw new ArgumentNullException("serviceProvider");
     }
     this.serviceProvider      = serviceProvider;
     this.configurationContext = configurationContext;
     this.configDomain         = new ConfigurationDesignManagerDomain(serviceProvider);
     nodesByType  = new Hashtable(CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default);
     nodesById    = new Hashtable(CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default);
     nodesByName  = new Hashtable(CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default);
     storageTable = new StorageTable();
     handlerList  = new EventHandlerList();
 }
예제 #3
0
 public UIHierarchy(IServiceProvider serviceProvider, ConfigurationContext configurationContext)
 {
     if (serviceProvider == null)
     {
         throw new ArgumentNullException("serviceProvider");
     }
     this.serviceProvider = serviceProvider;
     this.configurationContext = configurationContext;
     this.configDomain = new ConfigurationDesignManagerDomain(serviceProvider);
     nodesByType = new Hashtable(CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default);
     nodesById = new Hashtable(CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default);
     nodesByName = new Hashtable(CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default);
     storageTable = new StorageTable();
     handlerList = new EventHandlerList();
 }
예제 #4
0
        /// <summary>
        /// Initialize a new instance of the <see cref="ConfigurationUIHierarchy"/> class.
        /// </summary>
        /// <param name="rootNode">The root node of the hierarchy.</param>
        /// <param name="serviceProvider">The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param>
        public ConfigurationUIHierarchy(ConfigurationApplicationNode rootNode, IServiceProvider serviceProvider)
        {
            if (rootNode == null) throw new ArgumentNullException("rootNode");
            if (serviceProvider == null) throw new ArgumentNullException("serviceProvider");

            this.storageSerivce = new StorageService();
            this.configDomain = new ConfigurationDesignManagerDomain(serviceProvider);
            this.serviceProvider = serviceProvider;
            nodesByType = new Dictionary<Guid,NodeTypeEntryArrayList>();
            nodesById = new Dictionary<Guid, ConfigurationNode>();
            nodesByName = new Dictionary<Guid, Dictionary<string, ConfigurationNode>>();
            handlerList = new EventHandlerList();
            this.rootNode = rootNode;
            this.storageSerivce.ConfigurationFile = this.rootNode.ConfigurationFile;
            this.rootNode.Renamed += new EventHandler<ConfigurationNodeChangedEventArgs>(OnConfigurationFileChanged);
            selectedNode = rootNode;
            AddNode(rootNode);
            if (null != rootNode.FirstNode) rootNode.UpdateHierarchy(rootNode.FirstNode);
        }