예제 #1
0
        private void AddToNewPreset()
        {
            if (Mod.IsInOriginalInstallation())
            {
                MessageBox.Show("This mod cannot be added to a preset, as it is part of the core of Cortex Command.", "Notice", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                return;
            }

            var addPresetWindow = new AddPresetWindow();

            addPresetWindow.Owner = Global.MainWindow;
            addPresetWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;

            var result = (bool)addPresetWindow.ShowDialog();

            if (result)
            {
                var presetName = addPresetWindow.PresetName;
                var preset     = new Preset(presetName, Mod.IsEnabled);
                preset.Add(Mod);
                presetManager.SavePreset(preset);

                if (OnAddedToPreset != null)
                {
                    OnAddedToPreset(preset);
                }
            }
        }
        private void AddToNewPreset()
        {
            if (Mod.IsInOriginalInstallation())
            {
                MessageBox.Show("This mod cannot be added to a preset, as it is part of the core of Cortex Command.", "Notice", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                return;
            }

            var addPresetWindow = new AddPresetWindow();
            addPresetWindow.Owner = Global.MainWindow;
            addPresetWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;

            var result = (bool)addPresetWindow.ShowDialog();

            if (result)
            {
                var presetName = addPresetWindow.PresetName;
                var preset = new Preset(presetName, Mod.IsEnabled);
                preset.Add(Mod);
                presetManager.SavePreset(preset);

                if (OnAddedToPreset != null)
                    OnAddedToPreset(preset);
            }
        }