Share via


WindowConfigurations – rozhraní

WindowConfigurations Kolekce obsahuje všechny pojmenované okno Konfigurace pro životní prostředí.

Obor názvů:  EnvDTE
Sestavení:  EnvDTE (v EnvDTE.dll)

Syntaxe

'Deklarace
<GuidAttribute("E577442A-98E1-46C5-BD2E-D25807EC81CE")> _
Public Interface WindowConfigurations _
    Inherits IEnumerable
[GuidAttribute("E577442A-98E1-46C5-BD2E-D25807EC81CE")]
public interface WindowConfigurations : IEnumerable
[GuidAttribute(L"E577442A-98E1-46C5-BD2E-D25807EC81CE")]
public interface class WindowConfigurations : IEnumerable
[<GuidAttribute("E577442A-98E1-46C5-BD2E-D25807EC81CE")>]
type WindowConfigurations =  
    interface 
        interface IEnumerable 
    end
public interface WindowConfigurations extends IEnumerable

Typ WindowConfigurations zveřejňuje následující členy.

Vlastnosti

  Název Popis
Veřejná vlastnost ActiveConfigurationName Získá název konfigurace aktivní okno.
Veřejná vlastnost Count Získá hodnotu určující počet objektů v kolekci.
Veřejná vlastnost DTE Načtení objektu nejvyšší úrovně rozšiřitelnosti.
Veřejná vlastnost Parent Získá bezprostřední nadřízený objekt WindowConfigurations kolekce.

Nahoru

Metody

  Název Popis
Veřejná metoda Add Vytvoří nový konfigurační okno na základě aktuálního uspořádání systému windows, přidá ji do WindowConfigurations kolekce a zachovává pro budoucí odvolání.
Veřejná metoda GetEnumerator Získá výčet položek v kolekci.
Veřejná metoda Item Vrací indexovaný člen WindowConfigurations kolekce.

Nahoru

Poznámky

Jako pojmenované okno Konfigurace můžete uložit aktuální rozložení okna v prostředí Visual Studio.WindowConfigurations Kolekce obsahuje všechny konfigurace.

Příklady

Sub WinConfigurationsExample(ByVal dte As DTE)
    ' This example lists all currently available named window 
    ' configurations.
    ' Set references to all necessary objects.
    Dim colWinConfig As WindowConfigurations
    Dim objWinConfig As WindowConfiguration

    colWinConfig = dte.WindowConfigurations

    MsgBox("Number of configurations: " & colWinConfig.Count)
    ' List all saved named window configurations
    FillMsg(colWinConfig)
    ' Create a new window configuration.
    objWinConfig = colWinConfig.Add("NewLayout")
    FillMsg(colWinConfig)
    ' Get rid of the new window configuration.
    objWinConfig.Delete()
    MsgBox("Number of configurations: " & colWinConfig.Count)
    FillMsg(colWinConfig)
End Sub

Sub FillMsg(ByVal colWinConfig As Object)
    ' Lists all currently available named window configurations.
    Dim lCtr As Integer
    Dim strMsg As String

    For lCtr = 1 To colWinConfig.Count
    strMsg = strMsg & "Configuration name " & lCtr & ": " & _
    colWinConfig.Item(lCtr).Name & vbCr
    Next lCtr
    strMsg = "Current Configurations: " & vbCr & strMsg
    MsgBox(strMsg)
End Sub
void WinConfigExample1(_DTE dte)
{
// Set references to all necessary objects.
    WindowConfigurations colWinConfig; 
    WindowConfiguration objWinConfig;

    colWinConfig = dte.WindowConfigurations;

    MessageBox.Show("Number of configurations: " + 
      colWinConfig.Count);

    // List all saved named window configurations.
    FillMsg(colWinConfig);
    // Create a new window configuration.
    objWinConfig = colWinConfig.Add("NewLayout");
    FillMsg(colWinConfig);
    // Get rid of the new window configuration.
    objWinConfig.Delete();
    MessageBox.Show("Number of configurations: " + colWinConfig.Count);
    FillMsg(colWinConfig);
}

void FillMsg(WindowConfigurations colWinConfig )
{
        // Lists all currently available named window configurations.
    int lCtr;
    string strMsg = null;

    for (lCtr = 1; lCtr < colWinConfig.Count + 1; lCtr ++)
    {
        strMsg = strMsg + "Configuration name " + lCtr + ": " + 
            colWinConfig.Item(lCtr).Name + "\n"; 
    }
    strMsg = "Current Configurations: \n" + strMsg;
    MessageBox.Show(strMsg);
}

Viz také

Referenční dokumentace

EnvDTE – obor názvů

Další zdroje

Příklad vytvoření WindowConfiguration

Příklad výběru WindowConfiguration