Пример #1
0
        public static List <Level> LetUserPickLevels(Document doc, RevitObjectManager rom)
        {
            var levelSelector = new LevelSelectorHost();

            levelSelector.InitializeLevelListBox(rom.GetAllLevels(doc));
            // clear list from previous selection in case of exporting multiple times
            SelectedLevels.Clear();
            levelSelector.ShowDialog();

            // Levels were added by the dialog
            return(SelectedLevels);
        }
Пример #2
0
        private static KeyValuePair <Result, Level> OpenLevelSelector(List <Level> levels)
        {
            var levelSelectorDialog = new LevelSelectorHost();

            levelSelectorDialog.InitializeLevelListBox(levels);

            // reset from previous plugin execution
            LevelSelectedByUser = null;

            levelSelectorDialog.ShowDialog();

            if (LevelSelectedByUser == null)
            {
                PromtService.ShowInformationToUser("Operation cancelled by User.");
                return(new KeyValuePair <Result, Level>(Result.Cancelled, null));
            }

            return(new KeyValuePair <Result, Level>(Result.Succeeded, LevelSelectedByUser));
        }
Пример #3
0
 public LevelSelectorViewModel(LevelSelectorHost hostRef, List <Level> levels)
 {
     _hostRef = hostRef;
     InitializeLevelListBox(levels);
 }