如何在 MMC C# 应用程序中显示 ScopeNode 的子节点?

How to show children of ScopeNode in MMC C# application?

我们正在用 C# 开发 Microsoft 管理控制台 windows 表单应用程序。我们已经成功地将作用域节点和子节点添加到该作用域节点,如下所示

        this.RootNode = new ScopeNode();
        this.RootNode.DisplayName = "Poseidon Security Manager";
        FormViewDescription fvd = new FormViewDescription();
        fvd.DisplayName = "Poseidon Security Dashboard";
        fvd.ViewType = typeof(ServiceViewForm);
        fvd.ControlType = typeof(ServiceUserControl);
        //RootNode.ViewDescriptions.Add(fvd);                                   

        ScopeNode scopeNode = new ScopeNode();
        scopeNode.DisplayName = "Configuration Management";
        ScopeNode sNode = new ScopeNode();
        sNode.DisplayName = "Endpoints";
        scopeNode.Children.Add(GetDeviceTypeList(sNode));
        RootNode.Children.Add(scopeNode);

        RootNode.ViewDescriptions.Add(new FormViewDescription() { ControlType = typeof(ServiceUserControl), ViewType = typeof(ServiceViewForm), DisplayName = "Poseidon Security Dashboard", Tag = scopeNode });

在 ServiceUserControl 中我们只有一个按钮。在该按钮单击事件中,我们要显示 "Poseidon Security Manager" 的子项。这意味着我们要扩展 "Poseidon Security Manager" scopenode 并显示 "Configuration Management" scopeNode。怎么做 ?能否请您提供解决方案?

在用户控件中我们需要调用FormView的对象,方法之一如下

 formView.SelectScopeNode(selectedScopeNode);

自动展开selectedScopeNode的所有父节点层级,selectedScopeNode会高亮显示