CommandWindow.OutputString - метод
Обновлен: Ноябрь 2007
Отправляет строку текста в окно Команда.
Пространство имен: EnvDTE
Сборка: EnvDTE (в EnvDTE.dll)
Синтаксис
'Декларация
Sub OutputString ( _
Text As String _
)
'Применение
Dim instance As CommandWindow
Dim Text As String
instance.OutputString(Text)
void OutputString(
string Text
)
void OutputString(
String^ Text
)
function OutputString(
Text : String
)
Параметры
- Text
Тип: System.String
Обязательный. Текстовые символы, направляемые в окно.
Заметки
OutputString не добавляет автоматически в строку символы новый строки. Для добавления этих символов в строку их необходимо добавить в Text.
Примеры
Sub CommandWinExample(ByVal dte As DTE)
' Get a reference to the Command window.
Dim win As Window = _
DTE.Windows.Item(EnvDTE.Constants.vsWindowKindCommandWindow)
Dim CW As CommandWindow = win.Object
' Input a command into the Command window and execute it.
CW.SendInput("nav https://www.microsoft.com", False)
' Insert some information text into the Command window.
CW.OutputString("This URL takes you to the main Microsoft _
website.")
' Clear the contents of the Command window.
MsgBox("Clearing the Command window...")
CW.Clear()
End Sub
void CommandWinExample(_DTE dte)
{
// Get a reference to the Command window.
Window win =
dte.Windows.Item(EnvDTE.Constants.vsWindowKindCommandWindow);
CommandWindow CW = (CommandWindow)win.Object;
// Input a command into the Command window and execute it.
CW.SendInput("nav https://www.microsoft.com", false);
// Insert some information text into the Command window.
CW.OutputString("This URL takes you to the main Microsoft
website.");
// Clear the contents of the Command window.
MessageBox.Show("Clearing the Command window...");
CW.Clear();
}
Разрешения
- Полное доверие для непосредственно вызывающего метода. Этот член не может быть использован частично доверенным кодом. Дополнительные сведения см. в разделе Использование библиотек из не вполне надежного кода.
См. также
Ссылки
Другие ресурсы
Практическое руководство. Компиляция и выполнение примеров кода модели объектов автоматизации