Пример #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            Log.LogInfo("Opening VDF file");
            DialogResult result = openDialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                Log.LogInfo("Opening: " + openDialog.FileName);

                if (!File.Exists(openDialog.FileName))
                {
                    GeneralUtil.Error("File not found.");
                    return;
                }

                Editor editor = new Editor(this, recentItems);
                editor.OpenVDF(openDialog.FileName);
                recentItems.AddItem(openDialog.FileName);
                recentItems.Save();
                RefreshRecentItems();
                editor.Show();
                Hide();
            }
            else
            {
                Log.LogInfo("VDF Opening cancelled");
            }
        }
Пример #2
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();
        }
Пример #3
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;
            }
        }