HostProtectionAttribute.SelfAffectingThreading Propriedade

Definição

Obtém ou define um valor que indica se threading autorrealizado é exposto.Gets or sets a value indicating whether self-affecting threading is exposed.

public:
 property bool SelfAffectingThreading { bool get(); void set(bool value); };
public bool SelfAffectingThreading { get; set; }
member this.SelfAffectingThreading : bool with get, set
Public Property SelfAffectingThreading As Boolean

Valor da propriedade

Boolean

true Se o encadeamento autoafetado for exposto; caso contrário, false .true if self-affecting threading is exposed; otherwise, false. O padrão é false.The default is false.

Exemplos

O exemplo de código a seguir ilustra o uso do HostProtectionAttribute atributo com a SelfAffectingThreading propriedade.The following code example illustrates the use of the HostProtectionAttribute attribute with the SelfAffectingThreading property. Este exemplo faz parte de um exemplo maior fornecido para a HostProtectionAttribute classe.This example is part of a larger example provided for the HostProtectionAttribute class.

// Use the enumeration flags to indicate that this method exposes shared state, 
// self-affecting process management, and self-affecting threading.
// This method allows the user to quit the sample.

[HostProtection(SharedState=true,SelfAffectingProcessMgmt=true,
SelfAffectingThreading=true,UI=true)]
static void ExecuteBreak()
{
   Console::WriteLine( "Executing Debugger.Break." );
   Debugger::Break();
   Debugger::Log( 1, "info", "test message" );
}
// Use the enumeration flags to indicate that this method exposes shared 
// state, self-affecting process management, and self-affecting threading.
[HostProtectionAttribute(SharedState=true, SelfAffectingProcessMgmt=true,
     SelfAffectingThreading=true, UI=true)]
// This method allows the user to quit the sample.
private static void ExecuteBreak()
{
    Console.WriteLine("Executing Debugger.Break.");
    Debugger.Break();
    Debugger.Log(1,"info","test message");
}
' Use the enumeration flags to indicate that this method exposes shared
' state, self-affecting process management, and self-affecting threading.
<HostProtectionAttribute(SharedState := True, _
    SelfAffectingProcessMgmt := True, _
    SelfAffectingThreading := True, UI := True)> _
Private Shared Sub ExecuteBreak()

    ' This method allows the user to quit the sample.
    Console.WriteLine("Executing Debugger.Break.")
    Debugger.Break()
    Debugger.Log(1, "info", "test message")
End Sub

Comentários

Threads que afetam automaticamente manipula threads de uma maneira que afeta apenas o código do usuário.Self-affecting threading manipulates threads in a way that only affects user code.

Aplica-se a

Confira também