public static LoopableLine HookLineOut2(LoopableAutomation auto) { if (Globals.TempFieldLine != null) { Globals.TempFieldLine.Remove(); Globals.TempFieldLine = null; } if (Globals.TempAutomationLine == null) { var f = new LoopableLine(); f.Left = auto; Globals.TempAutomationLine = f; return(f); } else { if (Globals.TempAutomationLine.Left == null && Globals.TempAutomationLine.Right != auto) { var line = new LoopableLine(auto, Globals.TempAutomationLine.Right); Globals.TempAutomationLine.Remove(); Globals.TempAutomationLine = null; return(line); } else { Globals.TempAutomationLine.Remove(); Globals.TempAutomationLine = null; return(HookLineOut2(auto)); } } }
public LoopableLine(LoopableAutomation left, Automation right) { Left = left; Right = right; left.LineOut2 = this; Right.LinesIn.Add(this); }
protected override void OnAfterSerialize() { if (string.IsNullOrEmpty(idLeft)) { Remove(); return; } var automations = Window.GetControls <Automation>(); foreach (var item in automations) { if (Left == null && item.ID == idLeft) { Left = (LoopableAutomation)item; continue; } if (Right == null && item.ID == idRight) { Right = item; continue; } if (Left != null && Right != null) { break; } } if (Left == null || Right == null) { Remove(); return; } Left.LineOut2 = this; Right.LinesIn.Add(this); SortingOrder = ESortingOrder.Line; }