Process.Name Özellik
Nesnenin adını alır.
Ad alanı: EnvDTE
Derleme: EnvDTE (EnvDTE.dll içinde)
Sözdizimi
'Bildirim
ReadOnly Default Property Name As String
string this { get; }
property String^ default {
String^ get ();
}
abstract Name : string with get
function get Name () : String
Özellik Değeri
Tür: String
Nesnenin adını temsil eden bir dize.
Örnekler
Aşağıdaki örnek, nasıl kullanılacağını gösterir Name özelliği.
Bu özellik sınamak için
Hedef uygulamanız bir kesme noktası ayarlayın.
Hedef uygulama hata ayıklama modunda çalıştırın.
Uygulama üzerinde kesme noktası durduğunda, eklentiyi çalıştırın.
public static void Name(DTE dte)
{
// Setup debug Output window.
Window w = (Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);
w.Visible = true;
OutputWindow ow = (OutputWindow)w.Object;
OutputWindowPane owp = ow.OutputWindowPanes.Add("Name Property Test");
owp.Activate();
owp.OutputString("\nEdition of the environment: " +
dte.Debugger.DebuggedProcesses.Item(1).DTE.Edition);
owp.OutputString("\nThe name of the current program: " +
dte.Debugger.DebuggedProcesses.Item(1).Name);
owp.OutputString("\nThe name of the current program: " +
dte.Debugger.DebuggedProcesses.Item(1).Parent.CurrentProgram.Name);
owp.OutputString("\nProcess ID: " +
dte.Debugger.DebuggedProcesses.Item(1).ProcessID);
EnvDTE.Programs programs =
dte.Debugger.DebuggedProcesses.Item(1).Programs;
owp.OutputString("\nThe name of the current program: " +
programs.Item(1).Name);
}
Shared Sub Name(ByRef dte As EnvDTE.DTE)
Dim str As String
Dim processes As EnvDTE.Processes = dte.Debugger.DebuggedProcesses
str = "Edition of the environment: " + processes.Item(1).DTE.Edition
str += vbCrLf + "The name of the current program: " + _
processes.Item(1).Name
str += vbCrLf + "The name of the current program: " + _
processes.Item(1).Parent.CurrentProgram.Name
str += vbCrLf + "Process ID: " + processes.Item(1).ProcessID.ToString()
str += vbCrLf + "The name of the current program: " + _
processes.Item(1).Programs.Item(1).Name
MessageBox.Show(str, "Name Property Test")
End Sub
.NET Framework Güvenliği
- Anında arayanlar için tam güven. Bu üye kısmen güvenilen kodla kullanılamaz. Daha fazla bilgi için bkz. Kısmen Güvenilen Koddan Kitaplıkları Kullanma.
Ayrıca bkz.
Başvuru
Diğer Kaynaklar
Nasıl yapılır: Otomasyon Nesne Modeli Kod Örnekleri Derleme ve Çalıştırma