Freigeben über


Help2.SyncContents(String) Method

Definition

Synchronizes the table of contents to the supplied URL.

public:
 void SyncContents(System::String ^ bstrURL);
public:
 void SyncContents(Platform::String ^ bstrURL);
void SyncContents(std::wstring const & bstrURL);
[System.Runtime.InteropServices.DispId(12)]
public void SyncContents (string bstrURL);
[<System.Runtime.InteropServices.DispId(12)>]
abstract member SyncContents : string -> unit
Public Sub SyncContents (bstrURL As String)

Parameters

bstrURL
String

String containing the URL.

Implements

Attributes

Examples

Create a Visual Studio add-in by using Visual C# as described in How to: Create an Add-In. Add references to Microsoft.VisualStudio.VSHelp, Microsoft.VisualStudio.VSHelp80, and System.Windows.Forms. Replace the code in the OnConnection method in the Connect.cs file with the following code. Run the code example as described in How to: Compile and Run the Automation Object Model Code Examples.

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 contents to   
    // the supplied URL.  
    try  
    {  
        Microsoft.VisualStudio.VSHelp80.Help2 help2 =  
(Microsoft.VisualStudio.VSHelp80.Help2)_applicationObject.GetObject ("Help2");  

        // Set focus on Contents.  
        help2.Contents();  
        // Synchronize contents.  
        help2.SyncContents  
("ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en  
/dv_vstoc/html/99997089-56ff-4d60-81a9-447062dc98ac.htm");  
    }  
    catch (SystemException ex)  
    {  
        MessageBox.Show("ERROR: " + ex);  
    }  
}  

Applies to