private void Settings_Closed(object sender, EventArgs e) { Contract.Requires(sender.GetType() == typeof(GSettings)); GSettings settings = (GSettings)sender; if (!settings.Configuration.Dirty) { return; } _config.Save(); TestList window = GetTestList(); window.DisplayAvaliableTests(settings.Configuration); }
/// <summary> /// This function is the callback used to execute a command when the a menu item is clicked. /// See the Initialize method to see how the menu item is associated to this function using /// the OleMenuCommandService service and the MenuCommand class. /// </summary> private void MenuItemCallback(object sender, EventArgs e) { //our code wasn't loaded to catch the solution opened event?!! if (_config == null) { //ok we can deal lets just fire the event manually to do the initialization SolutionEvents_Opened(); } if (_config == null) { throw new NullReferenceException("Unable to Open Configuration"); } ConfiguredProject project = _config.GetConfiguration(_dte.SelectedItems.Item(1).Project); GSettings settings = new GSettings(project); settings.Closed += Settings_Closed; settings.ShowDialog(); settings.Focus(); }