/// <summary> /// Edit the project's API filter /// </summary> /// <param name="sender">The sender of the event</param> /// <param name="e">The event arguments</param> private void btnEditAPIFilter_Click(object sender, RoutedEventArgs e) { var args = new ApplyChangesEventArgs(); this.ApplyChanges?.Invoke(this, args); if (args.ChangesApplied) { string oldFilter, newFilter; var dlg = new ApiFilterEditorDlg(apiFilter); oldFilter = apiFilter.ToXml(); dlg.ShowModalDialog(); newFilter = apiFilter.ToXml(); // If it changes, mark the page as dirty and update the summary info if (oldFilter != newFilter) { this.PropertyChanged?.Invoke(this, EventArgs.Empty); this.ApiFilterHasChanges = true; this.UpdateApiFilterInfo(); } } }
/// <summary> /// Edit the project's API filter /// </summary> /// <param name="sender">The sender of the event</param> /// <param name="e">The event arguments</param> private void btnEditAPIFilter_Click(object sender, EventArgs e) { #if !STANDALONEGUI if (this.ProjectMgr == null) { return; } // Apply any pending visibility changes first if (this.IsDirty && ((IPropertyPage)this).Apply() != VSConstants.S_OK) { return; } // Create an API filter collection that we can edit ApiFilterCollection filter = new ApiFilterCollection { Project = ((SandcastleBuilderProjectNode)this.ProjectMgr).SandcastleProject }; #else if (base.CurrentProject == null) { return; } // Apply any pending visibility changes first if (this.IsDirty && !this.Apply()) { return; } // Create an API filter collection that we can edit ApiFilterCollection filter = new ApiFilterCollection { Project = base.CurrentProject }; #endif filter.FromXml(apiFilter); using (ApiFilterEditorDlg dlg = new ApiFilterEditorDlg(filter)) { dlg.ShowDialog(); string newFilter = filter.ToXml(); // If it changes, mark the page as dirty and update the local copy of the filter if (apiFilter != newFilter) { apiFilter = newFilter; this.IsDirty = filterChanged = true; this.UpdateApiFilterInfo(); } } }