AddIns.Item Method
Returns an AddIn object in an AddIns collection.
Namespace: EnvDTE
Assembly: EnvDTE (in EnvDTE.dll)
Syntax
'Declaration
Function Item ( _
index As Object _
) As AddIn
AddIn Item(
Object index
)
AddIn^ Item(
[InAttribute] Object^ index
)
abstract Item :
index:Object -> AddIn
function Item(
index : Object
) : AddIn
Parameters
index
Type: System.ObjectRequired. The index of the AddIn object to return.
Return Value
Type: EnvDTE.AddIn
A AddIn object.
Remarks
The Item method throws an ArgumentException exception if the collection cannot find the object that corresponds to the index value.
Examples
public void Example(DTE2 dte, AddIn addin)
{
try
{
AddIns addins = addin.Collection;
int c = addins.Count;
if (c > 0) // there is an addin
// Display the first (0) addins name
MessageBox.Show(addins.Item(1).Name);
// Show the addins top-level extensibility.
MessageBox.Show(addins.DTE.Name);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
.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.
See Also
Reference
Other Resources
How to: Compile and Run the Automation Object Model Code Examples