Bagikan melalui


AddInSegmentType Enum

Definisi

Menentukan jenis segmen alur.

public enum class AddInSegmentType
public enum AddInSegmentType
type AddInSegmentType = 
Public Enum AddInSegmentType
Warisan
AddInSegmentType

Bidang

AddIn 5

Menentukan segmen add-in.

AddInSideAdapter 3

Menentukan segmen adaptor add-in-side.

AddInView 4

Menentukan segmen tampilan add-in.

Contract 2

Menentukan segmen kontrak.

HostSideAdapter 1

Menentukan segmen adaptor sisi host.

HostViewOfAddIn 0

Menentukan tampilan host segmen add-in.

Contoh

Contoh berikut menggunakan AddInSegmentType enumerasi untuk mengevaluasi data kualifikasi add-in.

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

Keterangan

Dalam konteks ini, jenis segmen alur mengidentifikasi kategori segmen alur: add-in, adaptor add-in-side, tampilan add-in, kontrak, adaptor sisi host, atau tampilan host add-in. Jika kelas segmen alur memiliki QualificationDataAttribute atribut , Anda dapat memperoleh data yang ditentukan dalam atribut dengan QualificationData properti AddInToken objek .

Berlaku untuk