Muokkaa

Jaa


AddInToken.QualificationData Property

Definition

Gets a dictionary of data about the segments in the pipeline associated with the current token.

public:
 property System::Collections::Generic::IDictionary<System::AddIn::Hosting::AddInSegmentType, System::Collections::Generic::IDictionary<System::String ^, System::String ^> ^> ^ QualificationData { System::Collections::Generic::IDictionary<System::AddIn::Hosting::AddInSegmentType, System::Collections::Generic::IDictionary<System::String ^, System::String ^> ^> ^ get(); };
public System.Collections.Generic.IDictionary<System.AddIn.Hosting.AddInSegmentType,System.Collections.Generic.IDictionary<string,string>> QualificationData { get; }
member this.QualificationData : System.Collections.Generic.IDictionary<System.AddIn.Hosting.AddInSegmentType, System.Collections.Generic.IDictionary<string, string>>
Public ReadOnly Property QualificationData As IDictionary(Of AddInSegmentType, IDictionary(Of String, String))

Property Value

A dictionary whose keys are pipeline segments and whose values are dictionaries of name/value pairs that represent qualification data for each segment.

Examples

The following example shows how to examine an add-in's qualification data.

// Use qualification data to control
// how an add-in should be activated.

if (selectedToken.QualificationData[AddInSegmentType.AddIn]["Isolation"].Equals("NewProcess"))
{
    // Create an external process.
    AddInProcess external = new AddInProcess();

    // Activate an add-in in the new process
    // with the full trust security level.
    Calculator CalcAddIn5 =
        selectedToken.Activate<Calculator>(external,
        AddInSecurityLevel.FullTrust);
    Console.WriteLine("Add-in activated per qualification data.");
}
else
{
    Console.WriteLine("This add-in is not designated to be activated in a new process.");
}
' Use qualification data to control
' how an add-in should be activated.

If selectedToken.QualificationData(AddInSegmentType.AddIn)("Isolation").Equals("NewProcess") Then
    ' Create an external process.
    Dim external As AddInProcess = New AddInProcess

    ' Activate an add-in in an automatically generated
    ' application domain with a full trust security level.
    Dim CalcAddin5 As Calculator = _
        selectedToken.Activate(Of Calculator)(external, _
            AddInSecurityLevel.FullTrust)
    Console.WriteLine("Add-in activated per qualification data.")
Else
    Console.WriteLine("This add-in is not designated to be activated in a new process.")
End If

Remarks

Use this property to obtain data that has been applied to pipeline segments with the QualificationDataAttribute attribute. You can use this data to identify and work with the types that compose your pipelines.

This property returns a dictionary of dictionaries. The top dictionary always has six keys. Each key is an AddInSegmentType value for a segment in the pipeline. Each value is a generic IDictionary<TKey,TValue> of strings with string keys that contains the segment's qualification data.

The keys and values of these inner dictionaries are the names and values specified in the QualificationDataAttribute attributes for the segments. If no qualification data has been applied to a segment, its dictionary is empty.

Note

The add-in model does not use qualification data that is applied to the host view of the add-in. As a result, the dictionary for AddInSegmentType.HostViewOfAddIn is always empty.

Alternatively, you can obtain qualification data by enumerating an AddInToken as if it were a collection of QualificationDataItem structures, using a foreach statement (For Each in Visual Basic, for each in Visual C++). See the example provided for the QualificationDataItem structure.

Applies to