HTMLWindow3 Arabirim
Bir html belge penceresinde temsil Visual Studio tümleşik geliştirme ortamı (IDE).
Ad alanı: EnvDTE90
Derleme: EnvDTE90 (EnvDTE90.dll içinde)
Sözdizimi
'Bildirim
<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
HTMLWindow3 türü aşağıdaki üyeleri ortaya koyar.
Özellikler
Ad | Açıklama | |
---|---|---|
![]() |
CurrentPane | Alır veya geçerli bir html düzenleyicisi penceresinde türünü ayarlar. |
![]() |
CurrentView | Alır veya ayarlar html düzenleyicisi penceresinde kaynak, Tasarımcı veya bölünmüş olup olmadığını görüntüleyin. |
Üst
Yöntemler
Ad | Açıklama | |
---|---|---|
![]() |
WaitForBackgroundProcessingComplete | Arka plan işlemleri tamamlanıncaya kadar yürütme duraklatır program. |
Üst
Açıklamalar
HTMLWindow3tarafından döndürülen Object özelliği Window nesne olduğunda belgenin bir html belgesi. Window.Selectionve Document.Selection döndüren bir TextSelection nesnesi, CurrentTab özelliği ayarlanmış vsHTMLTabsSource.
HTMLWindow3, vsHTMLPanes ve vsHTMLViews Bölünmüş görünümde Tanıtımı ile eklenen Visual Studio 2008 html düzenleyicisi. Bölünmüş görünüm sekmesini tıklatın ve görünümü öğeleri html Düzenleyicisi penceresinin ayırır. (Tasarım veya kaynak için) görünümü arasında geçiş yapma (Split/tasarım/kaynağı) sekmesinde geçiş gelmez. Örneğin, bölünmüş sekmesini tıklatın, görünüm tasarımı ve kaynak arasında geçiş sekmesini değiştirmez, yalnızca etkinleştirir veya bölünmüş görünümde tasarım ve kaynak bölümleri devre dışı bırakır.
Visual Studio 2008 HTMLWindow Şimdi de uyguladığı nesne HTMLWindow3 Geçerli görünümde (Tasarım ya da kaynak) ve geçerli bölmesi (sekmesinde, tasarım, kaynak veya bölünmüş) döndüren arabirim.
HTMLWindow3 kuralları
Davranışını HTMLWindow3 olan:
Get
Geçerli bölmesi (sekme) |
Geçerli görünüm verir |
---|---|
Ya da vsHTMLViewDesign veya vsHTMLViewSource, hangi bağlı parçasıdır etkin. |
Set
Geçerli bölmesi (sekme) |
Ayar |
---|---|
|
|
|
|
|
Örnekler
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.");
}