Help2.Contents 方法

,如果是封闭式的,选择 内容 导航窗口并打开它。

命名空间:  Microsoft.VisualStudio.VSHelp80
程序集:  Microsoft.VisualStudio.VSHelp80(在 Microsoft.VisualStudio.VSHelp80.dll 中)

语法

声明
Sub Contents
void Contents()
void Contents()
abstract Contents : unit -> unit
function Contents()

示例

创建 Visual Studio 外接程序使用 Visual C# 如 如何:创建外接程序所述。 添加对 Microsoft.VisualStudio.VSHelpMicrosoft.VisualStudio.VSHelp80System.Windows.Forms。 用下面的代码替换该 OnConnection 方法的代码在 Connect.cs 文件。 运行代码示例 如何:编译和运行自动化对象模型代码示例如中所述。

using System;
using Extensibility;
using EnvDTE;
using EnvDTE80;
using Microsoft.VisualStudio.VSHelp;
using Microsoft.VisualStudio.VSHelp80;
using System.Windows.Forms;


public void OnConnection(object application,
ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
    _applicationObject = (DTE2)application;
    _addInInstance = (AddIn)addInInst;
    HelpContentsExample(_applicationObject);
}

public void HelpContentsExample(DTE2 dte)
{
    // This opens Document Explorer and sets
    // focus on the Contents window.
    try
    {
        Microsoft.VisualStudio.VSHelp80.Help2 help2 =
(Microsoft.VisualStudio.VSHelp80.Help2)_applicationObject.GetObject 
("Help2");

                // Open Document Explorer and set focus on Contents window.
                help2.Contents();

            }
            catch (SystemException ex)
            {
                MessageBox.Show("ERROR: " + ex);
            }
        }

.NET Framework 安全性

请参阅

参考

Help2 接口

Microsoft.VisualStudio.VSHelp80 命名空间