/// <summary> /// <para>Saves the configuration settings created for the application.</para> /// </summary> /// <param name="serviceProvider"> /// <para>The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</para> /// </param> public void Save(IServiceProvider serviceProvider) { ConfigurationContext configurationContext = ServiceHelper.GetCurrentConfigurationContext(serviceProvider); if (configurationContext.IsValidSection(CryptographySettings.SectionName)) { CryptographySettingsNode securitySettingsNode = null; try { IUIHierarchy hierarchy = ServiceHelper.GetCurrentHierarchy(serviceProvider); securitySettingsNode = hierarchy.FindNodeByType(typeof(CryptographySettingsNode)) as CryptographySettingsNode; if (securitySettingsNode == null) { return; } CryptographySettings securitySettings = securitySettingsNode.CryptographySettings; configurationContext.WriteConfiguration(CryptographySettings.SectionName, securitySettings); } catch (ConfigurationException e) { ServiceHelper.LogError(serviceProvider, securitySettingsNode, e); } catch (InvalidOperationException e) { ServiceHelper.LogError(serviceProvider, securitySettingsNode, e); } } }
/// <summary> /// <para>Saves the configuration settings created for the application.</para> /// </summary> /// <param name="serviceProvider"> /// <para>The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</para> /// </param> public override void Save(IServiceProvider serviceProvider) { ConfigurationContext configurationContext = ServiceHelper.GetCurrentConfigurationContext(serviceProvider); if (configurationContext.IsValidSection(LoggingSettings.SectionName)) { ClientSettingsNode clientSettingsNode = null; try { IUIHierarchy hierarchy = ServiceHelper.GetCurrentHierarchy(serviceProvider); clientSettingsNode = hierarchy.FindNodeByType(typeof(ClientSettingsNode)) as ClientSettingsNode; if (clientSettingsNode == null) { return; } LoggingSettings loggingSettings = clientSettingsNode.LoggingSettings; configurationContext.WriteConfiguration(LoggingSettings.SectionName, loggingSettings); } catch (ConfigurationException e) { ServiceHelper.LogError(serviceProvider, clientSettingsNode, e); } catch (InvalidOperationException e) { ServiceHelper.LogError(serviceProvider, clientSettingsNode, e); } } }
/// <summary> /// <para>Saves the configuration settings created for the application.</para> /// </summary> /// <param name="serviceProvider"> /// <para>The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</para> /// </param> public void Save(IServiceProvider serviceProvider) { ConfigurationContext configurationContext = ServiceHelper.GetCurrentConfigurationContext(serviceProvider); if (configurationContext.IsValidSection(ExceptionHandlingSettings.SectionName)) { ExceptionHandlingSettingsNode exceptionHandlingSettingsNode = null; try { IUIHierarchy hierarchy = ServiceHelper.GetCurrentHierarchy(serviceProvider); exceptionHandlingSettingsNode = hierarchy.FindNodeByType(typeof(ExceptionHandlingSettingsNode)) as ExceptionHandlingSettingsNode; if (exceptionHandlingSettingsNode == null) { return; } ExceptionHandlingSettings exceptionHandlingSettings = exceptionHandlingSettingsNode.ExceptionHandlingSettings; configurationContext.WriteConfiguration(ExceptionHandlingSettings.SectionName, exceptionHandlingSettings); } catch (ConfigurationException e) { ServiceHelper.LogError(serviceProvider, exceptionHandlingSettingsNode, e); } catch (InvalidOperationException e) { ServiceHelper.LogError(serviceProvider, exceptionHandlingSettingsNode, e); } } }
public void RenamingOneDistributionStrategyLeavesOnlyOneStrategy() { string name = "Test Custom Strategy 1"; GeneratedHierarchy.Open(); LoggingSettingsNode node = new LoggingSettingsNode(); GeneratedApplicationNode.Nodes.AddWithDefaultChildren(node); DistributionStrategyCollectionNode distributionStrategyCollectionNode = GeneratedHierarchy.FindNodeByType(typeof(DistributionStrategyCollectionNode)) as DistributionStrategyCollectionNode; Assert.IsNotNull(distributionStrategyCollectionNode); distributionStrategyCollectionNode.Nodes.Clear(); CustomDistributionStrategyNode customNode = new CustomDistributionStrategyNode(); distributionStrategyCollectionNode.Nodes.AddWithDefaultChildren(customNode); customNode.TypeName = typeof(InProcDistributionStrategyData).AssemblyQualifiedName; customNode.Name = name; GeneratedHierarchy.Save(); ApplicationConfigurationNode appNode = new ApplicationConfigurationNode(ApplicationData.FromCurrentAppDomain()); IUIHierarchy hierarchy = CreateHierarchyAndAddToHierarchyService(appNode, CreateDefaultConfiguration()); HierarchyService.SelectedHierarchy = hierarchy; hierarchy.Open(); LoggingSettingsNode settingsNode = hierarchy.FindNodeByType(typeof(LoggingSettingsNode)) as LoggingSettingsNode; Assert.IsNotNull(settingsNode); distributionStrategyCollectionNode = hierarchy.FindNodeByType(appNode, typeof(DistributionStrategyCollectionNode)) as DistributionStrategyCollectionNode; Assert.IsNotNull(distributionStrategyCollectionNode); ConfigurationNode [] nodes = hierarchy.FindNodesByType(distributionStrategyCollectionNode, typeof(CustomDistributionStrategyNode)); Assert.AreEqual(1, nodes.Length); Assert.AreEqual(name, nodes[0].Name); }
/// <summary> /// <para>Saves the configuration settings created for the application.</para> /// </summary> /// <param name="serviceProvider"> /// <para>The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</para> /// </param> public override void Save(IServiceProvider serviceProvider) { ConfigurationContext configurationContext = ServiceHelper.GetCurrentConfigurationContext(serviceProvider); if (configurationContext.IsValidSection(DistributorSettings.SectionName)) { DistributorSettingsNode distributorSettingsNode = null; try { IUIHierarchy hierarchy = ServiceHelper.GetCurrentHierarchy(serviceProvider); distributorSettingsNode = hierarchy.FindNodeByType(typeof(DistributorSettingsNode)) as DistributorSettingsNode; if (distributorSettingsNode == null) { return; } DistributorSettings distributorSettings = distributorSettingsNode.DistributorSettings; configurationContext.WriteConfiguration(DistributorSettings.SectionName, distributorSettings); } catch (ConfigurationException e) { ServiceHelper.LogError(serviceProvider, distributorSettingsNode, e); } catch (InvalidOperationException e) { ServiceHelper.LogError(serviceProvider, distributorSettingsNode, e); } } }
public void OpenAndSaveTest() { GeneratedHierarchy.Load(); Assert.AreEqual(0, ConfigurationErrorLogService.ConfigurationErrors.Count); GeneratedHierarchy.Open(); Assert.AreEqual(0, ConfigurationErrorLogService.ConfigurationErrors.Count); CacheManagerSettingsNode rootNode = (CacheManagerSettingsNode)GeneratedHierarchy.FindNodeByType(typeof(CacheManagerSettingsNode)); Assert.IsNotNull(rootNode); Assert.AreEqual("InMemoryPersistence", rootNode.DefaultCacheManager.Name); rootNode.DefaultCacheManager.Name = "BadData"; GeneratedHierarchy.Save(); Assert.AreEqual(0, ConfigurationErrorLogService.ConfigurationErrors.Count); ApplicationData data = ApplicationData.FromCurrentAppDomain(); ApplicationConfigurationNode applicationNode = new ApplicationConfigurationNode(data); IUIHierarchy newHierarchy = CreateHierarchyAndAddToHierarchyService(applicationNode, CreateDefaultConfiguration()); HierarchyService.SelectedHierarchy = newHierarchy; newHierarchy.Open(); Assert.AreEqual(0, ConfigurationErrorLogService.ConfigurationErrors.Count); rootNode = (CacheManagerSettingsNode)newHierarchy.FindNodeByType(typeof(CacheManagerSettingsNode)); Assert.AreEqual("BadData", rootNode.DefaultCacheManager.Name); rootNode.DefaultCacheManager.Name = "InMemoryPersistence"; newHierarchy.Save(); }
public void TearDown() { addEventCalled = false; addEventCount = 0; removedEventCalled = false; removedEventCount = 0; eventHierarchy = null; }
public override void SetUp() { base.SetUp(); DatabaseSettingsNode databaseSettingsNode = new DatabaseSettingsNode(DatabaseSettingsBuilder.Create(Host)); IUIHierarchy hierarchy = CreateHierarchyAndAddToHierarchyService(databaseSettingsNode, CreateDefaultConfiguration()); packageNode = (OraclePackageNode)hierarchy.FindNodeByType(typeof(OraclePackageNode)); }
/// <devdoc> /// Adds a hierarchy to the container. /// </devdoc> public void AddHierarchy(IUIHierarchy hierarchy) { hierarchies.Add(hierarchy.Id, hierarchy); if (selectedHierarchy == null) { selectedHierarchy = hierarchy; } OnHierarchyAdded(new HierarchyAddedEventArgs(hierarchy)); }
public override void SetUp() { base.SetUp(); DatabaseSettings databaseSettings = DatabaseSettingsBuilder.Create(Host); DatabaseSettingsNode databaseSettingsNode = new DatabaseSettingsNode(databaseSettings); IUIHierarchy hierarchy = CreateHierarchyAndAddToHierarchyService(databaseSettingsNode, CreateDefaultConfiguration()); connectionStringCollectionNode = (ConnectionStringCollectionNode)hierarchy.FindNodeByType(typeof(ConnectionStringCollectionNode)); }
public override void SetUp() { base.SetUp(); ApplicationConfigurationNode appNode = new ApplicationConfigurationNode(ApplicationData.FromCurrentAppDomain()); loggingHierarchy = CreateHierarchyAndAddToHierarchyService(appNode, CreateDefaultConfiguration()); HierarchyService.SelectedHierarchy = loggingHierarchy; loggingHierarchy.Open(); HierarchyService.SelectedHierarchy = GeneratedHierarchy; }
public override void SetUp() { base.SetUp(); DatabaseSettings databaseSettings = DatabaseSettingsBuilder.Create(Host); DatabaseSettingsNode databaseSettingsNode = new DatabaseSettingsNode(databaseSettings); IUIHierarchy hierarchy = CreateHierarchyAndAddToHierarchyService(databaseSettingsNode, CreateDefaultConfiguration()); databaseSettingsNode.ResolveNodeReferences(); instancesNode = (InstanceCollectionNode)hierarchy.FindNodeByType(typeof(InstanceCollectionNode)); }
/// <devdoc> /// Saves all the hierarchies by calling save on all IUIHierarchy. /// </devdoc> public void SaveAll() { foreach (DictionaryEntry entry in hierarchies) { IUIHierarchy hierarchy = entry.Value as IUIHierarchy; if (hierarchy != null) { hierarchy.Save(); } } }
/// <devdoc> /// Removes a hierarchy from the container. /// </devdoc> public void RemoveHierarchy(Guid id) { IUIHierarchy hierarchy = hierarchies[id] as IUIHierarchy; if (hierarchy == null) { return; } hierarchies.Remove(id); OnHierarchyRemoved(new HierarchyRemovedEventArgs(hierarchy)); }
private static void CreateCommands(IServiceProvider serviceProvider) { IUIHierarchy currentHierarchy = ServiceHelper.GetCurrentHierarchy(serviceProvider); ConfigurationNode rootNode = ServiceHelper.GetCurrentRootNode(serviceProvider); bool containsNode = currentHierarchy.ContainsNodeType(rootNode, typeof(ConfigurationSectionCollectionNode)); IMenuContainerService menuService = ServiceHelper.GetMenuContainerService(serviceProvider); ConfigurationMenuItem item = new ConfigurationMenuItem(SR.ConfigurationSectionCollectionMenuItemText, new AddChildNodeCommand(serviceProvider, typeof(ConfigurationSectionCollectionNode)), rootNode, Shortcut.None, SR.ConfigurationSectionCollectionStatusText, InsertionPoint.New); item.Enabled = !containsNode; menuService.MenuItems.Add(item); }
private ConfigurationContext GetContext() { IUIHierarchy hierarchy = ServiceHelper.GetCurrentHierarchy(provider); ConfigurationContext context = hierarchy.BuildConfigurationContext(); ConfigurationSettings settings = context.GetMetaConfiguration(); ConfigurationDictionary config = new ConfigurationDictionary(); config.Add(ConfigurationSettings.SectionName, settings); context = new ConfigurationContext(config); return(context); }
private static void CreateCommands(IServiceProvider serviceProvider) { IUIHierarchyService hierarchyService = ServiceHelper.GetUIHierarchyService(serviceProvider); IUIHierarchy currentHierarchy = hierarchyService.SelectedHierarchy; bool containsNode = currentHierarchy.ContainsNodeType(typeof(CacheManagerSettingsNode)); IMenuContainerService menuService = ServiceHelper.GetMenuContainerService(serviceProvider); ConfigurationMenuItem item = new ConfigurationMenuItem(SR.CacheSettingsMenuText, new AddConfigurationSectionCommand(serviceProvider, typeof(CacheManagerSettingsNode), CacheManagerSettings.SectionName), ServiceHelper.GetCurrentRootNode(serviceProvider), Shortcut.None, SR.CacheSettingsStatusText, InsertionPoint.New); item.Enabled = !containsNode; menuService.MenuItems.Add(item); }
public void CreateFromRuntimeTest() { DatabaseSettings databaseSettings = DatabaseSettingsBuilder.Create(Host); DatabaseSettingsNode databaseSettingsNode = new DatabaseSettingsNode(databaseSettings); IUIHierarchy hierarchy = CreateHierarchyAndAddToHierarchyService(databaseSettingsNode, CreateDefaultConfiguration()); ConnectionStringCollectionNode node = (ConnectionStringCollectionNode)hierarchy.FindNodeByType(typeof(ConnectionStringCollectionNode)); ValidateNodeCommand cmd = new ValidateNodeCommand(Host); cmd.Execute(node); Assert.AreEqual(0, ValidationErrorsCount); }
private static SecuritySettingsNode GetSecuritySettingsNode(IServiceProvider serviceProvider) { IUIHierarchy hierarchy = ServiceHelper.GetCurrentHierarchy(serviceProvider); if (hierarchy == null) { return(null); } return(hierarchy.FindNodeByType(typeof(SecuritySettingsNode)) as SecuritySettingsNode); }
private static ExceptionHandlingSettingsNode GetExceptionHandlingSettingsNode(IServiceProvider serviceProvider) { IUIHierarchy hierarchy = ServiceHelper.GetCurrentHierarchy(serviceProvider); if (hierarchy == null) { return(null); } return(hierarchy.FindNodeByType(typeof(ExceptionHandlingSettingsNode)) as ExceptionHandlingSettingsNode); }
private static CacheManagerSettingsNode GetCacheManagerSettingsNode(IServiceProvider serviceProvider) { IUIHierarchy hierarchy = ServiceHelper.GetCurrentHierarchy(serviceProvider); if (hierarchy == null) { return(null); } return(hierarchy.FindNodeByType(typeof(CacheManagerSettingsNode)) as CacheManagerSettingsNode); }
private static DistributorSettingsNode GetDistributorSettingsNode(IServiceProvider serviceProvider) { IUIHierarchy hierarchy = ServiceHelper.GetCurrentHierarchy(serviceProvider); if (hierarchy == null) { return(null); } return(hierarchy.FindNodeByType(typeof(DistributorSettingsNode)) as DistributorSettingsNode); }
public void FindTypeNodeInHierarchy() { ApplicationData applicationData = ApplicationData.FromCurrentAppDomain(); ApplicationConfigurationNode applicationNode = new ApplicationConfigurationNode(applicationData); IUIHierarchy hierarchy = CreateHierarchyAndAddToHierarchyService(applicationNode, new ConfigurationContext(applicationNode.ConfigurationFile)); MyConfigNode configNode = new MyConfigNode("MyBlock"); applicationNode.Nodes.Add(configNode); ConfigurationNode node = hierarchy.FindNodeByType(typeof(MyConfigNode)); Assert.IsNotNull(node); Assert.AreSame(configNode, node); }
public virtual void SetUp() { host = new ConfigurationDesignHost(); hierarchyService = (IUIHierarchyService)host.GetService(typeof(IUIHierarchyService)); configurationErrorLogService = (IConfigurationErrorLogService)host.GetService(typeof(IConfigurationErrorLogService)); xmlIncludeTypeService = (IXmlIncludeTypeService)host.GetService(typeof(IXmlIncludeTypeService)); nodeCreationService = (INodeCreationService)host.GetService(typeof(INodeCreationService)); container = (IContainer)host.GetService(typeof(IContainer)); linkNodeService = (ILinkNodeService)host.GetService(typeof(ILinkNodeService)); host.AddService(typeof(IUIService), new MyUIService(this)); validationErrorsCount = 0; configurationErrorsCount = 0; applicationNode = new ApplicationConfigurationNode(ApplicationData.FromCurrentAppDomain()); uiHierarchy = CreateHierarchyAndAddToHierarchyService(applicationNode, CreateDefaultConfiguration()); }
public void NewDatabaseTypeNodeTest() { IUIHierarchy hierarchy = HierarchyService.SelectedHierarchy; InstanceCollectionNode collectionNode = hierarchy.FindNodeByType(typeof(InstanceCollectionNode)) as InstanceCollectionNode; InstanceNode localInstanceNode = hierarchy.FindNodeByName(collectionNode, name) as InstanceNode; DatabaseTypeCollectionNode databaseTypeCollectionNode = hierarchy.FindNodeByType(typeof(DatabaseTypeCollectionNode)) as DatabaseTypeCollectionNode; DatabaseTypeNode databaseTypeNode = hierarchy.FindNodeByName(databaseTypeCollectionNode, "SqlServer") as DatabaseTypeNode; localInstanceNode.DatabaseTypeNode = databaseTypeNode; Assert.AreEqual(databaseTypeNode.Name, localInstanceNode.DatabaseTypeName); databaseTypeNode.Name = "newName"; Assert.AreEqual(databaseTypeNode.Name, localInstanceNode.DatabaseTypeName); databaseTypeNode.Remove(); Assert.IsNull(localInstanceNode.DatabaseTypeNode); }
private static void CreateCommands(IServiceProvider provider) { IUIHierarchyService hierarchyService = provider.GetService(typeof(IUIHierarchyService)) as IUIHierarchyService; Debug.Assert(hierarchyService != null, "Could not get the IUIHierarchyService"); IUIHierarchy currentHierarchy = hierarchyService.SelectedHierarchy; bool containsNode = currentHierarchy.ContainsNodeType(typeof(ExceptionHandlingSettingsNode)); IMenuContainerService menuService = provider.GetService(typeof(IMenuContainerService)) as IMenuContainerService; Debug.Assert(menuService != null, "Could not get the IMenuContainerService"); ConfigurationMenuItem item = new ConfigurationMenuItem(SR.ExceptionHandlingSettingsNodeMenuText, new AddConfigurationSectionCommand(provider, typeof(ExceptionHandlingSettingsNode), ExceptionHandlingSettings.SectionName), ServiceHelper.GetCurrentRootNode(provider), Shortcut.None, SR.ExceptionHandlingSettingsNodeStatusText, InsertionPoint.New); item.Enabled = !containsNode; menuService.MenuItems.Add(item); }
/// <summary> /// <para>Creates a new <see cref="ApplicationConfigurationNode"/> object and adds it to the solution.</para> /// </summary> /// <param name="node"> /// <para>The <see cref="ApplicationConfigurationNode"/> is the root of an <see cref="IUIHierarchy"/> so the <paramref name="node"/> is not used, so passing <see langword="null"/> is expected.</para> /// </param> protected override void ExecuteCore(ConfigurationNode node) { try { UIService.BeginUpdate(); ApplicationConfigurationNode appNode = new ApplicationConfigurationNode(applicationData); IUIHierarchy hierarchy = ConfigurationUIHierarchyFactory.Create(appNode, ServiceProvider); UIHierarchyService.AddHierarchy(hierarchy); UIService.SetUIDirty(hierarchy); } finally { UIService.EndUpdate(); } }
protected LoggingSettingsNode GetLoggingSettingsNode(IServiceProvider serviceProvider) { IUIHierarchyService hierarchyService = serviceProvider.GetService(typeof(IUIHierarchyService)) as IUIHierarchyService; Debug.Assert(hierarchyService != null, "Could not get the IUIHierarchyService"); IUIHierarchy currentHierarchy = hierarchyService.SelectedHierarchy; LoggingSettingsNode node = (LoggingSettingsNode)currentHierarchy.FindNodeByType(typeof(LoggingSettingsNode)); if (node == null) { node = new LoggingSettingsNode(); currentHierarchy.RootNode.Nodes.Add(node); } return(node); }
private ConfigurationSectionCollectionNode SelectConfigurationSectionsNode() { IUIHierarchy hierarchy = UIHierarchyService.SelectedHierarchy; ApplicationConfigurationNode applicationNode = hierarchy.RootNode as ApplicationConfigurationNode; Debug.Assert(applicationNode != null, "Expected an application node to be root for this node."); ConfigurationSectionCollectionNode sectionsNode = (ConfigurationSectionCollectionNode)hierarchy.FindNodeByType(hierarchy.RootNode, typeof(ConfigurationSectionCollectionNode)); if (sectionsNode == null) { sectionsNode = new ConfigurationSectionCollectionNode(); applicationNode.Nodes.AddWithDefaultChildren(sectionsNode); } return(sectionsNode); }
public void NewConnectionStringNodeTest() { IUIHierarchy hierarchy = HierarchyService.SelectedHierarchy; InstanceCollectionNode collectionNode = hierarchy.FindNodeByType(typeof(InstanceCollectionNode)) as InstanceCollectionNode; InstanceNode node = hierarchy.FindNodeByName(collectionNode, name) as InstanceNode; ConnectionStringCollectionNode connectionStringCollectionNode = hierarchy.FindNodeByType(typeof(ConnectionStringCollectionNode)) as ConnectionStringCollectionNode; ConnectionStringNode connectionStringNode = hierarchy.FindNodeByName(connectionStringCollectionNode, "Northwind") as ConnectionStringNode; Assert.IsNotNull(connectionStringNode); node.ConnectionStringNode = connectionStringNode; Assert.AreEqual(connectionStringNode.Name, node.ConnectionString); connectionStringNode.Name = "newName"; Assert.AreEqual(connectionStringNode.Name, node.ConnectionString); connectionStringNode.Remove(); Assert.IsNull(node.ConnectionStringNode); }
public void SetUIDirty(IUIHierarchy hierarchy) { hierarchyDirtyMap[hierarchy.Id] = true; this.Text = String.Concat(defaultText, "*"); }
/// <devdoc> /// Removes a hierarchy from the container. /// </devdoc> public void RemoveHierarchy(IUIHierarchy hierarchy) { RemoveHierarchy(hierarchy.Id); }
public virtual void SetUIDirty(IUIHierarchy hierarchy) { Trace.WriteLine("Dirty called for " + hierarchy.Id.ToString()); }
public void TearDown() { addEventCalled = false; addEventCount = 0; removedEventCalled = false; removedEventCount = 0; eventHierarchy = null; }
public bool IsDirty(IUIHierarchy hierarchy) { if (hierarchyDirtyMap.Contains(hierarchy.Id)) { return (bool)hierarchyDirtyMap[hierarchy.Id]; } return false; }
public virtual bool IsDirty(IUIHierarchy hierarchy) { Trace.WriteLine("IsDirty called for " + hierarchy.Id.ToString()); return false; }
public virtual void SetUp() { host = new ConfigurationDesignHost(); hierarchyService = (IUIHierarchyService)host.GetService(typeof(IUIHierarchyService)); configurationErrorLogService = (IConfigurationErrorLogService)host.GetService(typeof(IConfigurationErrorLogService)); xmlIncludeTypeService = (IXmlIncludeTypeService)host.GetService(typeof(IXmlIncludeTypeService)); nodeCreationService = (INodeCreationService)host.GetService(typeof(INodeCreationService)); container = (IContainer)host.GetService(typeof(IContainer)); linkNodeService = (ILinkNodeService)host.GetService(typeof(ILinkNodeService)); host.AddService(typeof(IUIService), new MyUIService(this)); validationErrorsCount = 0; configurationErrorsCount = 0; applicationNode = new ApplicationConfigurationNode(ApplicationData.FromCurrentAppDomain()); uiHierarchy = CreateHierarchyAndAddToHierarchyService(applicationNode, CreateDefaultConfiguration()); }
/// <devdoc> /// Adds a hierarchy to the container. /// </devdoc> public void AddHierarchy(IUIHierarchy hierarchy) { hierarchies.Add(hierarchy.Id, hierarchy); if (selectedHierarchy == null) { selectedHierarchy = hierarchy; } OnHierarchyAdded(new HierarchyAddedEventArgs(hierarchy)); }
/// <summary> /// <para>Initialize a new instance of the <see cref="HierarchyAddedEventArgs"/> class with a <see cref="IUIHierarchy"/> object.</para> /// </summary> /// <param name="uiHierarchy"> /// <para>An <see cref="IUIHierarchy"/> object.</para> /// </param> public HierarchyAddedEventArgs(IUIHierarchy uiHierarchy) { this.uiHierarchy = uiHierarchy; }
/// <summary> /// <para>Initialize a new instance of the <see cref="HierarchyAddedEventArgs"/> class with a <see cref="IUIHierarchy"/> object.</para> /// </summary> /// <param name="uiHierarchy"> /// <para>An <see cref="IUIHierarchy"/> object.</para> /// </param> public HierarchyRemovedEventArgs(IUIHierarchy uiHierarchy) { this.uiHierarchy = uiHierarchy; }
private void OnHierarchyRemoved(object sender, HierarchyRemovedEventArgs args) { removedEventCalled = true; removedEventCount++; eventHierarchy = args.UIHierarchy; }
private void OnHierarchyAdded(object sender, HierarchyAddedEventArgs args) { addEventCalled = true; addEventCount++; eventHierarchy = args.UIHierarchy; }
private bool SaveApplication(IUIHierarchy hierarchy) { using (new WaitCursor()) { SaveApplicationConfigurationNodeCommand cmd = new SaveApplicationConfigurationNodeCommand(designHost); cmd.Execute(hierarchy.RootNode); return cmd.SaveSucceeded; } }
public override void SetUp() { base.SetUp (); ApplicationConfigurationNode appNode = new ApplicationConfigurationNode(ApplicationData.FromCurrentAppDomain()); loggingHierarchy = CreateHierarchyAndAddToHierarchyService(appNode, CreateDefaultConfiguration()); HierarchyService.SelectedHierarchy = loggingHierarchy; loggingHierarchy.Open(); HierarchyService.SelectedHierarchy = GeneratedHierarchy; }
private void UpdateSaveStatus(IUIHierarchy hierarchy) { hierarchyDirtyMap[hierarchy.Id] = false; foreach (DictionaryEntry entry in hierarchyDirtyMap) { if (true == (bool)entry.Value) { break; } } this.Text = defaultText; }