void ScopeNode_AddPropertyPages(object sender, EventArgs <PropertyPageCollection> e) { switch (this.ScopeNode.CurrentPropertySheetTitle) { case "Add Field": // create property page and attach event handlers string appName = this.ScopeNode.DisplayName; AppFieldPropertyPage propPage = new AppFieldPropertyPage(appName); propPage.Saved += PropPage_Saved; // add the page to the collection e.Value.Add(propPage); break; } }
protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection) { if (this.SelectedNodes.Count == 0) { throw new Exception("There should be at least one field selected."); } // get selected node information string appName = this.ScopeNode.DisplayName; string fieldName = this.SelectedNodes[0].DisplayName; string fieldValue = this.SelectedNodes[0].SubItemDisplayNames[0]; string identifier = this.SelectedNodes[0].SubItemDisplayNames[1]; // create property page and attach event handlers AppFieldPropertyPage propPage = new AppFieldPropertyPage(appName, fieldName, fieldValue, identifier); propPage.Saved += PropPage_Saved; // add the page to the collection propertyPageCollection.Add(propPage); }
protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection) { // get application name from selected node string appName = this.SelectedNodes[0].DisplayName; switch (this.currentPropertyPageTitle) { case "Add Field": // create property page and attach event handlers AppFieldPropertyPage propPage = new AppFieldPropertyPage(appName); propPage.Saved += PropPage_Saved; // add the page to the collection propertyPageCollection.Add(new AppFieldPropertyPage(appName)); break; default: // create instance of the AppPropertyPageManager AppPropertyPageManager propPageManager = new AppPropertyPageManager(appName); propPageManager.Saved += PropPageManager_Saved; // add property pages propPageManager.AddPropertyPages(propertyPageCollection); break; } }