Help2.SyncIndex 方法

查找该 K 关键字指定的主题,但是,它不显示主题介绍资源管理器中,除非特别说明。

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

语法

声明
Sub SyncIndex ( _
    bstrKeyword As String, _
    fShow As Integer _
)
void SyncIndex(
    string bstrKeyword,
    int fShow
)
void SyncIndex(
    [InAttribute] String^ bstrKeyword, 
    [InAttribute] int fShow
)
abstract SyncIndex : 
        bstrKeyword:string * 
        fShow:int -> unit
function SyncIndex(
    bstrKeyword : String, 
    fShow : int
)

参数

  • bstrKeyword
    类型:String

    包含 K 关键字的字符串。

  • fShow
    类型:Int32

    设置强制索引窗口中打开。

示例

创建 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;
    HelpSyncContentsexample(_applicationObject);
}

public void HelpSyncContentsexample(DTE2 dte)
{
    // This add-in synchronizes the Help index to 
    // the supplied index.
    try
    {
        Microsoft.VisualStudio.VSHelp80.Help2 help2 =
(Microsoft.VisualStudio.VSHelp80.Help2)_applicationObject.GetObject 
("Help2");

        // Synchronize index.
        help2.SyncIndex("FLT_RADIX constant", 1);
    }

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

.NET Framework 安全性

请参阅

参考

Help2 接口

Microsoft.VisualStudio.VSHelp80 命名空间