/// <summary> /// Called when help is clicked. /// </summary> void OnHelp() { // First check we are disabled, show info on how to enable if (this.lblCurrentlyDisabled.Visible) { MessageBox.Show("Add-Ins can be enabled or disabled using the Add-In Manager option on the Tools menu.", DefaultMessageBoxCaption); } else { // Check we have a selected item GridItem item = this.propertyGridFeatures.SelectedGridItem; if (item != null) { // Check we have a property if (item.GridItemType == GridItemType.Property) { // Show property specific help... // Get property host/collection, to get the selected property, to access the plugin, to get the url CustomClass featuresHost = propertyGridFeatures.SelectedObject as CustomClass; foreach (CustomProperty property in featuresHost) { if (property.Name == item.Label) { IBIDSHelperPlugin plugin = property.Plugin; string helpUrl = plugin.HelpUrl; if (!string.IsNullOrEmpty(helpUrl)) { OpenUrl(plugin.HelpUrl); } else { MessageBox.Show("Sorry, no help page is available for this plug-in.", DefaultMessageBoxCaption); } return; } } } } } // Default trap MessageBox.Show("Please select an individual feature to access detailed help.", DefaultMessageBoxCaption); }
/// <summary> /// Initializes a new instance of the <see cref="CustomProperty"/> class, using a <see cref="BIDSHelperPluginBase"/> instance. /// </summary> /// <param name="plugin">The BIDS Helper plugin to represent as a feature enabled property.</param> public CustomProperty(IBIDSHelperPlugin plugin) { this.Plugin = plugin; this.name = plugin.FeatureName; this.description = plugin.FeatureDescription; this.objValue = plugin.Enabled; this.type = typeof(bool); this.readOnly = false; this.visible = true; this.category = GetFeatureCategoryLabel(plugin.FeatureCategory); this.childern = new Collection <CustomProperty>(); #if DEBUG // Write out list of all plugins as we create the property collection, // used for easy spell checking System.Diagnostics.Debug.WriteLine(this.name); System.Diagnostics.Debug.WriteLine(this.description); System.Diagnostics.Debug.WriteLine(string.Empty); #endif }