public void AddLine(String LineName, Model.TrickerStarNodeSoltDetail from, Model.TrickerStarNodeSoltDetail to) { Model.TrickerStarLineModel line = new TrickerStarLineModel() { LineName = LineName, From = from, To = to }; TrickerStarFunctionNodeModel node_from_m = (TrickerStarFunctionNodeModel)m_FunctionNodeModels[line.From.NodeName]; TrickerStarFunctionNodeModel node_to_m = (TrickerStarFunctionNodeModel)m_FunctionNodeModels[line.To.NodeName]; DeleteLine(node_from_m.OutputSlot[from.SlotIndex].LineName); DeleteLine(node_to_m.InputSlot[to.SlotIndex].LineName); node_from_m.OutputSlot[from.SlotIndex].LineName = line.LineName; node_to_m.InputSlot[to.SlotIndex].LineName = line.LineName; line.From = node_from_m.OutputSlot[from.SlotIndex]; line.To = node_to_m.InputSlot[to.SlotIndex]; var geo = GenPathGeomentry(from, to); var path = GenPath(line.LineName, geo); m_FunctionNodeModels[line.From.NodeName] = node_from_m; m_FunctionNodeModels[line.To.NodeName] = node_to_m; m_FunctionLineModels[line.LineName] = line; m_FunctionLineViews[line.LineName] = path; C_MAIN_CANVAS.Children.Add(path); }
public void AddLine(Model.TrickerStarNodeSoltDetail from, Model.TrickerStarNodeSoltDetail to) { Model.TrickerStarLineModel line = new TrickerStarLineModel() { LineName = "LINE" + Model.TrickerStarDataModel.RandToken(), From = from, To = to }; AddLine(line.LineName, from, to); }