HierarchyProvider(IServiceProvider) Constructor
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the HierarchyProvider class.
protected:
HierarchyProvider(IServiceProvider ^ serviceProvider);
protected HierarchyProvider (IServiceProvider serviceProvider);
new Microsoft.Web.Management.Client.HierarchyProvider : IServiceProvider -> Microsoft.Web.Management.Client.HierarchyProvider
Protected Sub New (serviceProvider As IServiceProvider)
Parameters
- serviceProvider
- IServiceProvider
The service provider.
Examples
The following example shows a class that is derived from the HierarchyProvider class. The derived class contains another class that is derived from the HierarchyInfo class.
internal class DemoHierProvidr : HierarchyProvider {
private DemoHierarchyInfo _info;
public DemoHierProvidr(IServiceProvider serviceProvider)
: base(serviceProvider) {
}
internal class DemoModule : Microsoft.Web.Management.Client.Module {
protected override void Initialize(IServiceProvider
serviceProvider, ModuleInfo moduleInfo) {
base.Initialize(serviceProvider, moduleInfo);
IControlPanel cp =
(IControlPanel)GetService(typeof(IControlPanel));
ModulePageInfo modPgInfo = getModulePage();
cp.RegisterPage(modPgInfo);
cp.RegisterPage(
ControlPanelCategoryInfo.HealthAndDiagnostics,
modPgInfo);
/// The ExtensibilityManager is used to add a new icon/element
/// to the InetMgr UI in the Connections frame.
IExtensibilityManager extensMgr =
(IExtensibilityManager)GetService(
typeof(IExtensibilityManager));
System.Diagnostics.Debug.Assert(extensMgr != null);
extensMgr.RegisterExtension(typeof(HierarchyProvider),
new DemoHierProvidr(serviceProvider));
}
private void UpdateFilter(string description,
bool canRemove) {
_filter = new MyModuleListPageFilter(
description, canRemove);
RefreshFilter();
}
Remarks
The serviceProvider
parameter is stored as a private member of the class and used in the GetService method.