Microsoft.ManagementConsole.PropertyPageCollection.Add C# (CSharp) Method

Add() public method

public Add ( PropertyPage propertyPage ) : int
propertyPage PropertyPage
return int
        public int Add(PropertyPage propertyPage)
        {
            ValidatePropertyPage(propertyPage);
            return base.List.Add(propertyPage);
        }

Usage Example

        /// <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);
            }
        }
All Usage Examples Of Microsoft.ManagementConsole.PropertyPageCollection::Add