public WebServiceSettingsBuilder(IServiceProvider serviceProvider, WebServiceSettingsNode webServiceSettingsNode) { this.webServiceSettingsNode = webServiceSettingsNode; hierarchy = ServiceHelper.GetCurrentHierarchy(serviceProvider); webServiceSettings = new WebServiceSettings(); }
/// <summary> /// Serailize an object to a strings. /// </summary> /// <param name="objectToSerialize">The object to serialize.</param> /// <param name="hierarchy">An <see cref="IConfigurationUIHierarchy"/> object.</param> /// <returns>The serailized object to string.</returns> public static string SerializeToString(object objectToSerialize, IConfigurationUIHierarchy hierarchy) { if (objectToSerialize == null) { return(null); } if (objectToSerialize is IEnvironmentalOverridesSerializable) { IEnvironmentalOverridesSerializable serializableInstance = objectToSerialize as IEnvironmentalOverridesSerializable; return(serializableInstance.SerializeToString()); } else if (objectToSerialize is ConfigurationNode) { ConfigurationNode node = objectToSerialize as ConfigurationNode; return(CreatePathRelativeToRootNode(node.Path, hierarchy)); } else { Type targetType = objectToSerialize.GetType(); TypeConverter converter = TypeDescriptor.GetConverter(targetType); if (converter != null) { return(converter.ConvertToInvariantString(objectToSerialize)); } } return(null); }
public MergedConfigurationProperty(ConfigurationNodeMergeData mergedConfigurationData, PropertyDescriptor innerProperyDescriptor, object actualInstance, IConfigurationUIHierarchy configurationHierarchy) : base(innerProperyDescriptor) { this.actualInstance = actualInstance; this.mergedConfigurationData = mergedConfigurationData; this.innerProperyDescriptor = innerProperyDescriptor; this.configurationHierarchy = configurationHierarchy; }
public void TestInitialize() { appNode = new ConfigurationApplicationNode(ConfigurationApplicationFile.FromCurrentAppDomain()); serviceProvider = ServiceBuilder.Build(); hierarchy = new ConfigurationUIHierarchy(appNode, serviceProvider); appNode.AddNode(new MyTestNode()); removeEventCount = 0; }
public void TestInitialize() { appNode = new ConfigurationApplicationNode(ConfigurationApplicationFile.FromCurrentAppDomain()); serviceProvider = ServiceBuilder.Build(); hierarchy = new ConfigurationUIHierarchy(appNode, serviceProvider); appNode.AddNode(new MyTestNode()); removeEventCount = 0; }
protected override void InitializeCore() { regexNode = new MyRegexTestNode(); ApplicationNode.AddNode(regexNode); emailInfo = regexNode.GetType().GetProperty("Email"); serviceProvider = ServiceBuilder.Build(); hierarchy = new ConfigurationUIHierarchy(ApplicationNode, serviceProvider); }
public virtual void SetUIDirty(IConfigurationUIHierarchy hierarchy) { if (!dirtyHierarchies.ContainsKey(hierarchy.Id)) { dirtyHierarchies.Add(hierarchy.Id, hierarchy); } Console.WriteLine("Dirty called for " + hierarchy.Id.ToString()); }
protected override void InitializeCore() { regexNode = new MyRegexTestNode(); ApplicationNode.AddNode(regexNode); emailInfo = regexNode.GetType().GetProperty("Email"); serviceProvider = ServiceBuilder.Build(); hierarchy = new ConfigurationUIHierarchy(ApplicationNode, serviceProvider); }
public void TestInitialize() { ConfigurationApplicationNode node = new ConfigurationApplicationNode(ConfigurationApplicationFile.FromCurrentAppDomain()); serviceProvider = ServiceBuilder.Build(); hierarchy = new ConfigurationUIHierarchy(node, serviceProvider); ServiceContainer container = (ServiceContainer)serviceProvider; container.RemoveService(typeof(IUIService)); container.AddService(typeof(IUIService), new TestUIService(serviceProvider, this)); }
protected override void InitializeCore() { requiredNode = new MyRequiredTestNode(); ApplicationNode.AddNode(requiredNode); valueInfo1 = requiredNode.GetType().GetProperty("Value1"); valueInfo2 = requiredNode.GetType().GetProperty("Value2"); serviceProvider = ServiceBuilder.Build(); hierarchy = new ConfigurationUIHierarchy(ApplicationNode, serviceProvider); }
protected override void InitializeCore() { ConfigurationApplicationNode appNode = new ConfigurationApplicationNode(); typeNode = new MyTypeTestNode(); valueInfo1 = typeNode.GetType().GetProperty("TypeName"); serviceProvider = ServiceBuilder.Build(); appNode.AddNode(typeNode); hierarchy = new ConfigurationUIHierarchy(appNode, serviceProvider); }
/// <summary> /// Removes a hierarchy from the container. /// </summary> /// <param name="hierarchy"> /// The hierarchy to remove. /// </param> public void RemoveHierarchy(IConfigurationUIHierarchy hierarchy) { if (null == hierarchy) { throw new ArgumentNullException("hierarchy"); } RemoveHierarchy(hierarchy.Id); }
/// <summary> /// /// </summary> /// <param name="hierarchy"></param> /// <returns></returns> public bool IsDirty(IConfigurationUIHierarchy hierarchy) { if (dirtyHierarchies.ContainsKey(hierarchy)) { return(dirtyHierarchies[hierarchy]); } return(false); }
private void RemoveConfigurationSourceElements(IConfigurationUIHierarchy configurationUIHierarchy) { ConfigurationSourceSectionNode configurationSourcesNode = configurationUIHierarchy.FindNodeByType(typeof(ConfigurationSourceSectionNode)) as ConfigurationSourceSectionNode; if (configurationSourcesNode != null) { configurationSourcesNode.Remove(); } }
protected override void InitializeCore() { requiredNode = new MyRequiredTestNode(); ApplicationNode.AddNode(requiredNode); valueInfo1 = requiredNode.GetType().GetProperty("Value1"); valueInfo2 = requiredNode.GetType().GetProperty("Value2"); serviceProvider = ServiceBuilder.Build(); hierarchy = new ConfigurationUIHierarchy(ApplicationNode, serviceProvider); }
public override void Save(IServiceProvider serviceProvider) { IErrorLogService errorService = ServiceHelper.GetErrorService(serviceProvider); IEnvironmentMergeService environmentMergeService = serviceProvider.GetService(typeof(IEnvironmentMergeService)) as IEnvironmentMergeService; if (environmentMergeService != null) { if (environmentMergeService.EnvironmentMergeInProgress) { return; } } IConfigurationUIHierarchy hierarchy = ServiceHelper.GetCurrentHierarchy(serviceProvider); Debug.Assert(hierarchy != null); ConfigurationApplicationNode configurationRootNode = hierarchy.FindNodeByType(typeof(ConfigurationApplicationNode)) as ConfigurationApplicationNode; Debug.Assert(configurationRootNode != null); string configurationFileDirectory = Path.GetDirectoryName(configurationRootNode.ConfigurationFile); foreach (EnvironmentNode environmentNode in hierarchy.FindNodesByType(typeof(EnvironmentNode))) { string environmentDeltaFilePath = Path.Combine(configurationFileDirectory, environmentNode.EnvironmentDeltaFile); Dictionary <string, ConfigurationNodeMergeData> mergeDataByPath = environmentNode.EnvironmentMergeData.UnfoldMergeData(hierarchy, false); EnvironmentMergeSection environmentMergeSection = new EnvironmentMergeSection(); environmentMergeSection.EnvironmentName = environmentNode.Name; environmentMergeSection.EnvironmentDeltaFile = environmentNode.EnvironmentConfigurationFile; CopyEnvironmentOverrides(environmentMergeSection, mergeDataByPath, hierarchy); string protectionProvider = GetProtectionProviderName(environmentNode); try { FileConfigurationSource fileConfigurationSource = new FileConfigurationSource(environmentDeltaFilePath, false); if (!string.IsNullOrEmpty(protectionProvider)) { fileConfigurationSource.Save(EnvironmentMergeSection.EnvironmentMergeData, environmentMergeSection, protectionProvider); } else { fileConfigurationSource.Add(EnvironmentMergeSection.EnvironmentMergeData, environmentMergeSection); } } catch (ConfigurationErrorsException configurationErrors) { errorService.LogErrors(configurationErrors); } } }
protected override void InitializeCore() { ConfigurationApplicationNode appNode = new ConfigurationApplicationNode(); minLengthNode = new MyMinLengthTestNode(); appNode.AddNode(minLengthNode); valueInfo1 = minLengthNode.GetType().GetProperty("Value1"); valueInfo2 = minLengthNode.GetType().GetProperty("Value2"); serviceProvider = ServiceBuilder.Build(); hierarchy = new ConfigurationUIHierarchy(appNode, serviceProvider); }
private static void UpdateConfigurationSource(IConfigurationUIHierarchy configurationUIHierarchy, string filename) { configurationUIHierarchy.ConfigurationSource = new FileConfigurationSource(filename, false); configurationUIHierarchy.StorageService.ConfigurationFile = filename; if (configurationUIHierarchy.RootNode != null) { configurationUIHierarchy.RootNode.ConfigurationFile = filename; } }
protected override void InitializeCore() { ConfigurationApplicationNode appNode = new ConfigurationApplicationNode(); typeNode = new MyTypeTestNode(); valueInfo1 = typeNode.GetType().GetProperty("TypeName"); serviceProvider = ServiceBuilder.Build(); appNode.AddNode(typeNode); hierarchy = new ConfigurationUIHierarchy(appNode, serviceProvider); }
public void TestInitialize() { ConfigurationApplicationNode node = new ConfigurationApplicationNode(ConfigurationApplicationFile.FromCurrentAppDomain()); serviceProvider = ServiceBuilder.Build(); hierarchy = new ConfigurationUIHierarchy(node, serviceProvider); ServiceContainer container = (ServiceContainer)serviceProvider; container.RemoveService(typeof(IUIService)); container.AddService(typeof(IUIService), new TestUIService(serviceProvider, this)); }
/// <summary> /// Adds a hierarchy to the container. /// </summary> /// <param name="hierarchy"> /// The hierarchy to add. /// </param> public void AddHierarchy(IConfigurationUIHierarchy hierarchy) { hierarchy.RootNode.Name = CreateUniqueHierarchyRootNode(hierarchy.RootNode.Name); hierarchies.Add(hierarchy.Id, hierarchy); if (selectedHierarchy == null) { selectedHierarchy = hierarchy; } OnHierarchyAdded(new HierarchyAddedEventArgs(hierarchy)); }
/// <summary> /// Initialize a new instance of the <see cref="MergedConfigurationProperty"/> class with the merged configuration data, A <see cref="PropertyDescriptor"/>, the instance and the <see cref="IConfigurationUIHierarchy"/>. /// </summary> /// <param name="mergedConfigurationData">A <see cref="ConfigurationNodeMergeData"/> object.</param> /// <param name="innerProperyDescriptor">The <see cref="PropertyDescriptor"/> for the node.</param> /// <param name="actualInstance">The instance for the property.</param> /// <param name="configurationHierarchy">An <see cref="IConfigurationUIHierarchy"/> object.</param> public MergedConfigurationProperty(ConfigurationNodeMergeData mergedConfigurationData, PropertyDescriptor innerProperyDescriptor, object actualInstance, IConfigurationUIHierarchy configurationHierarchy) : base(innerProperyDescriptor) { this.actualInstance = actualInstance; this.mergedConfigurationData = mergedConfigurationData; this.innerProperyDescriptor = innerProperyDescriptor; this.configurationHierarchy = configurationHierarchy; }
/// <summary> /// Removes a hierarchy from the container. /// </summary> /// <param name="id"> /// The identifier of the hierarchy to remove. /// </param> public void RemoveHierarchy(Guid id) { IConfigurationUIHierarchy hierarchy = hierarchies[id] as IConfigurationUIHierarchy; if (hierarchy == null) { return; } hierarchies.Remove(id); OnHierarchyRemoved(new HierarchyRemovedEventArgs(hierarchy)); }
public void CanFindHierarchyById() { using (IConfigurationUIHierarchyService hierarchyService = new ConfigurationUIHierarchyService()) { ConfigurationApplicationNode appNode = new ConfigurationApplicationNode(ConfigurationApplicationFile.FromCurrentAppDomain()); IConfigurationUIHierarchy hierarchy = new ConfigurationUIHierarchy(appNode, ServiceBuilder.Build()); hierarchyService.AddHierarchy(hierarchy); IConfigurationUIHierarchy foundHierarchy = hierarchyService.GetHierarchy(appNode.Id); Assert.AreSame(hierarchy, foundHierarchy); } }
protected override void InitializeCore() { ConfigurationApplicationNode appNode = new ConfigurationApplicationNode(); minLengthNode = new MyMinLengthTestNode(); appNode.AddNode(minLengthNode); valueInfo1 = minLengthNode.GetType().GetProperty("Value1"); valueInfo2 = minLengthNode.GetType().GetProperty("Value2"); serviceProvider = ServiceBuilder.Build(); hierarchy = new ConfigurationUIHierarchy(appNode, serviceProvider); }
/// <summary> /// Gets the sate of the command based on the node. /// </summary> /// <value> /// One of the <see cref="CommandState"/> values. /// </value> public virtual CommandState GetCommandState(ConfigurationNode node) { if (multiplicity == NodeMultiplicity.Allow) { return(commandState); } IConfigurationUIHierarchy currentHierarchy = ServiceHelper.GetCurrentHierarchy(serviceProvider); return(currentHierarchy.ContainsNodeType(node, nodeType) ? CommandState.Disabled : CommandState.Enabled); }
public void TestInitialize() { node = new ConfigurationApplicationNode(ConfigurationApplicationFile.FromCurrentAppDomain()); serviceProvider = ServiceBuilder.Build(); hierarchy = new ConfigurationUIHierarchy(node, serviceProvider); nodeA = new MyTestNode(); nodeB = new MyTestNode(); nodeC = new MyTestNode(); node.AddNode(nodeA); node.AddNode(nodeB); node.AddNode(nodeC); }
private void UpdateHierarchyRecursive(IConfigurationUIHierarchy hierarchyToUpdate, ConfigurationNode node) { for (int idx = 0; idx < node.ChildCount; ++idx) { if (node.childNodes[idx].Hierarchy == null || node.childNodes[idx].Hierarchy.Id != hierarchyToUpdate.Id) { //node.childNodes[index].Hierarchy = hierarchy; hierarchyToUpdate.AddNode(node.childNodes[idx]); } UpdateHierarchyRecursive(hierarchyToUpdate, node.childNodes[idx]); } }
public void TestInitialize() { node = new ConfigurationApplicationNode(ConfigurationApplicationFile.FromCurrentAppDomain()); serviceProvider = ServiceBuilder.Build(); hierarchy = new ConfigurationUIHierarchy(node, serviceProvider); nodeA = new MyTestNode(); nodeB = new MyTestNode(); nodeC = new MyTestNode(); node.AddNode(nodeA); node.AddNode(nodeB); node.AddNode(nodeC); }
public void EnsureAddHierarchyEventFired() { using (IConfigurationUIHierarchyService hierarchyService = new ConfigurationUIHierarchyService()) { hierarchyService.HierarchyAdded += new EventHandler <HierarchyAddedEventArgs>(OnHierarchyAdded); IConfigurationUIHierarchy hierarchy = CreateHierarchy(); hierarchyService.AddHierarchy(hierarchy); hierarchyService.HierarchyAdded -= new EventHandler <HierarchyAddedEventArgs>(OnHierarchyAdded); Assert.AreEqual(1, addEventCount); Assert.AreSame(hierarchy, eventHierarchy); } }
public void TestInitialize() { BeforeSetup(); appNode = new ConfigurationApplicationNode(ConfigurationApplicationFile.FromCurrentAppDomain()); serviceProvider = ServiceBuilder.Build(); hierarchy = new ConfigurationUIHierarchy(appNode, serviceProvider); ServiceHelper.GetUIHierarchyService(ServiceProvider).SelectedHierarchy = Hierarchy; hierarchy.Load(); InitializeCore(); AfterSetup(); }
public void TestInitialize() { BeforeSetup(); appNode = new ConfigurationApplicationNode(ConfigurationApplicationFile.FromCurrentAppDomain()); serviceProvider = ServiceBuilder.Build(); hierarchy = new ConfigurationUIHierarchy(appNode, serviceProvider); ServiceHelper.GetUIHierarchyService(ServiceProvider).SelectedHierarchy = Hierarchy; hierarchy.Load(); InitializeCore(); AfterSetup(); }
public void TestInitialize() { workingNode = null; node = new ConfigurationApplicationNode(); hierarchy = new ConfigurationUIHierarchy(node, ServiceBuilder.Build()); addingChildEventCount = 0; addChildEventCount = 0; removingChildEventCount = 0; removeChildEventCount = 0; renamingEventCount = 0; renamedEventCount = 0; removingEventCount = 0; removeEventCount = 0; }
public void TestInitialize() { workingNode = null; node = new ConfigurationApplicationNode(); hierarchy = new ConfigurationUIHierarchy(node, ServiceBuilder.Build()); addingChildEventCount = 0; addChildEventCount = 0; removingChildEventCount = 0; removeChildEventCount = 0; renamingEventCount = 0; renamedEventCount = 0; removingEventCount = 0; removeEventCount = 0; }
public void EnsureAllHierarchiesCanBeRetrieved() { using (IConfigurationUIHierarchyService hierarchyService = new ConfigurationUIHierarchyService()) { IConfigurationUIHierarchy hierarchy = CreateHierarchy(); IConfigurationUIHierarchy hierarchy2 = CreateHierarchy(); hierarchyService.AddHierarchy(hierarchy); hierarchyService.AddHierarchy(hierarchy2); IConfigurationUIHierarchy[] hierarchies = hierarchyService.GetAllHierarchies(); Assert.AreEqual(2, hierarchies.Length); Assert.AreSame(hierarchy2, hierarchies[1]); } }
/// <summary> /// Updates the reference to the authorization node to point to the correct /// instance stored in the hierarchy. /// </summary> /// <remarks>This method supports the internal Enterprise Library configuration console /// and is not intended to be called by user code.</remarks> /// <param name="hierarchy"><see cref="IConfigurationUIHierarchy"/> to use to resolve /// references.</param> public override void ResolveNodeReferences(IConfigurationUIHierarchy hierarchy) { if (!String.IsNullOrEmpty(authorizationProviderName)) { foreach (AuthorizationProviderNode authProviderNode in hierarchy.FindNodesByType(typeof(AuthorizationProviderNode))) { if (string.Compare(authorizationProviderName, authProviderNode.Name) == 0) { AuthorizationProvider = authProviderNode; break; } } } }
/// <summary> /// Updates the exception policy node reference to point to ones defined under /// the exception handling block. /// </summary> /// <param name="hierarchy">Hierarchy to use to locate other exception policy nodes.</param> public override void ResolveNodeReferences(IConfigurationUIHierarchy hierarchy) { if (!String.IsNullOrEmpty(exceptionPolicyName)) { foreach (ExceptionPolicyNode exceptionPolicyNode in hierarchy.FindNodesByType(typeof(ExceptionPolicyNode))) { if (string.Compare(exceptionPolicyName, exceptionPolicyNode.Name) == 0) { ExceptionPolicy = exceptionPolicyNode; break; } } } }
private EnvironmentNode LoadConfigurationMergeFile(IConfigurationUIHierarchy mainConfigurationHierarchy, string configurationMergeFile, IServiceProvider serviceProvider) { EnvironmentNodeBuilder nodeBuilder = new EnvironmentNodeBuilder(serviceProvider); EnvironmentNode environmentNode = nodeBuilder.Build(configurationMergeFile, mainConfigurationHierarchy); EnvironmentalOverridesNode environmentNodeContainer = mainConfigurationHierarchy.FindNodeByType(typeof(EnvironmentalOverridesNode)) as EnvironmentalOverridesNode; if (environmentNodeContainer == null) { throw new ApplicationException(Resources.ErrorNoEnvironmentContainer); } environmentNodeContainer.AddNode(environmentNode); return(environmentNode); }
/// <summary> /// Initializes the symmetric cache store encryption designtime and adds it to the caching settings. /// </summary> /// <param name="serviceProvider">The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param> /// <param name="rootNode">The root node of the application.</param> /// <param name="section">The <see cref="ConfigurationSection"/> that was opened from the <see cref="IConfigurationSource"/>.</param> protected override void OpenCore(IServiceProvider serviceProvider, ConfigurationApplicationNode rootNode, ConfigurationSection section) { IConfigurationUIHierarchy hierarchy = ServiceHelper.GetCurrentHierarchy(serviceProvider); foreach (SymmetricStorageEncryptionProviderNode symmetricStorageEncryptionNode in hierarchy.FindNodesByType(typeof(SymmetricStorageEncryptionProviderNode))) { foreach (SymmetricCryptoProviderNode symmetricCryptoProviderNode in hierarchy.FindNodesByType(typeof(SymmetricCryptoProviderNode))) { if (symmetricCryptoProviderNode.Name == symmetricStorageEncryptionNode.symmetricCryptoProviderNodeName) { symmetricStorageEncryptionNode.SymmetricInstance = symmetricCryptoProviderNode; break; } } } }
/// <summary> /// Initializes the database listener and adds it to the logging settings. /// </summary> /// <param name="serviceProvider">The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param> /// <param name="rootNode">The root node of the application.</param> /// <param name="section">The <see cref="ConfigurationSection"/> that was opened from the <see cref="IConfigurationSource"/>.</param> protected override void OpenCore(IServiceProvider serviceProvider, ConfigurationApplicationNode rootNode, ConfigurationSection section) { IConfigurationUIHierarchy hierarchy = ServiceHelper.GetCurrentHierarchy(serviceProvider); foreach (LoggingDatabaseNode loggingDatabaseNode in hierarchy.FindNodesByType(typeof(LoggingDatabaseNode))) { foreach (ConnectionStringSettingsNode connectionStringNode in hierarchy.FindNodesByType(typeof(ConnectionStringSettingsNode))) { if (connectionStringNode.Name == ((FormattedDatabaseTraceListenerData)loggingDatabaseNode.TraceListenerData).DatabaseInstanceName) { loggingDatabaseNode.DatabaseInstance = connectionStringNode; break; } } } }
/// <summary> /// Gets the overridden value for a specific property. /// </summary> /// <param name="propertyName">The name of the property.</param> /// <param name="targetType">The type in which the overridden value should be returned.</param> /// <param name="defaultValue">The value for the overriden property that should be returned if no overridden value exists.</param> /// <param name="configurationHierarchy">The <see cref="ConfigurationUIHierarchy"/> that should be used for deserializing the property value.</param> /// <returns> /// The overridden value of the property specified, as an instance of <paramref name="targetType"/>. /// If no overridden value is configured, the defaultValue will be returned. /// </returns> public object GetPropertyValue(string propertyName, Type targetType, object defaultValue, IConfigurationUIHierarchy configurationHierarchy) { object propertyValue; if (overriddenProperties.TryGetValue(propertyName, out propertyValue)) { if (propertyValue != null) { if (propertyValue is UnserializedPropertyValue) { propertyValue = ((UnserializedPropertyValue)propertyValue).DeserializePropertyValue(targetType, configurationHierarchy); } return propertyValue; } return null; } return defaultValue; }
/// <summary> /// Builds an <see cref="EnvironmentNode"/> given a Environment Delta file (.dconfig) and a <see cref="ConfigurationUIHierarchy"/>. /// </summary> /// <param name="environmentFileName">The path of the Environment Delta file (.dconfig) that should be used to construct the <see cref="EnvironmentNode"/>.</param> /// <param name="uiHierarchy">The <see cref="IConfigurationUIHierarchy"/> the created <see cref="EnvironmentNode"/> belongs to.</param> /// <returns>An instance of <see cref="EnvironmentNode"/> that represents the Environment Delta file (.dconfig) passed as <paramref name="environmentFileName"/>.</returns> public EnvironmentNode Build(string environmentFileName, IConfigurationUIHierarchy uiHierarchy) { EnvironmentMergeSection mergeSection = GetEnvrinmentMergeSection(environmentFileName); if (mergeSection != null) { EnvironmentMergeData data = ReadEnvironmentMergeData(mergeSection, uiHierarchy); data.EnvironmentName = mergeSection.EnvironmentName; data.EnvironmentDeltaFile = environmentFileName; data.EnvironmentConfigurationFile = mergeSection.EnvironmentDeltaFile; EnvironmentNode environmentNode = new EnvironmentNode(data); if (mergeSection.SectionInformation.IsProtected && mergeSection.SectionInformation.ProtectionProvider != null) { environmentNode.ProtectionProvider = mergeSection.SectionInformation.ProtectionProvider.Name; } return environmentNode; } return new EnvironmentNode(); }
EnvironmentMergeData ReadEnvironmentMergeData(EnvironmentMergeSection environmentSection, IConfigurationUIHierarchy configurationHierarchy) { EnvironmentMergeData mergeData = new EnvironmentMergeData(); foreach (EnvironmentNodeMergeElement mergeElement in environmentSection.MergeElements) { ConfigurationNodeMergeData propertyDictionaty = new ConfigurationNodeMergeData(); foreach (string key in mergeElement.OverriddenProperties.AllKeys) { string overriddenValue = mergeElement.OverriddenProperties[key].Value; propertyDictionaty.SetPropertyValue(key, new UnserializedPropertyValue(overriddenValue)); } ConfigurationNodeMergeData configurationNodeMergeData = new ConfigurationNodeMergeData(mergeElement.OverrideProperties, propertyDictionaty); string fullNodePath = configurationHierarchy.RootNode.Path + mergeElement.ConfigurationNodePath; ConfigurationNode node = configurationHierarchy.FindNodeByPath(fullNodePath); if (node != null) { mergeData.UpdateMergeData(node, configurationNodeMergeData); } } return mergeData; }
/// <summary> /// Initialize a new instance of the <see cref="HierarchySavedEventArgs"/> class with a <see cref="IConfigurationUIHierarchy"/> object. /// </summary> /// <param name="uiHierarchy"> /// An <see cref="IConfigurationUIHierarchy"/> object. /// </param> public HierarchySavedEventArgs(IConfigurationUIHierarchy uiHierarchy) { this.uiHierarchy = uiHierarchy; }
public CryptographyManagerSettingsBuilder(IServiceProvider serviceProvider, CryptographySettingsNode cryptographySettingsNode) { this.cryptographySettingsNode = cryptographySettingsNode; hierarchy = ServiceHelper.GetCurrentHierarchy(serviceProvider); cryptographySettings = new CryptographySettings(); }
public ODP10ConnectionSettingsBuilder(IServiceProvider serviceProvider) { this.hierarchy = ServiceHelper.GetCurrentHierarchy(serviceProvider); }
/// <summary> /// Removes a hierarchy from the container. /// </summary> /// <param name="hierarchy"> /// The hierarchy to remove. /// </param> public void RemoveHierarchy(IConfigurationUIHierarchy hierarchy) { if (null == hierarchy) throw new ArgumentNullException("hierarchy"); RemoveHierarchy(hierarchy.Id); }
/// <summary> /// Adds a hierarchy to the container. /// </summary> /// <param name="hierarchy"> /// The hierarchy to add. /// </param> public void AddHierarchy(IConfigurationUIHierarchy hierarchy) { hierarchy.RootNode.Name = CreateUniqueHierarchyRootNode(hierarchy.RootNode.Name); hierarchies.Add(hierarchy.Id, hierarchy); if (selectedHierarchy == null) { selectedHierarchy = hierarchy; } OnHierarchyAdded(new HierarchyAddedEventArgs(hierarchy)); }
public CacheManagerSettingsBuilder(IServiceProvider serviceProvider, CacheManagerSettingsNode cacheSettingsNode) { this.cacheSettingsNode = cacheSettingsNode; hierarchy = ServiceHelper.GetCurrentHierarchy(serviceProvider); cacheConfiguration = new CacheManagerSettings(); }
private void UpdateHierarchyRecursive(IConfigurationUIHierarchy hierarchyToUpdate, ConfigurationNode node) { for (int idx = 0; idx < node.ChildCount; ++idx) { if (node.childNodes[idx].Hierarchy == null || node.childNodes[idx].Hierarchy.Id != hierarchyToUpdate.Id) { //node.childNodes[index].Hierarchy = hierarchy; hierarchyToUpdate.AddNode(node.childNodes[idx]); } UpdateHierarchyRecursive(hierarchyToUpdate, node.childNodes[idx]); } }
public HierarchyAndType(IConfigurationUIHierarchy hierarchy, Type type) { this.hierarchy = hierarchy; this.type = type; }
public void TestCleanup() { addEventCount = 0; removedEventCount = 0; eventHierarchy = null; }
public OracleConnectionNodeBuilder(IServiceProvider serviceProvider, OracleConnectionSettings oracleConnectionSettings) : base(serviceProvider) { this.hierarchy = ServiceHelper.GetCurrentHierarchy(serviceProvider); this.oracleConnectionSettings = oracleConnectionSettings; }
private void OnHierarchyAdded(object sender, HierarchyAddedEventArgs args) { addEventCount++; eventHierarchy = args.UIHierarchy; }
private void OnHierarchyRemoved(object sender, HierarchyRemovedEventArgs args) { removedEventCount++; eventHierarchy = args.UIHierarchy; }
public ExceptionHandlingSettingsBuilder(IServiceProvider serviceProvider, ExceptionHandlingSettingsNode exceptionHandlingSettingsNode) { this.exceptionHandlingSettingsNode = exceptionHandlingSettingsNode; hierarchy = ServiceHelper.GetCurrentHierarchy(serviceProvider); }
public LoggingSettingsBuilder(IServiceProvider serviceProvider, LoggingSettingsNode loggingSettingsNode) { this.loggingSettingsNode = loggingSettingsNode; hierarchy = ServiceHelper.GetCurrentHierarchy(serviceProvider); }
public ConnectionStringsSectionBuilder(IServiceProvider serviceProvider, ConnectionStringsSectionNode connectionStringsSectionNode) { this.connectionStringsSectionNode = connectionStringsSectionNode; hierarchy = ServiceHelper.GetCurrentHierarchy(serviceProvider); }
/// <summary> /// /// </summary> /// <param name="serviceProvider"></param> /// <param name="securitySettingsNode"></param> public SecuritySettingsBuilder(IServiceProvider serviceProvider, SecuritySettingsNode securitySettingsNode) { this.securitySettingsNode = securitySettingsNode; hierarchy = ServiceHelper.GetCurrentHierarchy(serviceProvider); }
public DatabaseSectionBuilder(IServiceProvider serviceProvider, DatabaseSectionNode databaseSectionNode) { this.databaseSectionNode = databaseSectionNode; this.hierarchy = ServiceHelper.GetCurrentHierarchy(serviceProvider); }