Command.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
function get Name () : String
Özellik Değeri
Tür: System.String
Nesnenin adını gösteren bir dizedir.
Örnekler
public void CodeExample(DTE2 dte, AddIn addin)
{
try
{
// Show number of commands in Commands collection.
MessageBox.Show(dte.Commands.Count.ToString());
// Return the Commands collection for the application.
Commands cmdsColl = dte.Commands;
// Return a Command object.
Command cmdObj = cmdsColl.Item("File.NewFile", cmdsColl.Count);
// Show the fullname of Command object's application object.
MessageBox.Show(cmdObj.DTE.FullName);
// Display the Command object's name.
MessageBox.Show(cmdObj.Name);
// Display whether the Command object's containing collection
// is the same as the application object's Commands collection.
string message;
if (cmdsColl.Equals(cmdObj.Collection))
message = "Same collection!";
else
message = "Different collection!";
MessageBox.Show(message);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
.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 kod kitaplıklarını kullanma.
Ayrıca bkz.
Başvuru
Diğer Kaynaklar
Nasıl yapılır: derlemek ve Otomasyon nesne modeli kod örneklerini çalıştırmak