C# 클래스 HFMCmd.ProgressMonitor

Utility class that can be used to monitor the progress of long-running operations via a separate thread. Supports both synchronous and asyncrhonous modes of operation (i.e. where the long-running operation is blocking or non-blocking).
파일 보기 프로젝트 열기: agardiner/hfmcmd

공개 프로퍼티들

프로퍼티 타입 설명
PollingInterval int

보호된 프로퍼티들

프로퍼티 타입 설명
SLEEP_INTERVAL int
_log log4net.ILog
_monitorThread Thread
_output IOutput

공개 메소드들

메소드 설명
AsyncComplete ( ) : void

When an async operation is complete, this method should be called so that the main thread waits for the monitor thread to end and clean up the progress display.

MonitorProgress ( GetProgress progressFn ) : void

Monitors progress of an operation executing asynchronously in another thread. The supplied callback is used to determine the completion progress of the operation, and whether or not it is still running. This method blocks until the callback sets the isRunning parameter to false, or the IOutput instance indicates the operation should be cancelled, e.g. because the user hits the Escape key. For a non-blocking alternative, use MonitorProgressAsync.

MonitorProgressAsync ( GetProgress progressFn ) : void

Monitors progress of a synchronously executing (i.e. blocking) operation. This method spins up a background thread to poll the operation status, and so it returns immediately. Use this method when you want to monitor the progress of a long-running, blocking operation. Be sure to call this method immediately prior to invoking the operation.

ProgressMonitor ( IOutput output ) : System

Constructs a progress monitor for tracking the progress of a long- running operation and updating the progress status via an IOutput instance. Progress will be measured in percentage terms.

메소드 상세

AsyncComplete() 공개 메소드

When an async operation is complete, this method should be called so that the main thread waits for the monitor thread to end and clean up the progress display.
public AsyncComplete ( ) : void
리턴 void

MonitorProgress() 공개 메소드

Monitors progress of an operation executing asynchronously in another thread. The supplied callback is used to determine the completion progress of the operation, and whether or not it is still running. This method blocks until the callback sets the isRunning parameter to false, or the IOutput instance indicates the operation should be cancelled, e.g. because the user hits the Escape key. For a non-blocking alternative, use MonitorProgressAsync.
public MonitorProgress ( GetProgress progressFn ) : void
progressFn GetProgress
리턴 void

MonitorProgressAsync() 공개 메소드

Monitors progress of a synchronously executing (i.e. blocking) operation. This method spins up a background thread to poll the operation status, and so it returns immediately. Use this method when you want to monitor the progress of a long-running, blocking operation. Be sure to call this method immediately prior to invoking the operation.
public MonitorProgressAsync ( GetProgress progressFn ) : void
progressFn GetProgress
리턴 void

ProgressMonitor() 공개 메소드

Constructs a progress monitor for tracking the progress of a long- running operation and updating the progress status via an IOutput instance. Progress will be measured in percentage terms.
public ProgressMonitor ( IOutput output ) : System
output IOutput
리턴 System

프로퍼티 상세

PollingInterval 공개적으로 프로퍼티

public int PollingInterval
리턴 int

SLEEP_INTERVAL 보호되어 있는 정적으로 프로퍼티

protected static int SLEEP_INTERVAL
리턴 int

_log 보호되어 있는 정적으로 프로퍼티

protected static ILog,log4net _log
리턴 log4net.ILog

_monitorThread 보호되어 있는 프로퍼티

protected Thread _monitorThread
리턴 Thread

_output 보호되어 있는 프로퍼티

protected IOutput _output
리턴 IOutput