HostProtectionAttribute.SelfAffectingThreading Propiedad

Definición

Obtiene o establece un valor que indica si el subproceso con efecto sobre sí mismo está expuesto.

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 de propiedad

Boolean

Es true si el subprocesamiento con efecto sobre sí mismo está expuesto a un riesgo; de lo contrario, es false. De manera predeterminada, es false.

Ejemplos

En el ejemplo de código siguiente se muestra el uso del HostProtectionAttribute atributo con la SelfAffectingThreading propiedad . Este ejemplo forma parte de un ejemplo más grande proporcionado para la HostProtectionAttribute clase .

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

Comentarios

El subproceso que afecta automáticamente manipula los subprocesos de una manera que solo afecta al código de usuario.

Se aplica a

Consulte también