AddInToken.GetEnumerator Method ()

 

Returns an enumerator for the qualification data of the pipeline segments that are associated with this token.

Namespace:   System.AddIn.Hosting
Assembly:  System.AddIn (in System.AddIn.dll)

public IEnumerator<QualificationDataItem> GetEnumerator()

Return Value

Type: System.Collections.Generic.IEnumerator<QualificationDataItem>

An enumerator that can be used to iterate through the qualification data of the pipeline segments that are associated with the current token.

Use this method to treat a token as if it were a collection of qualification data items, for example, in a foreach statement (For Each in Visual Basic, for each in Visual C++).

Use the enumerator returned by this method to iterate through the qualification data items of the pipeline segments associated with the current token. Each item of qualification data is a QualificationDataItem structure that identifies the pipeline segment and contains a name/value pair from a QualificationDataAttribute attribute applied to that segment.

System_CAPS_noteNote

The add-in model does not use qualification data that is applied to the host view of the add-in. As a result, when you enumerate qualification data you will not find any items whose Segment property is AddInSegmentType.HostViewOfAddIn.

Alternatively, you can use the QualificationData property to get a nested set of dictionaries that contain the qualification data of the pipeline segments.

The following example lists the qualification data for the pipeline segments associated with each AddInToken in a collection of tokens.

// Show the qualification data for each
// token in an AddInToken collection.
foreach (AddInToken token in tokens)
{
    foreach (QualificationDataItem qdi in token)
    {
        Console.WriteLine("{0} {1}\n\t QD Name: {2}, QD Value: {3}",
            token.Name,
            qdi.Segment, 
            qdi.Name, 
            qdi.Value);
    }
}

.NET Framework
Available since 3.5
Return to top
Show: