共用方式為


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中指定的數據。

適用於