Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Gets if a code element has been injected by an attribute.
Namespace: Microsoft.VisualStudio.VCCodeModel
Assembly: Microsoft.VisualStudio.VCCodeModel (in Microsoft.VisualStudio.VCCodeModel.dll)
Syntax
'Declaration
ReadOnly Property IsInjected As Boolean
Get
bool IsInjected { get; }
property bool IsInjected {
bool get ();
}
abstract IsInjected : bool
function get IsInjected () : boolean
Property Value
Type: System.Boolean
true if this element was automatically generated by an attribute; otherwise, false.
Remarks
See How to: Compile Example Code for Visual C++ Code Model Extensibility for information on how to compile and run this sample.
Examples
This example iterates through all global VCCodeElement objects in a file and displays the names of those objects injected by attribute or macro expansions.
Sub InjectedObjects()
Dim vcCM As VCCodeModel
Dim vcCodeElement As VCCodeElement
vcCM = DTE.Solution.Item(1).CodeModel
For Each vcCodeElement In vcCM.CodeElements
If (vcCodeElement.IsInjected) Then
MsgBox(vcCodeElement.Name + " was injected.")
End If
Next
End Sub
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.