Example #1
0
        bool IDecisionTree.LoadDomainTemplate(IRootNode rootNode)
        {
            IPersistence persistence = Persistence.Clone(rootNode.DomainTemplate);

            if (persistence != null)
            {
                IDecisionTree subTree = IDecisionTreeInterface.Clone();

                IBaseNode variables = subTree.LoadVariables(persistence);
                IDecisionTreeInterface.ImportVariables(variables);

                return(true);
            }

            return(false);
        }
Example #2
0
        private void RootNode_NodeLoaded(object sender, EventArgs e)
        {
            IBaseNode node = sender as IBaseNode;

            if (node != null && node.NodeType == eNodeType.VariableDefinitions)
            {
                if (Persistence != null)
                {
                    int i = 0;
                    while (i < SubModels.Keys.Count)
                    {
                        IPersistence persistence = getSubModel(i);

                        if (persistence != null)
                        {
                            IDecisionTree subTree = IDecisionTreeInterface.Clone();

                            IBaseNode variables = subTree.LoadVariables(persistence);
                            foreach (IBaseNode subModel in subTree.SubModels.Keys)
                            {
                                IDecisionTreeInterface.AddSubModel(subModel as IDomainObject);
                            }

                            IBaseNode baseNode = SubModels.Keys.ElementAt(i);

                            List <IBaseNode> linkedVariables = LinkVariables(node, variables);
                            foreach (IBaseNode linkedNode in linkedVariables)
                            {
                                baseNode.AddNode(linkedNode);
                            }
                        }

                        i++;
                    }
                }
            }
        }