Example #1
0
        /// <summary>
        /// <para>Adds the <see cref="SymmetricStorageEncryptionProviderNode"/> to the current <see cref="CacheStorageNode"/>.
        /// If the Cryptography Application Block configuration is not added to the current application, it is also added.</para>
        /// </summary>
        /// <param name="e"><para>An <see cref="EventArgs"/> containing the event data.</para></param>
        protected override void OnExecuted(EventArgs e)
        {
            base.OnExecuted(e);
            SymmetricStorageEncryptionProviderNode node = ChildNode as SymmetricStorageEncryptionProviderNode;

            Debug.Assert(null != node, "Expected a SymmetricStorageEncryptionNode");

            if (null == CurrentHierarchy.FindNodeByType(typeof(CryptographySettingsNode)))
            {
                new AddCryptographySettingsNodeCommand(ServiceProvider).Execute(CurrentHierarchy.RootNode);
            }
        }
Example #2
0
        /// <summary>
        /// <para>Adds the <see cref="DataCacheStorageNode"/> to the current <see cref="CacheManagerNode"/>. If the Data Application Block configuration is not added to the current application, it is also added.</para>
        /// </summary>
        /// <param name="e"><para>An <see cref="EventArgs"/> containing the event data.</para></param>
        protected override void OnExecuted(EventArgs e)
        {
            base.OnExecuted(e);
            DataCacheStorageNode node = ChildNode as DataCacheStorageNode;

            Debug.Assert(null != node, "Expected a DataCacheStorageNode");

            if (null == CurrentHierarchy.FindNodeByType(typeof(DatabaseSectionNode)))
            {
                new AddDatabaseSectionNodeCommand(ServiceProvider).Execute(CurrentHierarchy.RootNode);
            }
        }
        protected override void OnExecuted(EventArgs e)
        {
            base.OnExecuted(e);
            LoggingExceptionHandlerNode node = ChildNode as LoggingExceptionHandlerNode;

            if (null == node)
            {
                return;
            }
            if (null == CurrentHierarchy.FindNodeByType(typeof(LoggingSettingsNode)))
            {
                ConfigurationApplicationNode applicationNode = (ConfigurationApplicationNode)CurrentHierarchy.FindNodeByType(typeof(ConfigurationApplicationNode));
                new AddLoggingSettingsNodeCommand(ServiceProvider).Execute(applicationNode);
            }
        }
        protected override void ExecuteCore(ConfigurationNode node)
        {
            ConfigurationSectionCollectionNode configurationSectionCollectionNode = CurrentHierarchy.FindNodeByType(typeof(ConfigurationSectionCollectionNode)) as ConfigurationSectionCollectionNode;

            if (configurationSectionCollectionNode == null)
            {
                return;
            }

            IXmlIncludeTypeService service = XmlIncludeTypeService;

            Type[] types = null;
            XmlSerializerTransformerNode transformerNode = null;

            foreach (ConfigurationNode configurationNode in configurationSectionCollectionNode.Nodes)
            {
                transformerNode = CurrentHierarchy.FindNodeByType(configurationNode, typeof(XmlSerializerTransformerNode)) as XmlSerializerTransformerNode;
                if (transformerNode == null)
                {
                    continue;
                }
                types = service.GetXmlIncludeTypes(configurationNode.Name);
                if (types == null)
                {
                    continue;
                }
                ArrayList nodesToRemove = new ArrayList();
                foreach (Type t in types)
                {
                    if (!FindNodTypeToDataTypeMatchRecursive(node, t))
                    {
                        continue;
                    }
                    foreach (XmlIncludeTypeNode xmlIncludeTypeNode in transformerNode.Nodes)
                    {
                        Type includeType = Type.GetType(xmlIncludeTypeNode.TypeName, false, true);
                        if (includeType.Equals(t))
                        {
                            nodesToRemove.Add(xmlIncludeTypeNode);
                        }
                    }
                }
                foreach (ConfigurationNode nodeToRemove in nodesToRemove)
                {
                    nodeToRemove.Remove();
                }
            }
        }
        protected override void OnExecuted(EventArgs e)
        {
            base.OnExecuted(e);
            LoggingDatabaseNode node = ChildNode as LoggingDatabaseNode;

            if (null == node)
            {
                return;
            }
            if (null == CurrentHierarchy.FindNodeByType(typeof(LoggingSettingsNode)))
            {
                new AddLoggingSettingsNodeCommand(ServiceProvider).Execute(CurrentHierarchy.RootNode);
            }
            if (null == CurrentHierarchy.FindNodeByType(typeof(DatabaseSectionNode)))
            {
                new AddDatabaseSectionNodeCommand(ServiceProvider).Execute(CurrentHierarchy.RootNode);
            }
        }
Example #6
0
        protected override void OnExecuted(EventArgs e)
        {
            DatabaseSectionNode node = ChildNode as DatabaseSectionNode;

            Debug.Assert(null != node, "Expected DatabaseSectionNode");
            if (addDefaultConnectionString)
            {
                new AddConnectionStringsSectionNodeCommand(ServiceProvider).Execute(node);
                ConnectionStringSettingsNode defaultDatabaseNode = (ConnectionStringSettingsNode)CurrentHierarchy.FindNodeByType(node, typeof(ConnectionStringSettingsNode));
                node.DefaultDatabase = defaultDatabaseNode;
            }
            node.AddNode(new ProviderMappingsNode());
        }