Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(nameTextBox.Text))
            {
                GeneralUtil.Error("You must give your VDF a name");
                return;
            }

            if (String.IsNullOrEmpty(pathTextBox.Text))
            {
                GeneralUtil.Error("You must give a save path for the VDF");
                return;
            }

            if (!Directory.Exists(Path.GetDirectoryName(pathTextBox.Text)))
            {
                GeneralUtil.Error("The directory where you'd like to save the VDF doesn't exist");
                return;
            }

            VDF vdf = new VDF(nameTextBox.Text);

            vdf.Save(pathTextBox.Text);

            Editor editor = new Editor(menuForm, recent);

            editor.OpenVDF(vdf);
            editor.SetPath(pathTextBox.Text);
            recent.AddItem(pathTextBox.Text);
            recent.Save();
            menuForm.RefreshRecentItems();
            editor.Show();
            closedByUser = false;
            Close();
        }
Exemple #2
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult result = openFileDialog1.ShowDialog();

            Log.LogInfo("Browsing for VDF to open");
            if (result == DialogResult.OK)
            {
                OpenVDF(openFileDialog1.FileName);
                recentItems.AddItem(openFileDialog1.FileName);
                recentItems.Save();
                menuForm.RefreshRecentItems();
            }
            else
            {
                Log.LogInfo("Browse cancelled");
                return;
            }
        }