Método Help2.GetPrevTopic
Uma URL especificada retorna o URL anterior no sumário.
Namespace: Microsoft.VisualStudio.VSHelp80
Assembly: Microsoft.VisualStudio.VSHelp80 (em Microsoft.VisualStudio.VSHelp80.dll)
Sintaxe
'Declaração
Function GetPrevTopic ( _
bstrURL As String _
) As String
string GetPrevTopic(
string bstrURL
)
String^ GetPrevTopic(
[InAttribute] String^ bstrURL
)
abstract GetPrevTopic :
bstrURL:string -> string
function GetPrevTopic(
bstrURL : String
) : String
Parâmetros
bstrURL
Tipo: StringA seqüência de caracteres que contém o URL do tópico atual que seja compatível com o Internet Explorer.
Valor de retorno
Tipo: String
Retorna um string que contém o URL do tópico anterior no sumário.
Exemplos
Criar um Visual Studio suplemento usando Visual C# conforme descrito em Como criar um suplemento. Add references to Microsoft.VisualStudio.VSHelp, Microsoft.VisualStudio.VSHelp80, and System.Windows.Forms. Substitua o código na OnConnection método no arquivo Connect. cs com o código a seguir. Executar o exemplo de código, conforme descrito em Como compilar e executar os exemplos de código do modelo de objeto Automation.
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;
HelpGetPrevURLExample(_applicationObject);
}
public void HelpGetPrevURLExample(DTE2 dte)
{
// Returns and displays the URL of the topic that precedes
// the topic specified
// by the URL in the table of contents.
try
{
Microsoft.VisualStudio.VSHelp80.Help2 help2 =
(Microsoft.VisualStudio.VSHelp80.Help2)_applicationObject.GetObject
("Help2");
// Get the URL of the topic that precedes
// Introducing Visual Studio
// and display it.
MessageBox.Show("The previous URL before the supplied one is "
+ "\n" + help2.GetPrevTopic
("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);
}
}
Segurança do .NET Framework
- Confiança total para o chamador imediato. O membro não pode ser usado por código parcialmente confiável. Para obter mais informações, consulte Usando bibliotecas de código parcialmente confiável.