TopologyView Class
System.Object
System.Web.UI.Control
System.Web.UI.TemplateControl
System.Web.UI.UserControl
Microsoft.SharePoint.WebControls.TopologyView
System.Web.UI.Control
System.Web.UI.TemplateControl
System.Web.UI.UserControl
Microsoft.SharePoint.WebControls.TopologyView
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
TopologyView
Description
The Microsoft.SharePoint.WebControls.TopologyView class inherits from System.Web.UI.UserControl which is the base class for producing orthodox web user controls. The main representation of the TopologyView is found in ToplologyViewWebPart which dynamically loads the TopologyView.ascx file from C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\ADMIN at run time by using the Page.LoadControl method.
ToplogyView offers a SPGridView composed of SPServer representation for the local SPFarm (SPFarm.Local). The data source for the grid is provided through the use of AdministrationDataSourceControl. AdminsitrationDataSourceControl contains the ViewName property which can take a number of string values to build an administrative datasource. For TopologyView the AdministrationDataSourceControl.ViewName property is "TopologyView", however it should be noted that several administrative data sources can be built with AdministrationDataSourceControl, for example examining all available solutions available by passing in the string "Solutions".
Within the SPGridView, there are four types of information that is displayed:
1) The Server ID and Server Name
2) The Services Running On The Server
3) The Server Version
4) Remove Server
It should be noted that RemoveServer is the only option wired to an event, using SPServer.Delete() to remove the server from the topology.
The Usage Scenario
The main usage of ToplogyView is represented in the TopologyViewWebPart, displayed by default in the shipped SharePoint Central Administration front page matter. However, it is possible to use it within a custom WebPart in a similar fashion as the TopologyViewWebPart when building administration applications.
In the below, I am loading the user control using Page.LoadControl and performing an orthodox cast since the return type will be of type Control. Once the casting has occurred, the proper object properties are available, however most are internal properties so are not available to callers, so the object is fairly immutable.
C# Code Example
protected override void CreateChildControls()
{
TopologyView tv = (TopologyView) Page.LoadControl("~/_admin/TopologyView.ascx");
Controls.Add(tv);
base.CreateChildControls();
}
Visual Basic .NET Code Example
Protected Overloads Overrides Sub CreateChildControls()
Dim tv As TopologyView = DirectCast(Page.LoadControl("~/_admin/TopologyView.ascx"), TopologyView)
Controls.Add(tv)
MyBase.CreateChildControls()
End Sub
The Microsoft.SharePoint.WebControls.TopologyView class inherits from System.Web.UI.UserControl which is the base class for producing orthodox web user controls. The main representation of the TopologyView is found in ToplologyViewWebPart which dynamically loads the TopologyView.ascx file from C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\ADMIN at run time by using the Page.LoadControl method.
ToplogyView offers a SPGridView composed of SPServer representation for the local SPFarm (SPFarm.Local). The data source for the grid is provided through the use of AdministrationDataSourceControl. AdminsitrationDataSourceControl contains the ViewName property which can take a number of string values to build an administrative datasource. For TopologyView the AdministrationDataSourceControl.ViewName property is "TopologyView", however it should be noted that several administrative data sources can be built with AdministrationDataSourceControl, for example examining all available solutions available by passing in the string "Solutions".
Within the SPGridView, there are four types of information that is displayed:
1) The Server ID and Server Name
2) The Services Running On The Server
3) The Server Version
4) Remove Server
It should be noted that RemoveServer is the only option wired to an event, using SPServer.Delete() to remove the server from the topology.
The Usage Scenario
The main usage of ToplogyView is represented in the TopologyViewWebPart, displayed by default in the shipped SharePoint Central Administration front page matter. However, it is possible to use it within a custom WebPart in a similar fashion as the TopologyViewWebPart when building administration applications.
In the below, I am loading the user control using Page.LoadControl and performing an orthodox cast since the return type will be of type Control. Once the casting has occurred, the proper object properties are available, however most are internal properties so are not available to callers, so the object is fairly immutable.
C# Code Example
protected override void CreateChildControls()
{
TopologyView tv = (TopologyView) Page.LoadControl("~/_admin/TopologyView.ascx");
Controls.Add(tv);
base.CreateChildControls();
}
Visual Basic .NET Code Example
Protected Overloads Overrides Sub CreateChildControls()
Dim tv As TopologyView = DirectCast(Page.LoadControl("~/_admin/TopologyView.ascx"), TopologyView)
Controls.Add(tv)
MyBase.CreateChildControls()
End Sub
- 6/3/2010
- Adam Buenz - MVP