30
using System.Collections.Generic;
30
31
using MonoDevelop.Core.Gui.Dialogs;
31
32
using MonoDevelop.Projects;
32
33
using MonoDevelop.Core;
34
35
namespace MonoDevelop.Projects.Gui.Dialogs.OptionPanels
36
internal class CustomCommandPanel: AbstractOptionPanel
37
internal class CustomCommandPanel: MultiConfigItemOptionsPanel
38
AbstractConfiguration configuration;
39
CustomCommandCollection commands;
41
public override void LoadPanelContents ()
43
Properties props = (Properties) CustomizationObject;
44
configuration = props.Get<AbstractConfiguration> ("Config");
45
if (configuration != null) {
46
CombineEntry entry = props.Get<CombineEntry> ("CombineEntry");
47
commands = configuration.CustomCommands.Clone ();
48
Add (new CustomCommandPanelWidget (entry, commands));
39
CustomCommandPanelWidget widget;
41
public override Gtk.Widget CreatePanelWidget ()
43
return (widget = new CustomCommandPanelWidget ());
46
public override void LoadConfigData ()
48
widget.Load (ConfiguredSolutionItem, CurrentConfiguration.CustomCommands);
52
public override bool StorePanelContents ()
51
public override void ApplyChanges ()
54
if (configuration != null) {
55
configuration.CustomCommands.CopyFrom (commands);
56
// Remove empty commands
57
for (int n=0; n<configuration.CustomCommands.Count; n++) {
58
if (configuration.CustomCommands [n].Command == "") {
59
configuration.CustomCommands.RemoveAt (n);
53
// Do nothing. Changes to cloned configurations are automatically applied.