Пример #1
0
        private void InitFolderPath(FileDialog dialog, FilterIndex filterIndex)
        {
            var folderPath = string.Empty;

            if (!string.IsNullOrWhiteSpace(dialog.FileName))
            {
                folderPath = Path.GetDirectoryName(dialog.FileName);
            }
            if (string.IsNullOrWhiteSpace(folderPath))
            {
                dialog.InitialDirectory = AppController.GetDefaultFolder(filterIndex);
            }
        }
Пример #2
0
 private SceneController GetNewSceneController()
 {
     if (AppController.Options.OpenInNewWindow)
     {
         return(AppController.AddNewSceneController());
     }
     if (!JsonController.SaveIfModified())
     {
         return(null);
     }
     JsonController.Clear();
     return(this);
 }
Пример #3
0
 private void ConnectAll(bool connect)
 {
     if (connect)
     {
         ConnectEventHandlers(true);
         ConnectControllers(true);
         CommandProcessor.Clear();
         Clock.Tick += Clock_Tick;
         ClockStartup();
     }
     else
     {
         ClockShutdown();
         Clock.Tick -= Clock_Tick;
         RenderController.InvalidateProgram();
         CommandProcessor.Clear();
         ConnectControllers(false);
         ConnectEventHandlers(false);
         AppController.Remove(this);
     }
 }
Пример #4
0
 private void FileExit_Click(object sender, EventArgs e) => AppController.Close();