private void CreateCacheManagerNode(CacheManagerCollectionNode node, CacheManagerData cacheManagerData)
		{
			CacheManagerNode cacheManagerNode = new CacheManagerNode(cacheManagerData);
			node.AddNode(cacheManagerNode);
			if (cacheManagerNode.Name == cacheManagerSettings.DefaultCacheManager) defaultNode = cacheManagerNode;
			CreateStorageNode(cacheManagerNode, cacheManagerData.CacheStorage);
		}
Пример #2
0
        /// <summary>
        /// Adds default nodes for managers and storages.
        /// </summary>
        protected override void AddDefaultChildNodes()
        {
            base.AddDefaultChildNodes();
            CacheManagerCollectionNode node = new CacheManagerCollectionNode(this.cacheManagerSettings.CacheManagers);

            Nodes.AddWithDefaultChildren(node);
        }
Пример #3
0
        /// <summary>
        /// See <see cref="ConfigurationNode.ResolveNodeReferences"/>.
        /// </summary>
        public override void ResolveNodeReferences()
        {
            base.ResolveNodeReferences();
            CacheManagerCollectionNode nodes = Hierarchy.FindNodeByType(this, typeof(CacheManagerCollectionNode)) as CacheManagerCollectionNode;

            DefaultCacheManager = Hierarchy.FindNodeByName(nodes, this.cacheManagerSettings.DefaultCacheManager) as CacheManagerNode;
        }
Пример #4
0
 /// <summary>
 /// Creates a default <see cref="CacheManagerCollectionNode"/> when this node is sited.
 /// </summary>
 protected override void OnSited()
 {
     base.OnSited();
     Site.Name = SR.DefaultCacheManagerSettingsNodeName;
     if ((cacheManagerSettings.CacheManagers != null) && (cacheManagerSettings.CacheManagers.Count > 0))
     {
         CacheManagerCollectionNode node = new CacheManagerCollectionNode(cacheManagerSettings.CacheManagers);
         Nodes.Add(node);
     }
 }
        /// <summary>
        /// <para>Adds the <see cref="CacheManagerSettingsNode"/> to the current application with a default <see cref="CacheManagerNode"/>.</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);
            CacheManagerSettingsNode node = ChildNode as CacheManagerSettingsNode;
            Debug.Assert(null != node, "The added node should be a CacheManagerSettingsNode");

            CacheManagerCollectionNode cacheManagerCollectionNode = new CacheManagerCollectionNode();
            node.AddNode(cacheManagerCollectionNode);
            int defaultNodeIdx = cacheManagerCollectionNode.AddNode(new CacheManagerNode());
            node.DefaultCacheManager = (CacheManagerNode)cacheManagerCollectionNode.Nodes[defaultNodeIdx];
        }
        private void CreateCacheManagerNode(CacheManagerCollectionNode node, CacheManagerData cacheManagerData)
        {
            CacheManagerNode cacheManagerNode = new CacheManagerNode(cacheManagerData);

            node.AddNode(cacheManagerNode);
            if (cacheManagerNode.Name == cacheManagerSettings.DefaultCacheManager)
            {
                defaultNode = cacheManagerNode;
            }
            CreateStorageNode(cacheManagerNode, cacheManagerData.CacheStorage);
        }
		public CacheManagerSettingsNode Build()
		{
			CacheManagerSettingsNode rootNode = new CacheManagerSettingsNode();
			CacheManagerCollectionNode node = new CacheManagerCollectionNode();
			foreach (CacheManagerData data in cacheManagerSettings.CacheManagers)
			{
				CreateCacheManagerNode(node, data);
			}			
			rootNode.AddNode(node);
			rootNode.DefaultCacheManager = defaultNode;
			return rootNode;
		}
        public CacheManagerSettingsNode Build()
        {
            CacheManagerSettingsNode   rootNode = new CacheManagerSettingsNode();
            CacheManagerCollectionNode node     = new CacheManagerCollectionNode();

            foreach (CacheManagerData data in cacheManagerSettings.CacheManagers)
            {
                CreateCacheManagerNode(node, data);
            }
            rootNode.AddNode(node);
            rootNode.DefaultCacheManager = defaultNode;
            return(rootNode);
        }
Пример #9
0
        /// <summary>
        /// <para>Adds the <see cref="CacheManagerSettingsNode"/> to the current application with a default <see cref="CacheManagerNode"/>.</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);
            CacheManagerSettingsNode node = ChildNode as CacheManagerSettingsNode;

            Debug.Assert(null != node, "The added node should be a CacheManagerSettingsNode");

            CacheManagerCollectionNode cacheManagerCollectionNode = new CacheManagerCollectionNode();

            node.AddNode(cacheManagerCollectionNode);
            int defaultNodeIdx = cacheManagerCollectionNode.AddNode(new CacheManagerNode());

            node.DefaultCacheManager = (CacheManagerNode)cacheManagerCollectionNode.Nodes[defaultNodeIdx];
        }
Пример #10
0
 /// <summary>
 /// Creates a default <see cref="CacheManagerCollectionNode"/> when this node is sited.
 /// </summary>
 protected override void OnSited()
 {
     base.OnSited();
     Site.Name = SR.DefaultCacheManagerSettingsNodeName;
     if ((cacheManagerSettings.CacheManagers != null) && (cacheManagerSettings.CacheManagers.Count > 0))
     {
         CacheManagerCollectionNode node = new CacheManagerCollectionNode(cacheManagerSettings.CacheManagers);
         Nodes.Add(node);
     }
 }
Пример #11
0
 /// <summary>
 /// Adds default nodes for managers and storages.
 /// </summary>
 protected override void AddDefaultChildNodes()
 {
     base.AddDefaultChildNodes();
     CacheManagerCollectionNode node = new CacheManagerCollectionNode(this.cacheManagerSettings.CacheManagers);
     Nodes.AddWithDefaultChildren(node);
 }