Example #1
0
        public void CanCreateCustomHashProviderNodeByData()
        {
            INodeCreationService   nodeCreationService    = ServiceHelper.GetNodeCreationService(ServiceProvider);
            CustomHashProviderNode customHashProviderNode = nodeCreationService.CreateNodeByDataType(typeof(CustomHashProviderData)) as CustomHashProviderNode;

            Assert.IsNotNull(customHashProviderNode);
        }
Example #2
0
        public void RegisterTest()
        {
            manager.Register(Host);
            INodeCreationService service = GetService(typeof(INodeCreationService)) as INodeCreationService;

            Assert.IsNotNull(service);
        }
Example #3
0
        private static void RegisterNodeMaps(IServiceProvider serviceProvider)
        {
            INodeCreationService nodeCreationService = ServiceHelper.GetNodeCreationService(serviceProvider);

            Type nodeType           = typeof(CustomAuthenticationProviderNode);
            NodeCreationEntry entry = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(CustomAuthenticationProviderData), SR.CustomAuthenticationProviderCommandName);

            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(CustomRolesProviderNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(CustomRolesProviderData), SR.CustomRolesProviderCommandName);
            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(CustomAuthorizationProviderNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(CustomAuthorizationProviderData), SR.CustomAuthorizationProviderCommandName);
            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(CustomProfileProviderNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(CustomProfileProviderData), SR.CustomProfileProviderCommandName);
            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(CustomSecurityCacheProviderNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(CustomSecurityCacheProviderData), SR.CustomSecurityCacheNodeCommandName);
            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(AuthorizationRuleProviderNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(AuthorizationRuleProviderData), SR.AuthorizationRuleProviderCommandName);
            nodeCreationService.AddNodeCreationEntry(entry);
        }
        public void CanCreateSymmetricStorageEncryptionProviderNodeByData()
        {
            INodeCreationService nodeCreationService    = ServiceHelper.GetNodeCreationService(ServiceProvider);
            SymmetricStorageEncryptionProviderNode node = nodeCreationService.CreateNodeByDataType(typeof(SymmetricStorageEncryptionProviderData)) as SymmetricStorageEncryptionProviderNode;

            Assert.IsNotNull(node);
        }
Example #5
0
        public void CanCreateDpapiSymmetricCryptoProviderNodeByData()
        {
            INodeCreationService             nodeCreationService = ServiceHelper.GetNodeCreationService(ServiceProvider);
            DpapiSymmetricCryptoProviderNode dpapiProviderNode   = nodeCreationService.CreateNodeByDataType(typeof(DpapiSymmetricCryptoProviderData)) as DpapiSymmetricCryptoProviderNode;

            Assert.IsNotNull(dpapiProviderNode);
        }
        public void CanCreateHashAlgorithmProviderNodeByData()
        {
            INodeCreationService      nodeCreationService       = ServiceHelper.GetNodeCreationService(ServiceProvider);
            HashAlgorithmProviderNode hashAlgorithmProviderNode = nodeCreationService.CreateNodeByDataType(typeof(HashAlgorithmProviderData)) as HashAlgorithmProviderNode;

            Assert.IsNotNull(hashAlgorithmProviderNode);
        }
        private static void RegisterNodeMaps(IServiceProvider serviceProvider)
        {
            INodeCreationService nodeCreationService = ServiceHelper.GetNodeCreationService(serviceProvider);

            Type nodeType           = typeof(CustomHashProviderNode);
            NodeCreationEntry entry = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(CustomHashProviderData), SR.CustomHashProviderNodeName);

            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(CustomSymmetricCryptoProviderNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(CustomSymmetricCryptoProviderData), SR.CustomSymmetricCryptoProviderNodeName);
            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(HashAlgorithmProviderNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(HashAlgorithmProviderData), SR.HashAlgorithmProviderNodeName);
            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(KeyedHashAlgorithmProviderNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(KeyedHashAlgorithmProviderData), SR.KeyedHashProviderNodeName);
            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(SymmetricAlgorithmProviderNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(SymmetricAlgorithmProviderData), SR.SymmetricAlgorithmProviderNodeName);
            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(DpapiSymmetricCryptoProviderNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(DpapiSymmetricCryptoProviderData), SR.DpapiSymmetricCryptoProviderNodeName);
            nodeCreationService.AddNodeCreationEntry(entry);
        }
Example #8
0
        /// <summary>
        /// <para>Gets the registered <see cref="INodeCreationService"/>.</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>
        /// <returns>
        /// <para>The registered <see cref="INodeCreationService"/>.</para>
        /// </returns>
        public static INodeCreationService GetNodeCreationService(IServiceProvider serviceProvider)
        {
            INodeCreationService nodeCreationService = serviceProvider.GetService(typeof(INodeCreationService)) as INodeCreationService;

            Debug.Assert(nodeCreationService != null, "Could not get the INodeCreationService");
            return(nodeCreationService);
        }
Example #9
0
        public void CanCreateSymmetricAlgorithmProviderNodeByData()
        {
            INodeCreationService           nodeCreationService    = ServiceHelper.GetNodeCreationService(ServiceProvider);
            SymmetricAlgorithmProviderNode symmetricAlgorithmNode = nodeCreationService.CreateNodeByDataType(typeof(SymmetricAlgorithmProviderData)) as SymmetricAlgorithmProviderNode;

            Assert.IsNotNull(symmetricAlgorithmNode);
        }
        private static void RegisterNodeTypes(IServiceProvider serviceProvider)
        {
            INodeCreationService nodeCreationService = ServiceHelper.GetNodeCreationService(serviceProvider);

            Type nodeType           = typeof(CachingStoreProviderNode);
            NodeCreationEntry entry = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(CachingStoreProviderData), SR.SecurityInstance);

            nodeCreationService.AddNodeCreationEntry(entry);
        }
Example #11
0
        private static void RegisterNodeTypes(IServiceProvider serviceProvider)
        {
            INodeCreationService nodeCreationService = ServiceHelper.GetNodeCreationService(serviceProvider);

            Type nodeType           = typeof(DatabaseSinkNode);
            NodeCreationEntry entry = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(DatabaseSinkData), SR.DatabaseSink);

            nodeCreationService.AddNodeCreationEntry(entry);
        }
Example #12
0
        private static void RegisterNodeTypes(IServiceProvider serviceProvider)
        {
            INodeCreationService nodeCreationService = ServiceHelper.GetNodeCreationService(serviceProvider);

            Type nodeType           = typeof(SymmetricStorageEncryptionNode);
            NodeCreationEntry entry = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(SymmetricStorageEncryptionProviderData), SR.SymmetricStorageEncryption);

            nodeCreationService.AddNodeCreationEntry(entry);
        }
        private static void RegisterNodeTypes(IServiceProvider serviceProvider)
        {
            INodeCreationService nodeCreationService = ServiceHelper.GetNodeCreationService(serviceProvider);

            Type nodeType           = typeof(ActiveDirectoryRolesProviderNode);
            NodeCreationEntry entry = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(AdRolesProviderData), SR.ActiveDirectoryProvider);

            nodeCreationService.AddNodeCreationEntry(entry);
        }
Example #14
0
        private static void RegisterNodeTypes(IServiceProvider serviceProvider)
        {
            INodeCreationService nodeCreationService = ServiceHelper.GetNodeCreationService(serviceProvider);

            Type nodeType           = typeof(LoggingExceptionHandlerNode);
            NodeCreationEntry entry = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(LoggingExceptionHandlerData), SR.LoggingHandlerName);

            nodeCreationService.AddNodeCreationEntry(entry);
        }
 /// <summary>
 /// <para>Sets the name of the node and displays any <see cref="KeyAlgorithmStorageProviderNode"/> objects that exits in configuration.</para>
 /// </summary>
 protected override void OnSited()
 {
     base.OnSited();
     Site.Name = SR.DefaultEncryptionSettingsNodeName;
     if ((Nodes.Count == 0) && (keyAlgorithmPairStorageProviderData != null))
     {
         INodeCreationService service = ServiceHelper.GetNodeCreationService(Site);
         Nodes.Add(service.CreateNode(keyAlgorithmPairStorageProviderData.GetType(), new object[] { keyAlgorithmPairStorageProviderData }));
     }
 }
        /// <summary>
        /// Adds a node map that can only be created more than once.
        /// </summary>
        /// <param name="text">The text to display to the user.</param>
        /// <param name="nodeType">The type of node to create.</param>
        /// <param name="dataType">The configuration type for the node.</param>
        protected void AddMultipleNodeMap(string text, Type nodeType, Type dataType)
        {
            INodeCreationService nodeCreationService = ServiceHelper.GetNodeCreationService(serviceProvider);

            nodeCreationService.AddNodeCreationEntry(NodeCreationEntry.CreateNodeCreationEntryWithMultiples(
                                                         new AddChildNodeCommand(serviceProvider, nodeType),
                                                         nodeType,
                                                         dataType,
                                                         text));
        }
Example #17
0
        /// <summary>
        /// Gets the registered <see cref="INodeCreationService"/>.
        /// </summary>
        /// <param name="serviceProvider">
        /// The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.
        /// </param>
        /// <returns>The registered <see cref="INodeCreationService"/>.</returns>
        public static INodeCreationService GetNodeCreationService(IServiceProvider serviceProvider)
        {
            if (null == serviceProvider)
            {
                throw new ArgumentNullException("serviceProvider");
            }

            INodeCreationService nodeCreationService = serviceProvider.GetService(typeof(INodeCreationService)) as INodeCreationService;

            return(nodeCreationService);
        }
Example #18
0
 /// <summary>
 /// <para>Sets the name based on the data name and adds the encyrption node if one exists.</para>
 /// </summary>
 protected override void OnSited()
 {
     base.OnSited();
     Site.Name = cacheStorageData.Name;
     if (cacheStorageData.StorageEncryption != null && cacheStorageData.StorageEncryption.Name != null)
     {
         INodeCreationService service = GetService(typeof(INodeCreationService)) as INodeCreationService;
         Debug.Assert(service != null, "Could not get INodeCreationService");
         ConfigurationNode node = service.CreateNode(cacheStorageData.StorageEncryption.GetType(), new object[] { cacheStorageData.StorageEncryption });
         Nodes.Add(node);
     }
 }
Example #19
0
        /// <summary>
        /// <para>Sets the name of node when sited to match the underlying storage name.</para>
        /// </summary>
        protected override void OnSited()
        {
            base.OnSited();
            Site.Name = SR.DefaultDatabaseTypeCollectionNodeName;
            INodeCreationService service = GetService(typeof(INodeCreationService)) as INodeCreationService;

            Debug.Assert(service != null, "Could not get the INodeCreationService.");
            foreach (DatabaseTypeData databaseTypeData in databaseTypeDataCollection)
            {
                Nodes.Add(new DatabaseTypeNode(databaseTypeData));
            }
        }
Example #20
0
        /// <summary>
        /// <para>Create child nodes for a collection of configuration data.</para>
        /// </summary>
        /// <param name="collection">
        /// <para>A collection of runtime data.</para>
        /// </param>
        protected void CreateDynamicNodes(ICollection collection)
        {
            INodeCreationService service           = ServiceHelper.GetNodeCreationService(Site);
            ConfigurationNode    configurationNode = null;

            foreach (object data in collection)
            {
                configurationNode = service.CreateNode(data.GetType(), new object[] { data });
                Debug.Assert(configurationNode != null, String.Format("The configuration for {0} type was not registered succesfully.", data.GetType().Name));
                this.Nodes.Add(configurationNode);
            }
        }
Example #21
0
 /// <summary>
 /// Creates a default <see cref="CacheStorageNode"/> when this node is sited.
 /// </summary>
 protected override void OnSited()
 {
     base.OnSited();
     Site.Name = cacheManagerData.Name;
     if (cacheManagerData.CacheStorage != null && cacheManagerData.CacheStorage.Name != null && cacheManagerData.CacheStorage.TypeName != NullBackingStoreTypeName)
     {
         INodeCreationService service = GetService(typeof(INodeCreationService)) as INodeCreationService;
         Debug.Assert(service != null, "Could not get the INodeCreationService.");
         ConfigurationNode node = service.CreateNode(cacheManagerData.CacheStorage.GetType(), new object[] { cacheManagerData.CacheStorage });
         Nodes.Add(node);
     }
 }
        private static void RegisterNodeMaps(IServiceProvider serviceProvider)
        {
            INodeCreationService nodeCreationService = ServiceHelper.GetNodeCreationService(serviceProvider);

            Type nodeType           = typeof(IsolatedStorageCacheStorageNode);
            NodeCreationEntry entry = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(IsolatedStorageCacheStorageData), SR.DefaultIsolatedStorageNodeName);

            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(CustomCacheStorageNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(CustomCacheStorageData), SR.DefaultCustomCacheStorageNodeName);
            nodeCreationService.AddNodeCreationEntry(entry);
        }
Example #23
0
        private static void RegisterNodeMaps(IServiceProvider serviceProvider)
        {
            INodeCreationService nodeCreationService = ServiceHelper.GetNodeCreationService(serviceProvider);

            Type nodeType           = typeof(OracleConnectionStringNode);
            NodeCreationEntry entry = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(OracleConnectionStringData), SR.OracleConnectionStringNodeFriendlyName);

            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(ConnectionStringNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(ConnectionStringData), SR.ConnectionStringNodeFriendlyName);
            nodeCreationService.AddNodeCreationEntry(entry);
        }
        private static void RegisterNodeTypes(IServiceProvider serviceProvider)
        {
            INodeCreationService nodeCreationService = ServiceHelper.GetNodeCreationService(serviceProvider);

            Type nodeType           = typeof(DbProfileProviderNode);
            NodeCreationEntry entry = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(DbProfileProviderData), SR.DbProfileProviderDisplayName);

            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(DbRolesProviderNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(DbRolesProviderData), SR.DbRolesProviderDisplayName);
            nodeCreationService.AddNodeCreationEntry(entry);
        }
Example #25
0
        private static void RegisterNodeMaps(IServiceProvider serviceProvider)
        {
            INodeCreationService nodeCreationService = ServiceHelper.GetNodeCreationService(serviceProvider);

            Type nodeType           = typeof(CustomSinkNode);
            NodeCreationEntry entry = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(CustomSinkData), SR.CustomSink);

            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(EmailSinkNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(EmailSinkData), SR.EmailSink);
            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(EventLogSinkNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(EventLogSinkData), SR.EventLogSink);
            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(FlatFileSinkNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(FlatFileSinkData), SR.FlatFileSink);
            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(RollingFlatFileSinkNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(RollingFlatFileSinkData), SR.RollingFlatFileSink);
            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(ConsoleSinkNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(ConsoleSinkData), SR.ConsoleSink);
            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(MsmqSinkNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(MsmqSinkData), SR.MsmqSink);
            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(WmiLogSinkNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(WMILogSinkData), SR.WmiLogSink);
            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(WSSinkNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(WSSinkNode), SR.WSSink);
            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(CustomFormatterNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(CustomFormatterData), SR.CustomFormatter);
            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(TextFormatterNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(TextFormatterData), SR.TextFormatter);
            nodeCreationService.AddNodeCreationEntry(entry);
        }
Example #26
0
 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());
 }
Example #27
0
        private static void RegisterNodeMaps(IServiceProvider serviceProvider)
        {
            INodeCreationService nodeCreationService = ServiceHelper.GetNodeCreationService(serviceProvider);

            Type nodeType           = typeof(CustomDistributionStrategyNode);
            NodeCreationEntry entry = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(CustomDistributionStrategyData), SR.CustomDistributionStrategy);

            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(InProcDistributionStrategyNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(InProcDistributionStrategyData), SR.InProcDistributionStrategy);
            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(MsmqDistributionStrategyNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(MsmqDistributionStrategyData), SR.MsmqDistributionStrategy);
            nodeCreationService.AddNodeCreationEntry(entry);
        }
        private static void RegisterNodeMaps(IServiceProvider serviceProvider)
        {
            INodeCreationService nodeCreationService = ServiceHelper.GetNodeCreationService(serviceProvider);

            Type nodeType           = typeof(CustomHandlerNode);
            NodeCreationEntry entry = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(CustomHandlerData), SR.DefaultCustomHandlerNodeName);

            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(WrapHandlerNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(WrapHandlerData), SR.DefaultWrapHandlerNodeName);
            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(ReplaceHandlerNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryWithMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(ReplaceHandlerData), SR.DefaultReplaceHandlerNodeName);
            nodeCreationService.AddNodeCreationEntry(entry);
        }
Example #29
0
        public override void SetUp()
        {
            base.SetUp();
            INodeCreationService nodeCreationService = GetService(typeof(INodeCreationService)) as INodeCreationService;

            Assert.IsNotNull(nodeCreationService);

            Type nodeType           = typeof(CustomKeyAlgorithmStorageProviderNode);
            NodeCreationEntry entry = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(Host, nodeType), nodeType, typeof(CustomKeyAlgorithmPairStorageProviderData), SR.CustomKeyAlgorithmPairStorageProviderNodeDefaultName);

            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(CustomTransformerNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(Host, nodeType), nodeType, typeof(CustomTransformerData), SR.CustomTransformerNodeDefaultName);
            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(CustomStorageProviderNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(Host, nodeType), nodeType, typeof(CustomStorageProviderData), SR.CustomStorageProviderNodeDefaultName);
            nodeCreationService.AddNodeCreationEntry(entry);


            nodeType = typeof(XmlFileStorageProviderNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(Host, nodeType), nodeType, typeof(XmlFileStorageProviderData), SR.XMLStorageProviderNodeFriendlyName);
            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(XmlSerializerTransformerNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(Host, nodeType), nodeType, typeof(XmlSerializerTransformerData), SR.XmlSerializerTransformerNodeFriendlyName);
            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(ConfigurationSectionNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(Host, nodeType), nodeType, typeof(ConfigurationSectionData), SR.ConfigurationSectionNodeFriendlyName);
            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(ReadOnlyConfigurationSectionNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(Host, nodeType), nodeType, typeof(ReadOnlyConfigurationSectionData), SR.ReadOnlyConfigurationSectionNodeFriendlyName);
            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(FileKeyAlgorithmPairStorageProviderNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddFileKeyAlgorithmPairNodeCommand(Host, nodeType), nodeType, typeof(FileKeyAlgorithmPairStorageProviderData), SR.FileKeyAlgorithmStorageProviderNodeFriendlyName);
            nodeCreationService.AddNodeCreationEntry(entry);

            configurationSectionsNode = new ConfigurationSectionCollectionNode(ConfigurationSettingsBuilder.Create());
            Assert.IsNotNull(configurationSectionsNode);
            CreateHierarchyAndAddToHierarchyService(configurationSectionsNode, CreateDefaultConfiguration());
        }
Example #30
0
        public static DatabaseSettings Create(IServiceProvider serviceProvider)
        {
            INodeCreationService nodeCreationService = ServiceHelper.GetNodeCreationService(serviceProvider);

            Type nodeType           = typeof(OracleConnectionStringNode);
            NodeCreationEntry entry = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(OracleConnectionStringData), SR.OracleConnectionStringNodeFriendlyName);

            nodeCreationService.AddNodeCreationEntry(entry);

            nodeType = typeof(ConnectionStringNode);
            entry    = NodeCreationEntry.CreateNodeCreationEntryNoMultiples(new AddChildNodeCommand(serviceProvider, nodeType), nodeType, typeof(ConnectionStringData), SR.ConnectionStringNodeFriendlyName);
            nodeCreationService.AddNodeCreationEntry(entry);

            XmlTextReader xmlReader     = new XmlTextReader(new StringReader(xmlString));
            XmlSerializer xmlSerializer = new XmlSerializer(typeof(DatabaseSettings));

            return(xmlSerializer.Deserialize(xmlReader) as DatabaseSettings);
        }
Example #31
0
 /// <summary>
 /// Initialize a new instance of the <see cref="NodeBuilder"/> class with a <see cref="IServiceProvider"/>.
 /// </summary>
 /// <param name="serviceProvider">The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param>
 protected NodeBuilder(IServiceProvider serviceProvider)
 {
     this.nodeCreationService = ServiceHelper.GetNodeCreationService(serviceProvider);
     this.errorLogService = ServiceHelper.GetErrorService(serviceProvider);
     this.serviceProvider = serviceProvider;
 }
 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());
 }