OutputWindowPane.Clear - метод
Удаляет весь текст из окна OutputWindowPane.
Пространство имен: EnvDTE
Сборка: EnvDTE (в EnvDTE.dll)
Синтаксис
'Декларация
Sub Clear
void Clear()
void Clear()
abstract Clear : unit -> unit
function Clear()
Заметки
Удаляет весь текст из одной области.
Примеры
Sub ClearExample(ByVal dte As DTE2)
' Retrieve the Output window.
Dim outputWin As OutputWindow = dte.ToolWindows.OutputWindow
' Find the "Test Pane" Output window pane; if it does not exist,
' create it.
Dim pane As OutputWindowPane
Try
pane = outputWin.OutputWindowPanes.Item("Test Pane")
Catch
pane = outputWin.OutputWindowPanes.Add("Test Pane")
End Try
' Show the Output window and activate the new pane.
outputWin.Parent.AutoHides = False
outputWin.Parent.Activate()
pane.Activate()
' Add a line of text to the new pane.
pane.OutputString("Some text." & vbCrLf)
If MsgBox("Clear the Output window pane?", MsgBoxStyle.YesNo) = _
MsgBoxResult.Yes Then
pane.Clear()
End If
End Sub
public void ClearExample(DTE2 dte)
{
// Retrieve the Output window.
OutputWindow outputWin = dte.ToolWindows.OutputWindow;
// Find the "Test Pane" Output window pane; if it doesn't exist,
// create it.
OutputWindowPane pane = null;
try
{
pane = outputWin.OutputWindowPanes.Item("Test Pane");
}
catch
{
pane = outputWin.OutputWindowPanes.Add("Test Pane");
}
// Show the Output window and activate the new pane.
outputWin.Parent.AutoHides = false;
outputWin.Parent.Activate();
pane.Activate();
// Add a line of text to the new pane.
pane.OutputString("Some text." + "\r\n");
if (MessageBox.Show("Clear the Output window pane?", "",
MessageBoxButtons.YesNo) == DialogResult.Yes)
pane.Clear();
}
Безопасность платформы .NET Framework
- Полное доверие для непосредственно вызывающего метода. Этот член не может быть использован частично доверенным кодом. Для получения дополнительной информации см. Использование библиотек из не вполне надежного кода.
См. также
Ссылки
Другие ресурсы
Практическое руководство. Компиляция и выполнение примеров кода модели объектов автоматизации