Beispiel #1
0
        public static void CloseProject()
        {
            if (!TrySave())
            {
                return;
            }

            _project = null;
            _view.ShowLauncherWindow();
        }
Beispiel #2
0
        public static void OpenProject(string filePath)
        {
            var index = _settings.RecentList.FindIndex((obj) => obj.FilePath == filePath);

            if (!File.Exists(filePath))
            {
                if (index != -1)
                {
                    var result = _view.ShowYesNoDialog(
                        "Project Not Found",
                        "Project \"" + Path.GetFileName(filePath) + "\" was not found, do you want to remove it from the recent projects list?"
                        );

                    if (result)
                    {
                        _settings.RecentList.RemoveAt(index);
                        _settings.Save();

                        _view.ReloadRecentList(_settings.RecentList);
                    }
                }

                return;
            }

            _project = GenexProject.Load(filePath);

            if (index == -1)
            {
                _settings.RecentList.Insert(0, new RecentItem(_project.Title, filePath));
                _settings.Save();

                _view.ReloadRecentList(_settings.RecentList);
            }

            _view.ShowMainWindow();
        }