Share via


Interfaccia HTMLWindow3

rappresenta una finestra di documento HTML in Visual Studio ambiente (IDE) di sviluppo integrato (IDE).

Spazio dei nomi:  EnvDTE90
Assembly:  EnvDTE90 (in EnvDTE90.dll)

Sintassi

'Dichiarazione
<GuidAttribute("BAD0A3DD-8109-4684-B806-A5282267BFE4")> _
Public Interface HTMLWindow3
[GuidAttribute("BAD0A3DD-8109-4684-B806-A5282267BFE4")]
public interface HTMLWindow3
[GuidAttribute(L"BAD0A3DD-8109-4684-B806-A5282267BFE4")]
public interface class HTMLWindow3
[<GuidAttribute("BAD0A3DD-8109-4684-B806-A5282267BFE4")>]
type HTMLWindow3 =  interface end
public interface HTMLWindow3

Il tipo HTMLWindow3 espone i seguenti membri.

Proprietà

  Nome Descrizione
Proprietà pubblica CurrentPane Ottiene o imposta il tipo corrente della finestra dell'editor HTML.
Proprietà pubblica CurrentView Ottiene o imposta se la finestra dell'editor HTML consiste nell'origine, nella finestra di progettazione, o nella visualizzazione suddivisa.

In alto

Metodi

  Nome Descrizione
Metodo pubblico WaitForBackgroundProcessingComplete Sospende l'esecuzione del programma fino a quando l'elaborazione in background non completi.

In alto

Note

HTMLWindow3 viene restituito da Object proprietà di Window oggetto quando il documento è un documento HTML.Window.Selection e Document.Selection restituisce un oggetto TextSelection oggetto quando CurrentTab la proprietà è impostata su vsHTMLTabsSource.

HTMLWindow3, vsHTMLPanes e vsHTMLViews sono stati aggiunti con l'introduzione di visualizzazione suddivisa in Visual Studio 2008 editor HTML.La visualizzazione suddivisa separa gli elementi visivi e della scheda della finestra dell'editor HTML.Passare alla visualizzazione (progettazione o nel database di origine) non indica necessariamente passare la scheda (progettazione/suddivisione/origine).Ad esempio, quando si fa clic sulla scheda dividi, passare tra progettazione e origine non modifica la scheda, bensì attiva o disattiva le parti di progettazione e origine nella visualizzazione suddivisa.

Visual Studio 2008 HTMLWindow l'oggetto ora implementa inoltre HTMLWindow3 collegare che restituisce la visualizzazione corrente (progettazione o origine) e il riquadro corrente (scheda, qualsiasi progettazione, database di origine, o divisione).

regole HTMLWindow3

il comportamento di HTMLWindow3 è:

Bb545981.collapse_all(it-it,VS.110).gifottenere

Il riquadro corrente (scheda)

Restituzione di visualizzazione corrente

vsHTMLPaneDesign

vsHTMLViewDesign

vsHTMLPaneSource

vsHTMLViewSource

vsHTMLPaneSplit

O vsHTMLViewDesign o vsHTMLViewSource, a seconda della parte è attiva.

Bb545981.collapse_all(it-it,VS.110).gifset

Il riquadro corrente (scheda)

impostare

vsHTMLPaneDesign

  • Impostare la visualizzazione su vsHTMLViewSource o il riquadro a vsHTMLPaneSource passa l'editor HTML nella visualizzazione Origine e del riquadro.

  • impostare il riquadro a vsHTMLPaneSplit passa l'editor HTML per suddividere il riquadro con attiva la parte di progettazione.

vsHTMLPaneSource

  • Impostare la visualizzazione su vsHTMLViewDesign o il riquadro a vsHTMLPaneDesign passa l'editor HTML nel riquadro di progettazione e della visualizzazione progettazione.

  • impostare il riquadro a vsHTMLPaneSplit passa l'editor HTML per suddividere il riquadro con attiva di origine della parte.

vsHTMLPaneSplit

  • Impostare la visualizzazione su vsHTMLViewDesign passa l'editor alla parte di progettazione del riquadro spaccati.Il riquadro non passare alla visualizzazione progettazione.

  • Impostare la visualizzazione su vsHTMLViewSource passa l'editor alla parte di origine del riquadro spaccati.Il riquadro non cambia per generare il riquadro.

  • impostare il riquadro a vsHTMLPaneDesign passa l'editor nel riquadro di progettazione e della visualizzazione progettazione.

  • impostare il riquadro a vsHTMLPaneSource passa l'editor alla visualizzazione Origine e del riquadro.

Esempi

Sub HTMLWindow3Example(ByVal dte As EnvDTE80.DTE2)
    ' Open an HTML document before running this sample.
    If TypeOf dte.ActiveDocument.ActiveWindow.Object Is HTMLWindow3 _
        Then
            ' Ask the user for a file to insert into the body of the
            ' HTML document. This file should be an HTML fragment.
            Dim strFile As String = InputBox("Enter the name of a _
              file to insert at the end of the HTML document:")
            ' Get the HTMLWindow3 object and determine which tab is 
            ' currently active.
            Dim objHTMLWin As HTMLWindow3 = _
            CType(dte.ActiveDocument.ActiveWindow.Object, HTMLWindow3)
            Dim Tab As vsHTMLTabs = CType(objHTMLWin.CurrentTab, _
              vsHTMLTabs)
            Dim cpane As vsHTMLPanes = vsHTMLPanes.vsHTMLPaneSplit

            ' Switch to the "split" view, source view.
            objHTMLWin.CurrentPane = vsHTMLPanes.vsHTMLPaneSplit
            objHTMLWin.CurrentView = vsHTMLViews.vsHTMLViewSource

            ' Get an EditPoint at the start of the text.
            Dim objTextWin As TextWindow = _
              CType(objHTMLWin.CurrentTabObject, TextWindow)
            Dim objEP As EditPoint = _
            objTextWin.ActivePane.StartPoint.CreateEditPoint

            ' Look for the end of the document body.
            If objEP.FindPattern("</body>") Then
                ' Insert the contents of the file.
                objEP.InsertFromFile(strFile)
            End If

            ' Switch back to the original view of the HTML file.
            'objHTMLWin.CurrentTab = Tab
        Else
            MsgBox("You must open an HTML document.")
        End If
    End Sub
public void HTMLWindowExample(_DTE dte)
{
    // Open an HTML document before running this sample.
    if (dte.ActiveDocument.ActiveWindow.Object is HTMLWindow3)
    {
        HTMLWindow3 objHTMLWin;
        vsHTMLTabs Tab;
        String strFileName;
        // Ask the user for a file to insert into the body of the HTML 
        // document. This file should be an HTML fragment.
        strFileName = Microsoft.VisualBasic.Interaction.InputBox 
        ("Enter the name of a file to insert at the end of the HTML 
        document:","","",100,100);
        // Get the HTMLWindow3 object and determine which tab is 
        // currently active.
        objHTMLWin = dte.ActiveDocument.ActiveWindow.Object as 
        HTMLWindow3;
        Tab = objHTMLWin.CurrentTab;

        // Switch to the "source" tab.
        objHTMLWin.CurrentPane = vsHTMLPanes.vsHTMLPaneSplit;
        objHTMLWin.CurrentTab = vsHTMLViews.vsHTMLViewSource;

        // Get an EditPoint at the start of the text.
        TextWindow objTextWin;
        EditPoint ep;
        EditPoint ep2 = null;
        TextRanges textRanges = null;
        objTextWin = objHTMLWin.CurrentTabObject as TextWindow;
        ep = objTextWin.ActivePane.StartPoint.CreateEditPoint();
        textRanges = objTextWin.Selection.TextRanges;

        // Look for the end of the document body.
        if (ep.FindPattern 
        ("</body>",(int)vsFindOptions.vsFindOptionsNone, ref ep2, ref 
        textRanges))
            // Insert the contents of the file.
            ep.InsertFromFile (strFileName);
            // Switch back to the original view of the HTML file.
            objHTMLWin.CurrentTab = Tab;
    }
    else
        MessageBox.Show ("You must open an HTML document.");
}

Vedere anche

Riferimenti

Spazio dei nomi EnvDTE90