How to: Use Qualification Data
You can assign qualification data to a pipeline segment for any purpose, by applying one or more QualificationDataAttribute attributes to the segment. Each attribute specifies a simple name/value pair of string data. For example, you might indicate that an add-in should be activated with full trust by specifying the name/value pair "Security" and "FullTrust". Similarly, you might indicate that a pipeline segment should be isolated in its own process by specifying the name/value pair "Isolation" and "NewProcess".
To apply qualification data to a pipeline segment
Use the QualificationDataAttribute attribute.
' This pipeline segment has ' two attributes: ' 1 - An AddInAttribute to identify ' this segment as an add-in. ' ' 2 - A QualificationDataAttribute to ' indicate that the add-in should ' be loaded into a new application domain. <AddIn("Calculator Add-in", Version:="18.104.22.168")> _ <QualificationData("Isolation", "NewAppDomain")> _ Public Class SampleV2AddIn
To determine the qualification data for a particular pipeline segment
Use the QualificationData property on an AddInToken object to get a dictionary of segments and their qualification data associated with the token, and then use the appropriate AddInSegmentType value to get a dictionary that contains the name/value pairs that comprise the qualification data for the desired segment.
' 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
If there is no qualification data for a segment, its dictionary of name/value pairs is empty.
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.