ToolWindows Interface
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Améliore la détectabilité et l'utilisation des fenêtres Outil dans le modèle objet en fournissant un accès facile aux fenêtres Outil du shell dans leurs types natifs.
public interface class ToolWindows
public interface class ToolWindows
__interface ToolWindows
[System.Runtime.InteropServices.Guid("19AC6F68-3019-4D65-8D98-404DFB96B8E2")]
[System.Runtime.InteropServices.TypeLibType(4160)]
public interface ToolWindows
[<System.Runtime.InteropServices.Guid("19AC6F68-3019-4D65-8D98-404DFB96B8E2")>]
[<System.Runtime.InteropServices.TypeLibType(4160)>]
type ToolWindows = interface
Public Interface ToolWindows
- Attributs
Exemples
Cet exemple ajoute un fenêtre Sortie, intitulé « mon résultat », l’active et affiche toutes les fenêtres outil atteintes via l' Collection objet de l' ToolWindows objet parent.
Imports EnvDTE
Imports EnvDTE80
Public Sub OutputToolWindow(ByVal dte As DTE2)
Dim myOut As OutputWindow
myOut = _applicationObject.ToolWindows.OutputWindow
Dim myPane As OutputWindowPane
Dim txt As String
txt = ""
MsgBox("Creating an output window.")
myPane = myOut.OutputWindowPanes.Add("My output")
myPane.Activate()
MsgBox("Adding some text to the output window...")
myPane.OutputString("This is the collection of tool windows, _
reached through the Output Window object:" & vbCr)
For Each tempWindow As EnvDTE80.Window2 In myOut.Parent.Collection
txt = txt & (tempWindow.Caption & vbCr)
Next tempWindow
MsgBox("Displaying all the tool window captions _
in the Output window...")
myPane.OutputString(txt)
End Sub
using EnvDTE;
using EnvDTE80;
using System.Windows.Forms;
public void OutputToolWindow(DTE2 dte)
{
OutputWindow myOut;
myOut = _applicationObject.ToolWindows.OutputWindow;
OutputWindowPane myPane;
String txt = null;
MessageBox.Show("Creating an output window.");
myPane = myOut.OutputWindowPanes.Add("My output");
myPane.Activate();
MessageBox.Show("Adding some text to the output window...");
myPane.OutputString("This is the collection of tool
windows,reached through the Output Window object:" + "\n");
foreach (EnvDTE80.Window2 tempWindow in myOut.Parent.Collection)
{
txt = txt + (tempWindow.Caption + "\n");
}
MessageBox.Show("Displaying all the tool window captions
in the output window...");
myPane.OutputString(txt);
}
Remarques
Les fenêtres Outil Visual Studio sont accessibles par le biais des propriétés de membre. D’autres fenêtres Outil peuvent se trouver avec la GetToolWindow fonction.
Propriétés
| CommandWindow |
Obtient l'objet CommandWindow. |
| DTE |
Obtient l'objet d'extensibilité de niveau supérieur. |
| ErrorList |
Obtient la liste d'erreurs affichées dans l'IDE. |
| OutputWindow |
Obtient l'objet OutputWindow. |
| SolutionExplorer |
Obtient un UIHierarchy objet représentant Explorateur de solutions. |
| TaskList |
Obtient l'objet TaskList. |
| ToolBox |
Obtient l'objet ToolBox. |
Méthodes
| GetToolWindow(String) |
Permet à l'utilisateur de récupérer une fenêtre par son titre. |