コード例 #1
0
        /// <summary>
        /// <para>Sets the name of node when sited to match the underlying storage name and adds the <see cref="StorageProviderNode"/> and <see cref="TransformerNode"/> based on any active configuration data.</para>
        /// </summary>
        protected override void OnSited()
        {
            base.OnSited();
            Site.Name = configurationSectionData.Name;
            INodeCreationService service = ServiceHelper.GetNodeCreationService(Site);

            if (this.configurationSectionData.StorageProvider != null)
            {
                StorageProviderNode storageProviderNode = service.CreateNode(configurationSectionData.StorageProvider.GetType(), new object[] { configurationSectionData.StorageProvider }) as StorageProviderNode;
                Debug.Assert(storageProviderNode != null, "The storage provider type was not registered succesfully.");
                this.Nodes.Add(storageProviderNode);
            }
            if (this.configurationSectionData.Transformer != null)
            {
                TransformerNode transformerNode = service.CreateNode(configurationSectionData.Transformer.GetType(), new object[] { this.configurationSectionData.Transformer }) as TransformerNode;
                Debug.Assert(transformerNode != null, "The transformer type was not registered succesfully.");
                this.Nodes.Add(transformerNode);
            }
        }
コード例 #2
0
 /// <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 }));
     }
 }
コード例 #3
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);
            }
        }
コード例 #4
0
ファイル: CacheStorageNode.cs プロジェクト: smillea1/NCS-V1-1
 /// <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);
     }
 }
コード例 #5
0
ファイル: CacheManagerNode.cs プロジェクト: smillea1/NCS-V1-1
 /// <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);
     }
 }