public static RakunNodeBase SumbNode(RakunNodeBase c1original, RakunModuleViewModel c2mother) { if (c2mother == null) { return(c1original.Clone() as RakunNodeBase); } RakunNodeBase c1 = c1original.Clone() as RakunNodeBase; RakunNodeBase c2 = c2mother.ModuleInfo.Clone() as RakunNodeBase; //값 대입하기 addbefore(ref c2mother, ref c1); //합성하기 //근데 IF노드일경우 조금 다름 if (c2mother.ModuleInfo.NodeType == RakunNodeBase.RakunNodeType.If) { RakunNodeBase TResualt = new RakunNodeBase(); { //True일경우 RakunModuleViewModel itorNode = c2mother.TrueNode; //연결된 시퀀스가 있으면 while (itorNode != null) { addbefore(ref itorNode, ref TResualt); //다더함 TResualt = (TResualt + itorNode.ModuleInfo).Clone() as RakunNodeBase; addAfter(ref itorNode, ref TResualt); itorNode = itorNode.Next; } } RakunNodeBase FResualt = new RakunNodeBase(); { RakunModuleViewModel itorNode = c2mother.FalseNode; //연결된 시퀀스가 있으면 while (itorNode != null) { addbefore(ref itorNode, ref FResualt); //다더함 FResualt = (FResualt + itorNode.ModuleInfo).Clone() as RakunNodeBase; addAfter(ref itorNode, ref FResualt); itorNode = itorNode.Next; } } RakunNodeIf ifnode = c2 as RakunNodeIf; ifnode.AddIfTrue(TResualt, FResualt); } //값 대입하기 addAfter(ref c2mother, ref c2); return(c1 + c2); }
public RakunModuleViewModel(RakunNodeBase Module, RakunViewerUserControl _View, ModuleView _Root) { ModuleInfo = Module.Clone() as RakunNodeBase; Parent = _View; Root = _Root; if (Module.NodeType == RakunNodeBase.RakunNodeType.For) { _ModuleValues.Add(new RakunValueNodeViewModel(new RakunNode() { NodeName = "index", type = RakunType.ValueName }, Root, _View, this)); } if (Module.NodeType == RakunNodeBase.RakunNodeType.If) { //_ModuleValues.Add(new RakunValueNodeViewModel(new RakunNode() { NodeName = "Condition", type = RakunType.ValueName }, Root, _View, this)); } if (ModuleInfo.rootNode != null) { foreach (RakunNode node in ModuleInfo.rootNode.Rakunlist) { _ModuleValues.Add(new RakunValueNodeViewModel(node, Root, _View, this)); } } }
public override RakunNodeBase Append(RakunNodeBase c1, RakunNodeBase c2) { RakunNodeBase output = (RakunNodeBase)c2.Clone(); return(output); }