Beispiel #1
0
        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            Settings.Default.LastOpenedDirectory = ResourceLoader.OpenedPath ?? string.Empty;

            switch (WindowState)
            {
            case FormWindowState.Normal:
                Settings.Default.WindowLocation = Location;
                Settings.Default.WindowSize     = Size;
                Settings.Default.WindowState    = WindowState;
                break;

            case FormWindowState.Maximized:
                Settings.Default.WindowState = WindowState;
                break;
            }

            Settings.Default.SplitterLeft = splitContainerLeft.SplitterDistance;
            Settings.Default.SplitterMain = splitContainerMain.SplitterDistance;

            Settings.Default.Save();

            if (!ResourceLoader.CanClose())
            {
                e.Cancel = true;
            }
        }
Beispiel #2
0
        private void closeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!ResourceLoader.CanClose())
            {
                return;
            }

            ResourceLoader.Close();
        }
Beispiel #3
0
        private void LoadResourcesFromFolder(string path)
        {
            if (!ResourceLoader.CanClose())
            {
                return;
            }

            Enabled = false;
            toolStripStatusLabel1.Text = string.Format(Localization.LoadProgress_OpeningDirectory, path);
            Application.DoEvents();

            ResourceLoader.OpenProject(path);

            Enabled = true;
        }
Beispiel #4
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!ResourceLoader.CanClose())
            {
                return;
            }

            var folderDialog = new FolderBrowserDialog
            {
                SelectedPath = Settings.Default.LastOpenedDirectory,
                Description  = Localization.MainWindow_OpenDirectory_Description
            };

            if (folderDialog.ShowDialog(this) == DialogResult.OK)
            {
                CurrentResource = null;
                Application.DoEvents();
                LoadResourcesFromFolder(folderDialog.SelectedPath);
            }
        }
Beispiel #5
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!ResourceLoader.CanClose())
            {
                return;
            }

            var folderDialog = new FolderBrowserDialog
            {
                SelectedPath = Settings.Default.LastOpenedDirectory,
                Description  = "Browse to the root of the project, typically where the sln file is."
            };

            if (folderDialog.ShowDialog(this) == DialogResult.OK)
            {
                CurrentResource = null;
                Application.DoEvents();
                LoadResourcesFromFolder(folderDialog.SelectedPath);
            }
        }