Example #1
0
        /// <summary>
        /// <para>
        /// Add the default child nodes for the current node.
        /// </para>
        /// </summary>
        /// <remarks>
        /// <para>
        /// This will add the default <see cref="DatabaseTypeCollectionNode"/>, <see cref="ConnectionStringCollectionNode"/>, and <see cref="InstanceCollectionNode"/>.
        /// </para>
        /// </remarks>
        protected override void AddDefaultChildNodes()
        {
            base.AddDefaultChildNodes();
            AddDefaultDynamicQueryTypeCollectionNode();
            AddDefaultInstanceNode();
            InstanceCollectionNode nodes = (InstanceCollectionNode)Hierarchy.FindNodeByType(this, typeof(InstanceCollectionNode));

            if (nodes.Nodes.Count > 0)
            {
                this.DefaultInstanceNode = nodes.Nodes[0] as InstanceNode;
            }
        }
Example #2
0
        /// <summary>
        /// <para>After the node is loaded, allows child nodes to resolve references to sibling nodes in configuration.</para>
        /// </summary>
        public override void ResolveNodeReferences()
        {
            base.ResolveNodeReferences();
            InstanceCollectionNode node = Hierarchy.FindNodeByType(this, typeof(InstanceCollectionNode)) as InstanceCollectionNode;

            if (node == null)
            {
                return;
            }
            DefaultInstanceNode = Hierarchy.FindNodeByName(node, dynamicQuerySettings.DefaultInstance) as InstanceNode;
            if (instanceNode == null)
            {
                throw new InvalidOperationException(SR.ExceptionInstanceNodeNotFound(dynamicQuerySettings.DefaultInstance));
            }
        }
Example #3
0
        private void GetInstanceCollectionData()
        {
            InstanceCollectionNode node = Hierarchy.FindNodeByType(typeof(InstanceCollectionNode)) as InstanceCollectionNode;

            if (node == null)
            {
                return;
            }

            InstanceDataCollection data = node.InstanceDataCollection;

            if (Object.ReferenceEquals(dynamicQuerySettings.Instances, data))
            {
                return;
            }

            dynamicQuerySettings.Instances.Clear();
            foreach (InstanceData instanceData in data)
            {
                dynamicQuerySettings.Instances[instanceData.Name] = instanceData;
            }
        }
Example #4
0
        private void AddDefaultInstanceNode()
        {
            InstanceCollectionNode node = new InstanceCollectionNode(dynamicQuerySettings.Instances);

            Nodes.AddWithDefaultChildren(node);
        }