コード例 #1
0
        /// <summary>
        /// Raises the <see cref="ConfigurationNode.ChildAdded"/> event and sets the storage encryption provider name based on the child node added that must be a <see cref="CacheStorageEncryptionNode"/>.
        /// </summary>
        /// <param name="e">A <see cref="ConfigurationChangedEventArgs"/> that contains the event data.</param>
        protected override void OnChildAdded(ConfigurationNodeChangedEventArgs e)
        {
            base.OnChildAdded(e);
            CacheStorageEncryptionNode node = e.Node as CacheStorageEncryptionNode;

            Debug.Assert(null != node, "Only a CacheStorageEncryptionNode can be added to a CacheStorageNode");

            storageEncryptionName = node.Name;
        }
コード例 #2
0
        private void BuildCacheStorageProviders()
        {
            foreach (CacheStorageNode cacheStorageNode in hierarchy.FindNodesByType(cacheSettingsNode, typeof(CacheStorageNode)))
            {
                CacheStorageData           cacheStorageData         = cacheStorageNode.CacheStorageData;
                CacheStorageEncryptionNode encryptionNodeForStorage = (CacheStorageEncryptionNode)hierarchy.FindNodeByType(cacheStorageNode, typeof(CacheStorageEncryptionNode));
                cacheStorageData.StorageEncryption = (encryptionNodeForStorage == null) ? string.Empty : encryptionNodeForStorage.Name;

                cacheConfiguration.BackingStores.Add(cacheStorageData);
            }
        }