HostProtectionAttribute.SelfAffectingThreading 속성

정의

자체 영향 스레딩이 노출되는지 여부를 나타내는 값을 가져오거나 설정합니다.

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

속성 값

Boolean

자체 영향 스레딩이 노출되면 true이고, 그렇지 않으면 false입니다. 기본값은 false입니다.

예제

다음 코드 예제에서는 속성과 HostProtectionAttribute 함께 특성을 사용하는 방법을 보여 줍니다 SelfAffectingThreading . 이 예제는에 대해 제공 된 큰 예제의 일부는 HostProtectionAttribute 클래스입니다.

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

설명

자체 영향을 주는 스레딩은 사용자 코드에만 영향을 주는 방식으로 스레드를 조작합니다.

적용 대상

추가 정보