예제 #1
0
        public void BuildTree(LevelInfo defaultSelection = null)
        {
            WorldTree.Items.Clear();

            foreach (var worldInfo in _worldService.AllWorlds())
            {
                WorldTree.Items.Add(BuildTreeViewItem(worldInfo));
            }

            if (defaultSelection != null)
            {
                SetSelectedItem(defaultSelection);
            }
        }
예제 #2
0
        public NewLevelWindow(LevelService levelService, WorldService worldService)
        {
            InitializeComponent();

            _levelService = levelService;
            _worldService = worldService;

            WorldList.ItemsSource = _worldService.AllWorlds();
        }
예제 #3
0
        public MoveLevelWindow(LevelService levelService, WorldService worldService, WorldInfo hostWorld, LevelInfo parentLevel)
        {
            InitializeComponent();

            _levelService       = levelService;
            _worldService       = worldService;
            _defaultParentLevel = parentLevel;

            WorldList.ItemsSource = _worldService.AllWorlds();

            if (parentLevel == null)
            {
                LevelList.SelectedIndex = 0;
            }
            else
            {
                LevelList.SelectedItem = parentLevel;
            }

            if (hostWorld != null)
            {
                WorldList.SelectedItem = hostWorld;
            }
        }