public DSModelElementsByCategorySelection() : base( SelectionType.Many, SelectionObjectType.None, message, prefix) { DropDownNodeModel = new DSRevitNodesUI.Categories(); SelectedIndex = DropDownNodeModel.SelectedIndex; SelectionFilter = new CategoryElementSelectionFilter <Element>(); base.Filter = SelectionFilter; }
public DSModelElementsByCategorySelection(IEnumerable <string> selectionIdentifier, IEnumerable <PortModel> inPorts, IEnumerable <PortModel> outPorts) : base( SelectionType.Many, SelectionObjectType.None, message, prefix, selectionIdentifier, inPorts, outPorts) { DropDownNodeModel = new DSRevitNodesUI.Categories(); SelectionFilter = new CategoryElementSelectionFilter <Element>(); base.Filter = SelectionFilter; }
public void AllCategoriesHasValidValue() { var node = new DSRevitNodesUI.Categories(); Model.AddNodeToCurrentWorkspace(node, false); RunCurrentModel(); int i = 0; foreach (var item in node.Items) { node.SelectedIndex = i++; //Since UI is not loaded, node modification will not be sent automatically. node.MarkNodeAsModified(); RunCurrentModel(); //Node doesn't have any warning or error. Assert.AreEqual(Dynamo.Graph.Nodes.ElementState.Active, node.State); var category = this.GetPreviewValue(node.GUID.ToString()) as Category; Assert.IsNotNull(category); Assert.AreEqual(item.Name, category.Name); } }