/// <summary> /// Updates this Custom Node's data to match its Definition. /// </summary> public void ResyncWithDefinition() { DisableReporting(); if (Definition.Parameters != null) { InPortData.Clear(); foreach (string arg in Definition.Parameters) { InPortData.Add(new PortData(arg, "parameter")); } } OutPortData.Clear(); if (Definition.ReturnKeys != null && Definition.ReturnKeys.Any()) { foreach (string key in Definition.ReturnKeys) { OutPortData.Add(new PortData(key, "return value")); } } else { OutPortData.Add(new PortData("", "return value")); } RegisterAllPorts(); NickName = Definition.DisplayName; EnableReporting(); }
protected override void DeserializeCore(XmlElement element, SaveContext context) { InPortData.Clear(); // In/out ports are going to be recreated in OutPortData.Clear(); // LoadNode, clear them so they don't accumulate. base.DeserializeCore(element, context); this.LoadNode(element); }
/// <summary> /// Creates the inport and outport data based on /// the statements generated from the user code. /// </summary> /// private void CreateInputOutputPorts() { InPortData.Clear(); OutPortData.Clear(); if (codeStatements == null || (codeStatements.Count == 0)) { RegisterAllPorts(); return; } SetInputPorts(); SetOutputPorts(); RegisterAllPorts(); }
private void UpdatePorts() { InPortData.Clear(); for (int input = 0; input < InputCount; input++) { var name = string.Format("Port {0}", input + 1); InPortData.Add(new PortData(name, "")); } OutPortData.Clear(); for (int output = 0; output < OutputCount; output++) { var name = string.Format("Port {0}", output + 1); OutPortData.Add(new PortData(name, "")); } RegisterAllPorts(); }