Add() public method

public Add ( PropertyPage propertyPage ) : int
propertyPage PropertyPage
return int
        /// <summary>
        /// OnAddPropertyPages virtual method is called to add property pages to a property sheet.
        /// </summary>
        /// <param name="propertyPageCollection">The property page collection.</param>
        protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
        {
            if( SelectedNodes.Count == 0)
            {
                throw new Exception("there should be one selection");
            }
            else
            {
                GeneralPropertyPage generalPropertyPage = new GeneralPropertyPage();
                generalPropertyPage.Title = "General";

                GeneralPropertiesControl generalPropertiesControl = new GeneralPropertiesControl(generalPropertyPage);
                generalPropertyPage.Control = generalPropertiesControl;

                propertyPageCollection.Add(generalPropertyPage);

                StartupPropertyPage startupPropertyPage = new StartupPropertyPage();
                startupPropertyPage.Title = "Startup";

                StartupPropertiesControl startupPropertiesControl = new StartupPropertiesControl(startupPropertyPage);
                startupPropertyPage.Control = startupPropertiesControl;

                propertyPageCollection.Add(startupPropertyPage);
            }
        }
 /// <summary>
 /// OnAddPropertyPages is used to get the property pages to show. 
 /// (triggered by SelectionData.ShowPropertySheet)
 /// </summary>
 /// <param name="propertyPageCollection">property pages</param>
 protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
 {
     if(this.SelectedNodes.Count == 0)
     {
         throw new Exception("there should be at least one selection");
     }
     else
     {
         // add at least one property page relevant to the selection
         propertyPageCollection.Add(new UserPropertyPage());
     }
 }
示例#3
0
        protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
        {
            if (SelectedNodes.Count > 0)
            {
                Task wmiTask = SelectedNodes[0].Tag as Task;

                WmiPropertiesControl propertiesControl = new WmiPropertiesControl(wmiTask);
                var propertiesPage = new DetailsPropertyPage<WmiPropertiesControl>(
                    "Task", propertiesControl);
                propertyPageCollection.Add(propertiesPage);
            }
        }
 /// <summary>
 /// Virtual method that is called to get the extension pages.  
 /// </summary>
 /// <param name="propertyPageCollection">Page collection.</param>
 protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
 {
     // add extension page.
     MachinePropertyPage machinePropertyPage = new MachinePropertyPage(sharedDataItem);
     propertyPageCollection.Add(machinePropertyPage);
 }
 /// <summary>
 /// OnAddPropertyPages is used to get the property pages to show. 
 /// (triggered by Properties verbs)
 /// </summary>
 /// <param name="propertyPageCollection">property pages</param>
 protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
 {
     propertyPageCollection.Add(new ScopePropertyPage(this));
 }