AddInSegmentType 枚举

定义

指定管线段的类型。

public enum class AddInSegmentType
public enum AddInSegmentType
type AddInSegmentType = 
Public Enum AddInSegmentType
继承
AddInSegmentType

字段

AddIn 5

指定外接程序段。

AddInSideAdapter 3

指定外接程序端适配器段。

AddInView 4

指定外接程序视图段。

Contract 2

指定协定段。

HostSideAdapter 1

指定宿主端适配器段。

HostViewOfAddIn 0

指定外接程序段的宿主视图。

示例

以下示例使用 AddInSegmentType 枚举来评估外接程序的限定数据。

// 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

注解

在此上下文中,管道段的类型标识管道段的类别:外接程序、外接程序端适配器、外接程序视图、协定、主机端适配器或外接程序的主机视图。 如果管道段的类具有QualificationDataAttribute属性,则可以使用 对象的 属性AddInToken获取属性QualificationData中指定的数据。

适用于