C# 클래스 ProcessCallerLibrary.ProcessCaller

This class can launch a process (like a bat file, perl script, etc) and return all of the StdOut and StdErr to GUI app for display in textboxes, etc.
This class (c) 2003 Michael Mayer Use it as you like (public domain licensing). Please post any bugs / fixes to the page where you downloaded this code.
상속: System.ComponentModel.AsyncOperation
파일 보기 프로젝트 열기: swganhtools/anhtoolslibs 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
SleepTime int
m_EDone bool
m_PDone bool
m_SDone bool

공개 메소드들

메소드 설명
AddOutput ( string line ) : void
ProcessCaller ( ISynchronizeInvoke isi ) : System

Initialises a ProcessCaller with an association to the supplied ISynchronizeInvoke. All events raised from this object will be delivered via this target. (This might be a Control object, so events would be delivered to that Control's UI thread.)

보호된 메소드들

메소드 설명
DoWork ( ) : void

/// Initialises a ProcessCaller without an association to an /// ISynchronizeInvoke. All events raised from this object /// will be delievered via the worker thread. ///

Launch a process, but do not return until the process has exited. That way we can kill the process if a cancel is requested.

ReadStdErr ( ) : void

Handles reading of stdErr

ReadStdOut ( ) : void

Handles reading of stdout and firing an event for every line read

StartProcess ( ) : void

This method is generally called by DoWork() which is called by the base classs Start()

메소드 상세

AddOutput() 공개 메소드

public AddOutput ( string line ) : void
line string
리턴 void

DoWork() 보호된 메소드

/// Initialises a ProcessCaller without an association to an /// ISynchronizeInvoke. All events raised from this object /// will be delievered via the worker thread. /// Launch a process, but do not return until the process has exited. That way we can kill the process if a cancel is requested.
protected DoWork ( ) : void
리턴 void

ProcessCaller() 공개 메소드

Initialises a ProcessCaller with an association to the supplied ISynchronizeInvoke. All events raised from this object will be delivered via this target. (This might be a Control object, so events would be delivered to that Control's UI thread.)
public ProcessCaller ( ISynchronizeInvoke isi ) : System
isi ISynchronizeInvoke An object implementing the /// ISynchronizeInvoke interface. All events will be delivered /// through this target, ensuring that they are delivered to the /// correct thread.
리턴 System

ReadStdErr() 보호된 메소드

Handles reading of stdErr
protected ReadStdErr ( ) : void
리턴 void

ReadStdOut() 보호된 메소드

Handles reading of stdout and firing an event for every line read
protected ReadStdOut ( ) : void
리턴 void

StartProcess() 보호된 메소드

This method is generally called by DoWork() which is called by the base classs Start()
protected StartProcess ( ) : void
리턴 void

프로퍼티 상세

SleepTime 공개적으로 프로퍼티

Amount of time to sleep on threads while waiting for the process to finish.
public int SleepTime
리턴 int

m_EDone 공개적으로 프로퍼티

public bool m_EDone
리턴 bool

m_PDone 공개적으로 프로퍼티

public bool m_PDone
리턴 bool

m_SDone 공개적으로 프로퍼티

public bool m_SDone
리턴 bool