Share via


Window2, interface

L'objet Window représente une fenêtre dans l'environnement.

Espace de noms :  EnvDTE80
Assembly :  EnvDTE80 (dans EnvDTE80.dll)

Syntaxe

'Déclaration
<GuidAttribute("25731932-3283-4AE0-B7CF-F4691B8BE523")> _
Public Interface Window2 _
    Inherits Window
[GuidAttribute("25731932-3283-4AE0-B7CF-F4691B8BE523")]
public interface Window2 : Window
[GuidAttribute(L"25731932-3283-4AE0-B7CF-F4691B8BE523")]
public interface class Window2 : Window
[<GuidAttribute("25731932-3283-4AE0-B7CF-F4691B8BE523")>]
type Window2 =  
    interface
        interface Window
    end
public interface Window2 extends Window

Le type Window2 expose les membres suivants.

Propriétés

  Nom Description
Propriété publique AutoHides (Hérité de Window.)
Propriété publique AutoHides Obtient ou définit une valeur indiquant si la fenêtre Outil peut être masquée.
Propriété publique Caption (Hérité de Window.)
Propriété publique Caption Obtient ou définit le titre de la fenêtre.
Propriété publique Collection (Hérité de Window.)
Propriété publique Collection Obtient la collection contenant l'objet Window qui prend en charge cette propriété.
Propriété publique CommandBars Obtient une collection de Microsoft.VisualStudio.CommandBars contenus dans la fenêtre active.
Propriété publique ContextAttributes (Hérité de Window.)
Propriété publique ContextAttributes Obtient une collection de ContextAttributes qui permet aux clients Automation d'ajouter de nouveaux attributs aux éléments actuellement sélectionnés dans la fenêtre Aide dynamique et de fournir une aide contextuelle pour les attributs supplémentaires.
Propriété publique Document (Hérité de Window.)
Propriété publique Document Obtient l'objet Document associé à l'élément, le cas échéant.
Propriété publique DocumentData[String] (Hérité de Window.)
Propriété publique DocumentData[String] Infrastructure. Réservé à un usage interne Microsoft.
Propriété publique DTE (Hérité de Window.)
Propriété publique DTE Obtient l'objet d'extensibilité de niveau supérieur.
Propriété publique Height (Hérité de Window.)
Propriété publique Height Obtient ou définit une valeur indiquant les dimensions de la fenêtre en pixels.
Propriété publique HWnd (Hérité de Window.)
Propriété publique HWnd Infrastructure. Réservé à un usage interne Microsoft.
Propriété publique IsFloating (Hérité de Window.)
Propriété publique IsFloating Obtient ou définit une valeur indiquant si la fenêtre Outil flotte au-dessus des autres fenêtres.
Propriété publique Kind (Hérité de Window.)
Propriété publique Kind Infrastructure. Réservé à un usage interne Microsoft.
Propriété publique Left (Hérité de Window.)
Propriété publique Left Obtient ou définit la distance horizontale entre le bord interne gauche d'un objet et le bord gauche de son conteneur.
Propriété publique Linkable (Hérité de Window.)
Propriété publique Linkable Obtient ou définit une valeur indiquant si la fenêtre Outil peut être ancrée avec d'autres fenêtres Outil.
Propriété publique LinkedWindowFrame (Hérité de Window.)
Propriété publique LinkedWindowFrame Obtient un objet Window représentant le frame de fenêtre qui contient la fenêtre.
Propriété publique LinkedWindows (Hérité de Window.)
Propriété publique LinkedWindows Obtient une collection de toutes les fenêtres liées contenues dans le frame de fenêtre lié.
Propriété publique Object (Hérité de Window.)
Propriété publique Object Obtient un objet accessible par nom au moment de l'exécution.
Propriété publique ObjectKind (Hérité de Window.)
Propriété publique ObjectKind Obtient le type de l'objet Window.Object. Il s'agit d'une chaîne GUID représentant l'outil contenu dans la fenêtre.
Propriété publique Project (Hérité de Window.)
Propriété publique Project Obtient l'objet Project associé à l'objet Window.
Propriété publique ProjectItem (Hérité de Window.)
Propriété publique ProjectItem Obtient l'objet ProjectItem associé à l'objet Window.
Propriété publique Selection (Hérité de Window.)
Propriété publique Selection Obtient un objet représentant la sélection actuelle sur l'objet Window.
Propriété publique Top (Hérité de Window.)
Propriété publique Top Obtient ou définit la distance verticale entre le bord interne supérieur d'un objet et le bord supérieur de son conteneur.
Propriété publique Type (Hérité de Window.)
Propriété publique Type Infrastructure. Réservé à un usage interne Microsoft.
Propriété publique Visible (Hérité de Window.)
Propriété publique Visible Obtient ou définit la visibilité d'une fenêtre.
Propriété publique Width (Hérité de Window.)
Propriété publique Width Obtient ou définit la largeur de la fenêtre en nombre de caractères.
Propriété publique WindowState (Hérité de Window.)
Propriété publique WindowState Obtient ou définit l'état de la fenêtre : réduite en icône, normale, etc.

Début

Méthodes

  Nom Description
Méthode publique Activate() (Hérité de Window.)
Méthode publique Activate() Place le focus sur l'élément actuel.
Méthode publique Attach(Int32) (Hérité de Window.)
Méthode publique Attach(Int32) Infrastructure. Réservé à un usage interne Microsoft.
Méthode publique Close(vsSaveChanges) (Hérité de Window.)
Méthode publique Close(vsSaveChanges) Ferme le document ouvert et l'enregistre éventuellement, ou ferme et détruit la fenêtre.
Méthode publique Detach() (Hérité de Window.)
Méthode publique Detach() Infrastructure. Réservé à un usage interne Microsoft.
Méthode publique SetFocus() (Hérité de Window.)
Méthode publique SetFocus() Infrastructure. Réservé à un usage interne Microsoft.
Méthode publique SetKind(vsWindowType) (Hérité de Window.)
Méthode publique SetKind(vsWindowType) Infrastructure. Réservé à un usage interne Microsoft.
Méthode publique SetSelectionContainer(array<Object[]%) (Hérité de Window.)
Méthode publique SetSelectionContainer(array<Object[]%) Permet de définir l'activation d'objets dans la fenêtre Propriétés (fenêtre) lorsque cette dernière est active.
Méthode publique SetTabPicture(Object) (Hérité de Window.)
Méthode publique SetTabPicture(Object) Charge une bitmap dans une image avec onglets sur une fenêtre Outil liée par onglet.

Début

Exemples

Cet exemple lie la fenêtre Sortie, la fenêtre Commande et l'Explorateur de solutions. Il manipule ensuite la largeur et la hauteur de ces fenêtres liées, et annule finalement leur ancrage du frame de fenêtre lié.

Pour plus d'informations sur l'exécution de cet exemple comme complément, consultez Comment : compiler et exécuter les exemples de code du modèle objet Automation.

Imports EnvDTE
Imports EnvDTE80
Public Sub OnConnection(ByVal application As Object, _
 ByVal connectMode As ext_ConnectMode, ByVal addInInst As Object, _
 ByRef custom As Array) Implements IDTExtensibility2.OnConnection
    _applicationObject = CType(application, DTE2)
    _addInInstance = CType(addInInst, AddIn)
    LinkedWindowsExample(_applicationObject)
End Sub
Sub LinkedWindowsExample(ByVal dte As DTE2)
    Dim Frame As Window2
    Dim wins As Windows2
    wins = CType(_applicationObject.Windows, EnvDTE80.Windows2)
    Dim w1 As Window2 = _
 CType(_applicationObject.Windows.Item _
(Constants.vsWindowKindSolutionExplorer), EnvDTE80.Window2)
    Dim w2 As Window2 = _
 CType(_applicationObject.Windows.Item _
(Constants.vsWindowKindOutput), EnvDTE80.Window2)
    Dim w3 As Window2 = _
 CType(_applicationObject.Windows.Item _
(Constants.vsWindowKindCommandWindow), EnvDTE80.Window2)
    ' Create a linked window frame and dock Solution Explorer 
    ' and the Ouput window together inside it.
    Frame = CType(wins.CreateLinkedWindowFrame _
(w1, w2, vsLinkedWindowType.vsLinkedWindowTypeDocked), _
 EnvDTE80.Window2)
    MsgBox("Total number of windows in the linked window frame: " _
 & Frame.LinkedWindows.Count)
    ' Add another tool window, the Command window, to the frame with 
    ' the other two.
    Frame.LinkedWindows.Add(w3)
    MsgBox("Total number of windows in the linked window frame: " _
    & Frame.LinkedWindows.Count)
    ' Resize the entire linked window frame.
    Frame.Width = 500
    Frame.Height = 600
    MsgBox("Frame height and width changed. Now changing _
     Command window height.")
    ' Resize the height of the Command window.
    Frame.LinkedWindows.Item(3).Height = 800
    MsgBox("Now undocking the Command window from the frame.")
    ' Undock the Command window from the frame.
    Frame.LinkedWindows.Remove(w3)
    MsgBox("Now undocking the rest of the windows from the frame.")
    Frame.LinkedWindows.Remove(w2)
    Frame.LinkedWindows.Remove(w1)
End Sub
using EnvDTE;
using EnvDTE80;
using System.Windows.Forms;
public void OnConnection(object application, ext_ConnectMode
 connectMode, object addInInst, ref Array custom)
{
    _applicationObject = (DTE2)application;
    _addInInstance = (AddIn)addInInst;
    LinkedWindowsExample(_applicationObject);
}
public void LinkedWindowsExample(DTE2 dte)
{
    Window2 Frame;
    Windows2 wins;
    wins = (EnvDTE80.Windows2)_applicationObject.Windows;
    Window2 w1 = 
(EnvDTE80.Window2)_applicationObject.Windows.Item
(Constants.vsWindowKindSolutionExplorer);
Window2 w2 =
 (EnvDTE80.Window2)_applicationObject.Windows.Item
(Constants.vsWindowKindOutput);
    Window2 w3 = 
(EnvDTE80.Window2)_applicationObject.Windows.Item
(Constants.vsWindowKindCommandWindow);
    // Create a linked window frame and dock Solution Explorer
    // and the Output window together inside it.
    Frame = (EnvDTE80.Window2)wins.CreateLinkedWindowFrame
(w1, w2, vsLinkedWindowType.vsLinkedWindowTypeDocked);
    MessageBox.Show("Total number of windows in the linked 
window frame: " + Frame.LinkedWindows.Count);
    // Add another tool window, the Command window, to the frame with
    // the other two.
    Frame.LinkedWindows.Add(w3);
    MessageBox.Show("Total number of windows in the linked 
window frame: " + Frame.LinkedWindows.Count);
    // Resize the entire linked window frame.
    Frame.Width = 500;
    Frame.Height = 600;
    MessageBox.Show("Frame height and width changed.
 Now changing Command window height.");
    // Resize the height of the Command window.
    Frame.LinkedWindows.Item(3).Height = 800;
    MessageBox.Show("Now undocking the Command window from 
the frame.");
    // Undock the Command window from the frame.
    Frame.LinkedWindows.Remove(w3);
    MessageBox.Show("Now undocking the rest of the windows 
from the frame.");
    Frame.LinkedWindows.Remove(w2);
    Frame.LinkedWindows.Remove(w1);
}

Voir aussi

Référence

EnvDTE80, espace de noms