C# 클래스 Exrin.Common.ThreadHelper

파일 보기 프로젝트 열기: exrin/Exrin

공개 메소드들

메소드 설명
Init ( SynchronizationContext uiContext ) : void
IsOnUIThread ( SynchronizationContext context ) : bool

Determines if the current synchronization context is the UI Thread

RunOnUIThread ( System.Action action ) : void

Will run the Action on the UI Thread. PERFORMANCE: Do not use in a loop. Context switching can cause significant performance degradation. Call this as infrequently as possible.

RunOnUIThread ( Func action ) : void

Will run the Func on the UI Thread. PERFORMANCE: Do not use in a loop. Context switching can cause significant performance degradation. Call this as infrequently as possible.

RunOnUIThreadAsync ( Func action ) : Task

Will run the Func on the UIThread asynchronously. PERFORMANCE: Do not use in a loop. Context switching can cause significant performance degradation. Call this as infrequently as possible.

비공개 메소드들

메소드 설명
RunOnUIThreadHelper ( System.Action action ) : Task
RunOnUIThreadHelper ( Func action ) : Task
RunSync ( Func task ) : void

메소드 상세

Init() 공개 정적인 메소드

public static Init ( SynchronizationContext uiContext ) : void
uiContext System.Threading.SynchronizationContext
리턴 void

IsOnUIThread() 공개 정적인 메소드

Determines if the current synchronization context is the UI Thread
public static IsOnUIThread ( SynchronizationContext context ) : bool
context System.Threading.SynchronizationContext SynchronizationContext you want to compare with the UIThread SynchronizationContext
리턴 bool

RunOnUIThread() 공개 정적인 메소드

Will run the Action on the UI Thread. PERFORMANCE: Do not use in a loop. Context switching can cause significant performance degradation. Call this as infrequently as possible.
public static RunOnUIThread ( System.Action action ) : void
action System.Action
리턴 void

RunOnUIThread() 공개 정적인 메소드

Will run the Func on the UI Thread. PERFORMANCE: Do not use in a loop. Context switching can cause significant performance degradation. Call this as infrequently as possible.
public static RunOnUIThread ( Func action ) : void
action Func
리턴 void

RunOnUIThreadAsync() 공개 정적인 메소드

Will run the Func on the UIThread asynchronously. PERFORMANCE: Do not use in a loop. Context switching can cause significant performance degradation. Call this as infrequently as possible.
public static RunOnUIThreadAsync ( Func action ) : Task
action Func
리턴 Task