Ejemplo n.º 1
0
 private void newToolStripMenuItem_Click(object sender, EventArgs e)
 {
     activeScene = new AgnaScene();
     loadAgnaScene();
     tabPanel.Text = "Panel";
     reloadToolStripMenuItem.Enabled = false;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Attempt to open AgnaScene, returns success/failure
        /// </summary>
        /// <param name="filePath"></param>
        /// <returns></returns>
        private bool openAgnaScene(string filePath)
        {
            Cursor.Current = Cursors.WaitCursor;
            AgnaScene newScene = new AgnaScene(filePath);

            if (newScene.Valid)
            {
                activeScene = newScene;
            }
            else
            { /*MessageBox.Show("Invalid AgnaScene!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);*/
            }

            Cursor.Current = Cursors.Default;
            return(newScene.Valid);
        }
Ejemplo n.º 3
0
        private void MainFrm_Load(object sender, EventArgs e)
        {
            //Load settings
            loadSettings();

            //Load most recent file
            if (Settings.RecentFiles.Load && Settings.RecentFiles.MaxFiles > 0 && Settings.RecentFiles.Files.Count > 0 && File.Exists(Settings.RecentFiles.Files[0]) && openAgnaScene(Settings.RecentFiles.Files[0]))
            {
                loadAgnaScene();
                tabPanel.Text = !String.IsNullOrWhiteSpace(activeScene.Name.Value) ? activeScene.Name.Value : $"Panel - {Path.GetFileName(activeScene.FilePath)}";
                reloadToolStripMenuItem.Enabled = true;
            }
            else
            {
                //Default, no recent file
                activeScene = new AgnaScene();
                loadAgnaScene();
            }
        }