Expression.Collection Özellik
Bu kod yapýsýný içinde bulunan ya da bu özelliği destekleyen nesneyi içeren koleksiyon alır.
Ad alanı: EnvDTE
Derleme: EnvDTE (EnvDTE.dll içinde)
Sözdizimi
'Bildirim
ReadOnly Property Collection As Expressions
Expressions Collection { get; }
property Expressions^ Collection {
Expressions^ get ();
}
abstract Collection : Expressions
function get Collection () : Expressions
Özellik Değeri
Tür: EnvDTE.Expressions
Bir Expressions koleksiyonu.
Örnekler
Aşağıdaki örnek, nasıl kullanılacağını gösterir Collection özelliği.
Bu özellik test etmek için:
Hedef uygulama sınıfı a. içermelidirAna işlevi bir Aranan sınıfının bir örneğini oluşturmalısınız "a".
Bir kesme noktası ana işlevinde a sınıfının bir örneği oluşturulur ve üye değişkenlerini başlatıldıktan sonra ayarlayın.
Hedef uygulama hata ayıklama modunda çalıştırın.
Uygulama kesme noktasında durur eklentiyi çalıştırın.
public static void Collection(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("Collection Property Test");
owp.Activate();
EnvDTE.Expression exp = dte.Debugger.GetExpression("a", true, 1);
EnvDTE.Expressions exps = exp.DataMembers;
owp.OutputString("\nExpression count: " + exps.Count);
owp.OutputString("\nEdition of the environment: " + exps.DTE.Edition);
owp.OutputString("\nThe name of the current program: " +
exps.Parent.CurrentProgram.Name);
owp.OutputString("\nSecond expression: " + exps.Item(2).Name);
}
Shared Sub Collection(ByRef dte As EnvDTE.DTE)
Dim exp As EnvDTE.Expression = dte.Debugger.GetExpression("a", True, 1)
Dim exps As EnvDTE.Expressions = exp.DataMembers
Dim str As String = vbCrLf
str = "Expression count: " + exps.Count.ToString()
str += vbCrLf + "Edition of the environment: " + exps.DTE.Edition
str += vbCrLf + "The name of the current program: " + _
exps.Parent.CurrentProgram.Name
str += vbCrLf + "Second expression: " + exps.Item(2).Name
MessageBox.Show(str, "Expression Test - Collection Property")
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 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