コード例 #1
0
 public PlateFilletVertexType()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #2
0
        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 });
        }
コード例 #3
0
        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();
            }
        }
コード例 #4
0
 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();
 }
コード例 #5
0
ファイル: String.cs プロジェクト: zjloscar/Dynamo
 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();
 }
コード例 #6
0
ファイル: Component.cs プロジェクト: andrepesi/fbp
 protected void ValidateInputPortName(string portName)
 {
     if (!InPorts.ContainsKey(portName))
     {
         throw new ArgumentException(string.Format("There is no in port named '{0}.{1}'", Name, portName));
     }
 }
コード例 #7
0
 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();
 }
コード例 #8
0
ファイル: JsonObjectUI.cs プロジェクト: chuongmep/JsonData
 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;
 }
コード例 #9
0
ファイル: JsonObjectUI.cs プロジェクト: chuongmep/JsonData
 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)));
 }
コード例 #10
0
ファイル: JsonObjectUI.cs プロジェクト: chuongmep/JsonData
 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;
 }
コード例 #11
0
ファイル: JsonObjectUI.cs プロジェクト: chuongmep/JsonData
 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;
 }
コード例 #12
0
 public ASPropertiesIsolatedFooting()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #13
0
 public ASPropertiesBeamPolylineNotchFeatures()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #14
0
ファイル: RevitDropDown.cs プロジェクト: Jamesbdsas/DynamoDS
        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();
        }
コード例 #15
0
        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();
        }
コード例 #16
0
 public ASSelectObjecTypes()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #17
0
 public ASPropertiesBeamCutPlaneFeatures()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #18
0
 public AnchorOrientationType()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #19
0
 public ASPropertiesUnfoldedBeam()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #20
0
ファイル: Elements.cs プロジェクト: Revitcivil/DynamoRevit
        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();
        }
コード例 #21
0
 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();
 }
コード例 #22
0
ファイル: Elements.cs プロジェクト: Revitcivil/DynamoRevit
        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();
        }
コード例 #23
0
 public WeldConnectionType()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #24
0
ファイル: Elements.cs プロジェクト: Revitcivil/DynamoRevit
        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();
        }
コード例 #25
0
ファイル: String.cs プロジェクト: zjloscar/Dynamo
 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();
 }
コード例 #26
0
ファイル: Elements.cs プロジェクト: Revitcivil/DynamoRevit
        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();
        }
コード例 #27
0
        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);
        }
コード例 #28
0
 public ASPropertiesStraightBeam()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #29
0
 //AdvanceSteel.Nodes.Properties
 public ASPropertiesHoles()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #30
0
 //AdvanceSteel.Nodes.Properties
 public CircleScrewBoltPattern()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }