Example #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);
            }
        }
Example #2
0
 private SceneController GetNewSceneController()
 {
     if (AppController.Options.OpenInNewWindow)
     {
         return(AppController.AddNewSceneController());
     }
     if (!JsonController.SaveIfModified())
     {
         return(null);
     }
     JsonController.Clear();
     return(this);
 }
Example #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);
     }
 }
Example #4
0
 private void FileExit_Click(object sender, EventArgs e) => AppController.Close();