public override void Deserialize(OpBranch instruction, ScriptNode node, Deserializer context) { node.EnterPins.Add(new Pin()); var exit = new PinWithConnection("", null); node.ExitPins.Add(exit); var target = context.Deserialize(instruction.TargetLabel.Instruction); if (exit.Connection == null) { exit.Connection = new Connection(target, target.EnterPins[0]); } }
public LinkViewModel(ScriptViewModel script, PositionedViewModelBase from, PositionedViewModelBase to, PinWithConnection pin, bool isExecution) { IsExecution = isExecution; Script = script; HostPin = pin; From = from; To = to; IsExecution = isExecution; PropertyChanged += (s, a) => UpdateState(); MenuItems.Add(new MenuItemViewModel { Header = "Delete", Command = DeleteThis }); }
public override void Deserialize(OpBranchConditional instruction, ScriptNode node, Deserializer context) { node.EnterPins.Add(new Pin()); var trueLabel = new PinWithConnection(nameof(instruction.TrueLabel), null); var falseLabel = new PinWithConnection(nameof(instruction.FalseLabel), null); node.ExitPins.Add(trueLabel); node.ExitPins.Add(falseLabel); var target = context.Deserialize(instruction.TrueLabel.Instruction); if (trueLabel.Connection == null) { trueLabel.Connection = new Connection(target, target.EnterPins[0]); } target = context.Deserialize(instruction.FalseLabel.Instruction); if (falseLabel.Connection == null) { falseLabel.Connection = new Connection(target, target.EnterPins[0]); } }
public override void Deserialize(OpLoopMerge instruction, ScriptNode node, Deserializer context) { node.EnterPins.Add(new Pin()); var mergeBlock = new PinWithConnection(nameof(instruction.MergeBlock), null); var continueTarget = new PinWithConnection(nameof(instruction.ContinueTarget), null); node.ExitPins.Add(mergeBlock); node.ExitPins.Add(continueTarget); var target = context.Deserialize(instruction.MergeBlock.Instruction); if (mergeBlock.Connection == null) { mergeBlock.Connection = new Connection(target, target.EnterPins[0]); } target = context.Deserialize(instruction.ContinueTarget.Instruction); if (continueTarget.Connection == null) { continueTarget.Connection = new Connection(target, target.EnterPins[0]); } }
public ExitPinViewModel(NodeViewModel node, PinWithConnection pin) : base(node, pin) { }