예제 #1
0
        private void CreateVersionButton_Click(object sender, EventArgs e)
        {
            string name = PresetNameTextBox.Text;

            if (string.IsNullOrWhiteSpace(name))
            {
                _ = MessageBox.Show("Preset Name not specified.", "Warning");
                return;
            }

            if (ModsToAdd.Count == 0)
            {
                _ = MessageBox.Show("This preset is empty!", "Warning");
                return;
            }

            //Version.Presets.Add(new Preset() { Name = name , Mods = ModsToAdd, Id = Tools.CreateId() });
            Version.Presets.Add(new Preset()
            {
                Name = name, ModPaths = ModsToAdd, Id = Tools.CreateId()
            });

            ReferencePresets.RefreshPresetsDataGridView();
            ReferencePresets.Show();
            Close();
        }
        private void EditVersionButton_Click(object sender, EventArgs e)
        {
            string name = PresetNameTextBox.Text;

            if (string.IsNullOrWhiteSpace(name))
            {
                _ = MessageBox.Show("Preset Name note specified.", "Warning");
                return;
            }

            if (ModsToEdit.Count == 0)
            {
                _ = MessageBox.Show("This preset is empty!", "Warning");
                return;
            }

            PresetToEdit.Name = name;
            //PresetToEdit.Mods = ModsToEdit;
            PresetToEdit.ModPaths = ModsToEdit;

            ReferencePresets.RefreshPresetsDataGridView();
            ReferencePresets.Show();
            Close();
        }