Esempio n. 1
0
        /// <summary>
        /// Adds nodes to the referenced behaviour which represent sub-referenced behaviours.
        /// </summary>
        /// <param name="processedBehaviors">A list of processed behaviours to handle circular references.</param>
        /// <param name="parent">The node the sub-referenced behaviours will be added to.</param>
        /// <param name="node">The current node we are checking.</param>
        protected void GenerateReferencedBehaviorsTree(ProcessedBehaviors processedBehaviors, NodeViewData parent, Node node)
        {
            if (!processedBehaviors.MayProcess(node))
            {
                return;
            }

            // check if this is a referenced behaviour
            if (node is ReferencedBehaviorNode)
            {
                // create the dummy node and add it without marking the behaviour as being modified as these are no REAL nodes.
                NodeViewData rb = node.CreateNodeViewData(parent, _rootBehavior);

#if DEBUG
                rb.IsSubreferencedGraphNode();
#endif

                rb.DoSynchronizeWithNode(processedBehaviors);

                Connector conn = parent.GetConnector("Tasks");
                Debug.Check(conn != null);

                Connector rbconn = parent.GetConnector("Tasks");
                Debug.Check(rbconn != null);

                parent.AddChildNotModified(conn, rb);

                // we have a circular reference here. Skip the children
                if (((ReferencedBehaviorNode)node).Reference == _rootBehavior)
                {
                    rbconn.IsReadOnly = true;

                    return;
                }

                // do the same for all the children
                foreach (Node child in node.Children)
                {
                    GenerateReferencedBehaviorsTree(processedBehaviors.Branch(child), rb, child);
                }

                rbconn.IsReadOnly = true;
            }
            else
            {
                // do the same for all the children
                foreach (Node child in node.Children)
                {
                    GenerateReferencedBehaviorsTree(processedBehaviors.Branch(child), parent, child);
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// This method allows nodes to process the loaded attributes.
        /// </summary>
        /// <param name="processedBehaviors">The behaviours which have already been processed to avoid circular references.</param>
        /// <param name="node">The node which is processed.</param>
        protected void DoPostLoad(ProcessedBehaviors processedBehaviors, Node node)
        {
            if (processedBehaviors.MayProcess(node))
            {
                node.PostLoad(_behavior);

                foreach (Node child in node.Children)
                {
                    DoPostLoad(processedBehaviors.Branch(child), child);
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// This method allows nodes to process the loaded attributes.
        /// </summary>
        /// <param name="processedBehaviors">The behaviours which have already been processed to avoid circular references.</param>
        /// <param name="node">The node which is processed.</param>
        protected void DoPostLoad(ProcessedBehaviors processedBehaviors, Node node) {
            if (processedBehaviors.MayProcess(node)) {
                node.PostLoad(_behavior);

                foreach(Node child in node.Children)
                DoPostLoad(processedBehaviors.Branch(child), child);
            }
        }