internal override void ProcessRequest(Request request)
 {
     if (request.RequestInfo is ExtensionPagesRequestInfo)
     {
         ExtensionPagesRequestInfo requestInfo = request.RequestInfo as ExtensionPagesRequestInfo;
         PropertyPageCollection propertyPageCollection = new PropertyPageCollection();
         IRequestStatus requestStatus = request.RequestStatus;
         SyncStatus status2 = new SyncStatus(requestStatus);
         try
         {
             this.OnAddPropertyPages(propertyPageCollection);
             PropertyPagesResponse response = new PropertyPagesResponse();
             response.SetPropertyPages(propertyPageCollection.ToPropertyPageInfoArray());
             requestStatus.ProcessResponse(response);
         }
         finally
         {
             status2.Close();
         }
         this._extensionPropertySheet = SnapInBase.SnapInInstance.SheetManager.CreatePropertySheet(requestInfo.SheetId, propertyPageCollection, null);
     }
     else
     {
         base.ProcessRequest(request);
     }
 }
        /// <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);
            }
        }
Example #3
0
 internal PropertySheet CreatePropertySheet(int sheetId, PropertyPageCollection pageCollection, AuxiliarySelectionData auxiliarySelectionData)
 {
     if (pageCollection == null)
     {
         throw new ArgumentNullException("pageCollection");
     }
     PropertySheet sheet = new PropertySheet(this, sheetId, auxiliarySelectionData);
     sheet.AddPropertyPages(pageCollection);
     this.AddPropertySheet(sheet);
     return sheet;
 }
 /// <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());
     }
 }
Example #5
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);
            }
        }
Example #6
0
 internal void AddPropertyPages(PropertyPageCollection pageCollection)
 {
     if (pageCollection == null)
     {
         throw new ArgumentNullException("pageCollection");
     }
     for (int i = 0; i < pageCollection.Count; i++)
     {
         PropertyPage propertyPage = pageCollection[i];
         propertyPage.SetPageIdAndParentSheet(i, this);
         this.AddPropertyPage(propertyPage);
     }
 }
Example #7
0
 public bool ShowPropertySheet(string title, bool hideApplyButton)
 {
     this.ThrowIfViewShutdown("ShowPropertySheet");
     if (!this._view.Initialized || !this._view.Visible)
     {
         TraceSources.ExecutiveSource.TraceEvent(TraceEventType.Warning, 12, "Ignoring property sheet request since view hasn't been initialized or is hidden.");
         return true;
     }
     if (title == null)
     {
         throw new ArgumentNullException("title");
     }
     if (this._selectionObject == null)
     {
         throw new InvalidOperationException(Microsoft.ManagementConsole.Internal.Utility.LoadResourceString(Microsoft.ManagementConsole.Internal.Strings.SelectionDataObjectNull));
     }
     int num = SnapInBase.SnapInInstance.SheetManager.FindPropertySheet(this._selectionObject);
     if (num != -1)
     {
         FindPropertySheetForViewCommand command = new FindPropertySheetForViewCommand();
         command.SelectionId = num;
         FindPropertySheetCommandResult result = (FindPropertySheetCommandResult) SnapInBase.SnapInInstance.SnapInPlatform.ProcessCommand(command);
         if ((result != null) && result.SheetExists)
         {
             return false;
         }
     }
     PropertyPageCollection propertyPageCollection = new PropertyPageCollection();
     this._view.OnAddPropertyPages(propertyPageCollection);
     CreatePropertySheetForViewCommand command2 = new CreatePropertySheetForViewCommand();
     command2.Title = title;
     command2.HideApplyButton = hideApplyButton;
     command2.ViewId = this._view.ViewInstanceId;
     command2.PropertyPagesData = propertyPageCollection.ToPropertyPageInfoArray();
     CreatePropertySheetCommandResult result2 = (CreatePropertySheetCommandResult) SnapInBase.SnapInInstance.SnapInPlatform.ProcessCommand(command2);
     if ((result2 != null) && (result2.SheetId != -1))
     {
         SnapInBase.SnapInInstance.SheetManager.CreatePropertySheet(result2.SheetId, propertyPageCollection, new AuxiliarySelectionData(this));
     }
     return true;
 }
 protected virtual void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
 {
 }
Example #9
0
 public bool ShowPropertySheet(string title, bool hideApplyButton)
 {
     if (title == null)
     {
         throw new ArgumentNullException("title");
     }
     FindPropertySheetForScopeNodeCommand command = new FindPropertySheetForScopeNodeCommand();
     command.ScopeNodeId = base.Id;
     FindPropertySheetCommandResult result = (FindPropertySheetCommandResult) SnapInBase.SnapInInstance.SnapInPlatform.ProcessCommand(command);
     if ((result != null) && result.SheetExists)
     {
         return false;
     }
     PropertyPageCollection propertyPageCollection = new PropertyPageCollection();
     this.OnAddPropertyPages(propertyPageCollection);
     CreatePropertySheetForScopeNodeCommand command2 = new CreatePropertySheetForScopeNodeCommand();
     command2.Title = title;
     command2.ScopeNodeId = base.Id;
     command2.HideApplyButton = hideApplyButton;
     command2.PropertyPagesData = propertyPageCollection.ToPropertyPageInfoArray();
     CreatePropertySheetCommandResult result2 = (CreatePropertySheetCommandResult) SnapInBase.SnapInInstance.SnapInPlatform.ProcessCommand(command2);
     if ((result2 != null) && (result2.SheetId != -1))
     {
         SnapInBase.SnapInInstance.SheetManager.CreatePropertySheet(result2.SheetId, propertyPageCollection, null);
     }
     return true;
 }
Example #10
0
 internal void GetPropertyPages(int sheetId, IRequestStatus requestStatus)
 {
     if (requestStatus == null)
     {
         throw new ArgumentNullException("requestStatus", Microsoft.ManagementConsole.Internal.Utility.LoadResourceString(Microsoft.ManagementConsole.Internal.Strings.ScopeNodeRequestInterfaceNull));
     }
     PropertyPageCollection propertyPageCollection = new PropertyPageCollection();
     SyncStatus status = new SyncStatus(requestStatus);
     try
     {
         this.OnAddPropertyPages(propertyPageCollection);
         PropertyPagesResponse response = new PropertyPagesResponse();
         response.SetPropertyPages(propertyPageCollection.ToPropertyPageInfoArray());
         requestStatus.ProcessResponse(response);
     }
     finally
     {
         status.Close();
     }
     SnapInBase.SnapInInstance.SheetManager.CreatePropertySheet(sheetId, propertyPageCollection, null);
 }
 /// <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));
 }
Example #13
0
 internal void GetPropertyPages(int sheetId, long selectionId, IRequestStatus requestStatus)
 {
     if (requestStatus == null)
     {
         throw new ArgumentNullException("requestStatus");
     }
     PropertyPageCollection propertyPageCollection = new PropertyPageCollection();
     SyncStatus status = new SyncStatus(requestStatus);
     try
     {
         if ((this.SelectionData.SelectionCardinality == SelectionCardinality.None) || (selectionId != this.SelectionData.Id))
         {
             TraceSources.ExecutiveSource.TraceEvent(TraceEventType.Warning, 12, "Request for pages for sheet {0} in view {1} selection id {2} ignored since selection has changed.", new object[] { sheetId, this._viewInstanceId, selectionId });
             requestStatus.ProcessResponse(new PropertyPagesResponse());
             return;
         }
         this.OnAddPropertyPages(propertyPageCollection);
         PropertyPagesResponse response = new PropertyPagesResponse();
         response.SetPropertyPages(propertyPageCollection.ToPropertyPageInfoArray());
         requestStatus.ProcessResponse(response);
     }
     finally
     {
         status.Close();
     }
     SnapInBase.SnapInInstance.SheetManager.CreatePropertySheet(sheetId, propertyPageCollection, new AuxiliarySelectionData(this.SelectionData));
 }