Exemple #1
0
        /// <summary>
        /// Collects the control variables.
        /// </summary>
        /// <param name="collector">The collector.</param>
        /// <param name="controlPathSegment">The control path segment.</param>
        public void CollectControl(TreeIndexCollector collector, ControlPathSegment controlPathSegment)
        {
            int currentCallLevel = collector.GetCurrentCallLevel();
            ContainerCollectorNode controlStackNode = GetOrCreateControlStackNode(collector, currentCallLevel);

            controlStackNode.Collect(collector, controlPathSegment);
            HasRootNode = true;
        }
Exemple #2
0
        /// <summary>
        /// Collects the variable.
        /// </summary>
        /// <param name="collector">The collector.</param>
        /// <param name="variableSegment">The variable segment.</param>
        public void CollectVariable(TreeIndexCollector collector, VariablePathSegment variableSegment)
        {
            int currentCallLevel = collector.GetCurrentCallLevel();
            ContainerCollectorNode variableStackNode = GetOrCreateVariableStackNode(collector, currentCallLevel);

            variableStackNode.Collect(collector, variableSegment);
            HasRootNode = true;
        }
Exemple #3
0
        /// <summary>
        /// Gets the or create object node.
        /// </summary>
        /// <param name="collector">The collector.</param>
        /// <param name="objectValue">The object value.</param>
        /// <returns>Node representing given object</returns>
        public ContainerCollectorNode GetOrCreateObjectNode(TreeIndexCollector collector, ObjectValue objectValue)
        {
            ContainerCollectorNode objectNode;

            if (!ObjectNodes.TryGetValue(objectValue, out objectNode))
            {
                IObjectDescriptor descriptor = collector.Structure.GetDescriptor(objectValue);
                objectNode = new ContainerCollectorNode(descriptor);
                ObjectNodes.Add(objectValue, objectNode);
            }

            return(objectNode);
        }
Exemple #4
0
        /// <summary>
        /// Gets the or create control stack node.
        /// </summary>
        /// <param name="collector">The collector.</param>
        /// <param name="callLevel">The call level.</param>
        /// <returns>Node representing stack context on specified level.</returns>
        public ContainerCollectorNode GetOrCreateControlStackNode(TreeIndexCollector collector, int callLevel)
        {
            ContainerCollectorNode controlStackNode;

            if (!ControlStackNodes.TryGetValue(callLevel, out controlStackNode))
            {
                IReadonlyIndexContainer indexContainer = collector.Structure
                                                         .GetReadonlyStackContext(callLevel).ReadonlyControllVariables;
                controlStackNode = new ContainerCollectorNode(indexContainer);
                ControlStackNodes.Add(callLevel, controlStackNode);
            }

            return(controlStackNode);
        }
Exemple #5
0
        /// <summary>
        /// Gets the or create variable stack node.
        /// </summary>
        /// <param name="collector">The collector.</param>
        /// <param name="callLevel">The call level.</param>
        /// <returns></returns>
        public ContainerCollectorNode GetOrCreateVariableStackNode(TreeIndexCollector collector, int callLevel)
        {
            ContainerCollectorNode variableStackNode;

            if (!VariableStackNodes.TryGetValue(callLevel, out variableStackNode))
            {
                IReadonlyIndexContainer indexContainer = collector.Structure
                                                         .GetReadonlyStackContext(callLevel).ReadonlyVariables;

                variableStackNode = new ContainerCollectorNode(indexContainer);
                VariableStackNodes.Add(callLevel, variableStackNode);
            }

            return(variableStackNode);
        }
Exemple #6
0
        /// <summary>
        /// Collects the object.
        /// </summary>
        /// <param name="collector">The collector.</param>
        /// <param name="objectValue">The object value.</param>
        /// <param name="fieldPathSegment">The field path segment.</param>
        public void CollectObject(TreeIndexCollector collector, ObjectValue objectValue, FieldPathSegment fieldPathSegment)
        {
            ContainerCollectorNode objectNode = GetOrCreateObjectNode(collector, objectValue);

            objectNode.Collect(collector, fieldPathSegment);
        }