public void SelectViewBy(ViewBy viewBy) { switch (viewBy) { case ViewBy.Calendar: UIUtil.DefaultProvider.WaitForDisplayAndClick("viewList_0", LocateBy.Id); break; case ViewBy.Location: UIUtil.DefaultProvider.WaitForDisplayAndClick("viewList_1", LocateBy.Id); break; case ViewBy.Month: UIUtil.DefaultProvider.WaitForDisplayAndClick("viewList_2", LocateBy.Id); break; case ViewBy.Day: UIUtil.DefaultProvider.WaitForDisplayAndClick("viewList_3", LocateBy.Id); break; case ViewBy.Category: UIUtil.DefaultProvider.WaitForDisplayAndClick("viewList_4", LocateBy.Id); break; default: break; } }
public Form2(LinkedQuestion question, ViewBy view) { InitializeComponent(); TreeNode root = new TreeNode(question.VarName.FullVarName); if (view == ViewBy.Routing) { AddChildren(question, root); } else if (view == ViewBy.Filters) { AddFilters(question, root); } root.Expand(); treeView1.Nodes.Add(root); }
public ItemInfo(object obj, ViewBy type) { itemObj = obj; itemType = type; switch (type) { case ViewBy.Workset: Workset workset = obj as Workset; if (null != workset) { itemName = workset.Name; itemId = workset.Id.IntegerValue; } break; case ViewBy.Phase: Phase phase = obj as Phase; if (null != phase) { itemName = phase.Name; itemId = phase.Id.IntegerValue; } break; case ViewBy.DesignOption: DesignOption designOption = obj as DesignOption; if (null != designOption) { itemName = designOption.Name; itemId = designOption.Id.IntegerValue; } break; case ViewBy.Link: RevitLinkType linktype = obj as RevitLinkType; if (null != linktype) { itemName = linktype.Name; itemId = linktype.Id.IntegerValue; } break; } }
private void DisplaySourceItems() { try { int index = comboBoxViewBy.SelectedIndex; if (index > -1) { string selectedViewBy = viewByList[index]; ViewBy selectedType = ViewBy.None; switch (selectedViewBy) { case "Workset": selectedType = ViewBy.Workset; break; case "Phase": selectedType = ViewBy.Phase; break; case "Design Options": selectedType = ViewBy.DesignOption; break; case "RVT Links": radioButton3D.IsChecked = true; selectedType = ViewBy.Link; break; } listBoxItems.ItemsSource = null; var sources = from item in sourceItems where item.ItemType == selectedType select item; if (sources.Count() > 0) { selectedItems = new ObservableCollection <ItemInfo>(sources); listBoxItems.ItemsSource = selectedItems; } } } catch (Exception ex) { MessageBox.Show("Failed to display source items\n" + ex.Message, "Display Source Items", MessageBoxButton.OK, MessageBoxImage.Warning); } }