public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value) { // Get the API filter collection ApiFilterCollection items = value as ApiFilterCollection; if(context == null || provider == null || context.Instance == null || items == null) return base.EditValue(context, provider, value); using(ApiFilterEditorDlg dlg = new ApiFilterEditorDlg(items)) { dlg.ShowDialog(); } return value; }
public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value) { // Get the API filter collection ApiFilterCollection items = value as ApiFilterCollection; if (context == null || provider == null || context.Instance == null || items == null) { return(base.EditValue(context, provider, value)); } using (ApiFilterEditorDlg dlg = new ApiFilterEditorDlg(items)) { dlg.ShowDialog(); } return(value); }
/// <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(); } } }