Page Constructor (Guid, String, String)
Initializes a new instance of the Page class with the specified GUID, display name, and description.
Namespace: Microsoft.WindowsServerSolutions.Administration.ObjectModel
Assembly: Microsoft.WindowsServerSolutions.Administration.ObjectModel (in Microsoft.WindowsServerSolutions.Administration.ObjectModel.dll)
Syntax
protected Page(
Guid id,
string displayName,
string description
)
protected:
Page(
Guid id,
String^ displayName,
String^ description
)
Protected Sub New (
id As Guid,
displayName As String,
description As String
)
Parameters
id
Type: System.GuidThe GUID that uniquely identifies the page.
displayName
Type: System.StringThe display name of the page. The display name is used to identify the tab in the Dashboard.
description
Type: System.StringThe description of the page. The description is displayed when the mouse pointer is moved over the tab.
Exceptions
Exception | Condition |
---|---|
ArgumentException | displayName or description is not valid. |
ArgumentNullException | displayName or description is null. |
Remarks
Do not display any type of user interface from the Page methods that are overridden in a user-defined class. Unexpected results can occur if you display user interface objects from these methods. For example, the user interface object can be hidden from view because it was displayed behind the Dashboard. When errors occur using these methods, use the Errors property to report the errors. To display a task-based user interface, use the AsyncAction delegate method of the AsyncUiTask object or the SyncAction delegate method of the SyncUiTask object.
For more information about creating a GUID, see "Create Guid (guidgen.exe)" at the Microsoft Web site (https://go.microsoft.com/fwlink/?LinkId=116098).
Examples
The following code example shows how to initialize a new Page object in the user-defined class:
class AddinSample : Page
{
public AddinSample() : base(new Guid("6bee53dd-4eb8-4aeb-98a1-7af77a8bb449"), "DisplayName", "Description")
{
}
}
You can also initialize a new Page object in the user-defined class that provides access to an external file that can be used for initialization purposes. The following code example shows how to initialize a new Page object with a file name parameter:
class AddinSample : Page
{
public AddinSample(string cookie) : base(
new Guid(RetrievePageInfo(cookie, "Id")),
"DisplayName", "Description")
{
}
}
The file name represents an external .xml file that contains information for initializing instances of an add-in. An XMLReader object would then be used in the RetrievePageInfo method to obtain the GUID from the Id element. For more information about using an external file for initializing objects, see Deploying Add-Ins.
See Also
Page Class
Microsoft.WindowsServerSolutions.Administration.ObjectModel Namespace
Return to top