AddInSegmentType Wyliczenie

Definicja

Określa typ segmentu potoku.

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

Pola

AddIn 5

Określa segment dodatku.

AddInSideAdapter 3

Określa segment adaptera dodatkowego.

AddInView 4

Określa segment widoku dodatku.

Contract 2

Określa segment kontraktu.

HostSideAdapter 1

Określa segment adaptera po stronie hosta.

HostViewOfAddIn 0

Określa widok hosta segmentu dodatku.

Przykłady

W poniższym przykładzie użyto AddInSegmentType wyliczenia do oceny danych kwalifikacji dodatku.

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

Uwagi

W tym kontekście typ segmentu potoku identyfikuje kategorię segmentu potoku: dodatek, kartę dodatku, widok dodatku, kontrakt, kartę po stronie hosta lub widok hosta dodatku. Jeśli klasa segmentu potoku ma QualificationDataAttribute atrybut, można uzyskać dane określone w atrybucie z QualificationData właściwością AddInToken obiektu.

Dotyczy