public PlateFilletVertexType() : base(outputName) { InPorts.Clear(); OutPorts.Clear(); RegisterAllPorts(); }
internal override IEnumerable <AssociativeNode> BuildAst(List <AssociativeNode> inputAstNodes, CompilationContext context) { var paramDict = InPorts.Select(x => x.Name) .Zip <string, AssociativeNode, Tuple <string, AssociativeNode> >(inputAstNodes, Tuple.Create) .ToDictionary(x => x.Item1, x => x.Item2); AssociativeNode rhs; if (null == _parsed) { rhs = AstFactory.BuildNullNode(); } else { List <AssociativeNode> newInputs = _parsed.Count == 1 ? new List <AssociativeNode> { _parsed[0].GetAstNode(paramDict) } : _parsed.Select(x => x.GetAstNode(paramDict)).ToList(); rhs = newInputs.Count == 1 ? newInputs[0] : AstFactory.BuildExprList(newInputs); } var assignment = AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), rhs); return(new[] { assignment }); }
private void inports_collectionChanged(object sender, NotifyCollectionChangedEventArgs e) { //The visual height of the node is bound to preferred height. //PreferredHeight = Math.Max(inPorts.Count * 20 + 10, outPorts.Count * 20 + 10); //spacing for inputs + title space + bottom space if (e.Action == NotifyCollectionChangedAction.Add) { //create a new port view model foreach (var item in e.NewItems) { PortViewModel inportViewModel = SubscribePortEvents(item as PortModel); InPorts.Add(inportViewModel); } } else if (e.Action == NotifyCollectionChangedAction.Remove) { //remove the port view model whose model item //is the one passed in foreach (var item in e.OldItems) { PortViewModel portToRemove = UnSubscribePortEvents(InPorts.ToList().First(x => x.PortModel == item));; InPorts.Remove(portToRemove); portToRemove.Dispose(); } } else if (e.Action == NotifyCollectionChangedAction.Reset) { foreach (var p in InPorts) { UnSubscribePortEvents(p); p.Dispose(); } InPorts.Clear(); } }
public ComposeFunctions() { InPorts.Add(new PortModel(PortType.Input, this, new PortData("function0", Resources.ComposePortDataFunc0ToolTip))); InPorts.Add(new PortModel(PortType.Input, this, new PortData("function1", Resources.ComposePortDataFunc1ToolTip))); OutPorts.Add(new PortModel(PortType.Output, this, new PortData("function", Resources.ComposePortDataResultToolTip))); RegisterAllPorts(); }
public FromArray() : base("__ToStringFromArray") { ArgumentLacing = LacingStrategy.Disabled; InPorts.Add(new PortModel(PortType.Input, this, new PortData("arr", Resources.FromArrayPortDataArrayToolTip))); OutPorts.Add(new PortModel(PortType.Output, this, new PortData("str", Resources.FromArrayPortDataResultToolTip))); RegisterAllPorts(); }
protected void ValidateInputPortName(string portName) { if (!InPorts.ContainsKey(portName)) { throw new ArgumentException(string.Format("There is no in port named '{0}.{1}'", Name, portName)); } }
public DirectoryObject() : base(DSCore.IO.FileSystem.DirectoryFromPath) { InPorts.Add(new PortModel(PortType.Input, this, new PortData("path", Resources.DirectoryObjectPortDataPathToolTip))); OutPorts.Add(new PortModel(PortType.Output, this, new PortData("directory", Resources.DirectoryObjectPortDataResultToolTip))); RegisterAllPorts(); }
public Merge() : base() { InPorts.Add(new PortModel(PortType.Input, this, new PortData("jsonObject", "Main JsonObject"))); InPorts.Add(new PortModel(PortType.Input, this, new PortData("others", "JsonObject(s) to merge to main."))); OutPorts.Add(new PortModel(PortType.Output, this, new PortData("jsonObject", Properties.Resources.JsonObject_Json_Get))); this.NeedsNesting = false; }
public Add() : base() { InPorts.Add(new PortModel(PortType.Input, this, new PortData("jsonObject", "JsonObject to which add properties."))); InPorts.Add(new PortModel(PortType.Input, this, new PortData("keys", Properties.Resources.JsonObject_Keys_Set))); InPorts.Add(new PortModel(PortType.Input, this, new PortData("values", Properties.Resources.JsonObject_Values_Set))); OutPorts.Add(new PortModel(PortType.Output, this, new PortData("jsonObject", Properties.Resources.JsonObject_Json_Get))); }
public Remove() : base() { InPorts.Add(new PortModel(PortType.Input, this, new PortData("jsonObject", "JsonObject"))); InPorts.Add(new PortModel(PortType.Input, this, new PortData("keys", "Key(s) to remove from JsonObject"))); OutPorts.Add(new PortModel(PortType.Output, this, new PortData("jsonObject", Properties.Resources.JsonObject_Json_Get))); this.NeedsOptions = false; }
public GetValueByKey() : base() { InPorts.Add(new PortModel(PortType.Input, this, new PortData("jsonObject", "JsonObject"))); InPorts.Add(new PortModel(PortType.Input, this, new PortData("keys", "Key(s) to query."))); OutPorts.Add(new PortModel(PortType.Output, this, new PortData("value", "Value associated to input key."))); this.NeedsOptions = false; }
public ASPropertiesIsolatedFooting() : base(outputName) { InPorts.Clear(); OutPorts.Clear(); RegisterAllPorts(); }
public ASPropertiesBeamPolylineNotchFeatures() : base(outputName) { InPorts.Clear(); OutPorts.Clear(); RegisterAllPorts(); }
void OnPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName != "CachedValue") { return; } if (InPorts.Any(x => x.Connectors.Count == 0)) { Items.Clear(); //The input is not connected, so clear the list. return; } var oldElement = element; element = GetInputElement(); if (element == null) { Items.Clear(); return; } if (oldElement != null && oldElement.Id == element.Id) { return; } PopulateItems(); }
private void UpdatePorts() { var guids = InPorts.Select(x => x.GUID).ToArray(); InPorts.Clear(); for (int input = 0; input < InputCount; input++) { var name = $"Port {input + 1}"; var pm = new PortModel(PortType.Input, this, new PortData(name, "")); InPorts.Add(pm); if (guids.Length == InputCount) { pm.GUID = guids[input]; } } guids = OutPorts.Select(x => x.GUID).ToArray(); OutPorts.Clear(); for (int output = 0; output < OutputCount; output++) { var name = $"Port {output + 1}"; var pm = new PortModel(PortType.Output, this, new PortData(name, "")); OutPorts.Add(pm); if (guids.Length == OutputCount) { pm.GUID = guids[output]; } } RegisterAllPorts(); }
public ASSelectObjecTypes() : base(outputName) { InPorts.Clear(); OutPorts.Clear(); RegisterAllPorts(); }
public ASPropertiesBeamCutPlaneFeatures() : base(outputName) { InPorts.Clear(); OutPorts.Clear(); RegisterAllPorts(); }
public AnchorOrientationType() : base(outputName) { InPorts.Clear(); OutPorts.Clear(); RegisterAllPorts(); }
public ASPropertiesUnfoldedBeam() : base(outputName) { InPorts.Clear(); OutPorts.Clear(); RegisterAllPorts(); }
public ElementsOfCategory() { InPorts.Add(new PortModel(PortType.Input, this, new PortData("Category", Properties.Resources.PortDataCategoryToolTip))); OutPorts.Add(new PortModel(PortType.Output, this, new PortData("Elements", Properties.Resources.PortDataElementTypeToolTip))); RegisterAllPorts(); }
public ApplyFunction() : base() { InPorts.Add(new PortModel(PortType.Input, this, new PortData("function", Resources.ApplyPortDataFuncToolTip))); OutPorts.Add(new PortModel(PortType.Output, this, new PortData("result", Resources.ApplyPortDataFuncArgToolTip))); AddInput(); RegisterAllPorts(); }
public ElementsAtLevel() { InPorts.Add(new PortModel(PortType.Input, this, new PortData("Level", Properties.Resources.PortDataALevelToolTip))); OutPorts.Add(new PortModel(PortType.Output, this, new PortData("Elements", Properties.Resources.PortDataElementAtLevelToolTip))); RegisterAllPorts(); }
public WeldConnectionType() : base(outputName) { InPorts.Clear(); OutPorts.Clear(); RegisterAllPorts(); }
public ElementById() { InPorts.Add(new PortModel(PortType.Input, this, new PortData("Id", Properties.Resources.PortDataByElementId))); OutPorts.Add(new PortModel(PortType.Output, this, new PortData("Element", Properties.Resources.PortDataElementsToolTip))); RegisterAllPorts(); }
public FromObject() : base("__ToStringFromObject") { ArgumentLacing = LacingStrategy.Disabled; InPorts.Add(new PortModel(PortType.Input, this, new PortData("obj", Resources.FromObjectPortDataObjToolTip))); OutPorts.Add(new PortModel(PortType.Output, this, new PortData("str", Resources.FormulaPortDataResultToolTip))); RegisterAllPorts(); }
public ElementsOfFamilyType() { InPorts.Add(new PortModel(PortType.Input, this, new PortData("Family Type", Properties.Resources.PortDataFamilTypeToolTip))); OutPorts.Add(new PortModel(PortType.Output, this, new PortData("Elements", Properties.Resources.PortDataElementsToolTip))); RegisterAllPorts(); }
protected override void SerializeCore(XmlElement element, SaveContext context) { base.SerializeCore(element, context); //Base implementation must be called Controller.SerializeCore(element, context); var xmlDoc = element.OwnerDocument; var outEl = xmlDoc.CreateElement("Name"); outEl.SetAttribute("value", Name); element.AppendChild(outEl); outEl = xmlDoc.CreateElement("Description"); outEl.SetAttribute("value", Description); element.AppendChild(outEl); outEl = xmlDoc.CreateElement("Inputs"); foreach (string input in InPorts.Select(x => x.Name)) { XmlElement inputEl = xmlDoc.CreateElement("Input"); inputEl.SetAttribute("value", input); outEl.AppendChild(inputEl); } element.AppendChild(outEl); outEl = xmlDoc.CreateElement("Outputs"); foreach (string output in OutPorts.Select(x => x.Name)) { XmlElement outputEl = xmlDoc.CreateElement("Output"); outputEl.SetAttribute("value", output); outEl.AppendChild(outputEl); } element.AppendChild(outEl); }
public ASPropertiesStraightBeam() : base(outputName) { InPorts.Clear(); OutPorts.Clear(); RegisterAllPorts(); }
//AdvanceSteel.Nodes.Properties public ASPropertiesHoles() : base(outputName) { InPorts.Clear(); OutPorts.Clear(); RegisterAllPorts(); }
//AdvanceSteel.Nodes.Properties public CircleScrewBoltPattern() : base(outputName) { InPorts.Clear(); OutPorts.Clear(); RegisterAllPorts(); }