protected override void SwapAssignmentOnSlot(uint slotId) { // Swap inputLines adn outputLines VariableLine variableLine = this.inputLines; this.inputLines = this.outputLines; this.outputLines = variableLine; // Update variable mapping RuntimeStates runtimeStates = graphController.GetRuntimeStates(); runtimeStates.UpdateVariablesDefinedInNode(this, false); }
private void UpdateInternalData(bool calledFromConstructor) { if (false != calledFromConstructor) { string tempVariable = this.graphController.GetRuntimeStates().GenerateTempVariable(uint.MaxValue); this.inputLines = new VariableLine(this.Caption, 0); this.outputLines = new VariableLine(tempVariable, 0); } else { // Fix: IDE-1899 Rename identifier node displays warning and clears preview value. // This method is called at the end of a node-edit operation. For identifier node // the user is allowed only to rename the Caption of the node, which can either be // in "inputLines" (e.g. "t1 = Var1") or the "outputLines" (e.g. "Var1 = t1"), // depending on the connection of the input slot. Here we figure out where the // "Caption" resides and update the variable name accordingly. // bool inputIsTemp = Utilities.IsTempVariable(inputLines.variable); bool outputIsTemp = Utilities.IsTempVariable(outputLines.variable); if (!(inputIsTemp ^ outputIsTemp)) { throw new InvalidOperationException("Either input or output can/must be temp (BBC71AACEE95)!"); } if (false == inputIsTemp) // "inputLines" has the "Caption". { inputLines.variable = this.Caption; } else // "outputLines" has the "Caption". { outputLines.variable = this.Caption; } // Update variable mapping RuntimeStates runtimeStates = graphController.GetRuntimeStates(); runtimeStates.UpdateVariablesDefinedInNode(this, false); } }