wx.ProcessUtils.ProcessStarter Class Reference

List of all members.

Public Types

enum  Mode

Public Member Functions

delegate void HandlerProcessRefersToShellProcess (ShellProcessEvent evt)
delegate void HandlerProcessTerminated (ProcessTerminatedEvent evt)
 ProcessStarter (ProcessStartInfo progrmToRun)
 ProcessStarter (ProcessStartInfo programToRun, MsgEventHandler outputDataReceived, MsgEventHandler errorDataReceived)
 ProcessStarter (ProcessStartInfo programToRun, MsgEventHandler dataReceived)
System.Diagnostics.Process Start ()
bool WaitForExit (System.Diagnostics.Process process)

Static Public Member Functions

static void PostProcessTerminated (ProcessTerminatedEvent evt)

Static Public Attributes

static event
HandlerProcessRefersToShellProcess 
EvtFinishedShellProcess
static event
HandlerProcessTerminated 
EvtProcessTerminated
static event
HandlerProcessRefersToShellProcess 
EvtRunningShellProcess
static event
HandlerProcessRefersToShellProcess 
EvtStartedShellProcess

Properties

static Mode ConfiguredMode [get, set]
static Mode EffectiveMode [get]
System.Diagnostics.ProcessStartInfo StartInfo [get]


Detailed Description

Utility encapsulating start of oricesses using class System.Diagnostic.Process. Under Windows a process can be created using the ctor. However, under Unix this causes problems - and with MacOS maybe also. This class will use two modes: With Windows, this class will create a new instance of process and use the log events to enable external applications to analyse output on the output and error streams. On non-windows platforms, this will use the static methods for execution and raise the same events reading the output and error streams.

Member Enumeration Documentation

enum wx::ProcessUtils::ProcessStarter::Mode

Defines some opportunities to configure the use of the System.Diagnostics.Process class.

Enumerator:
Inactive  The panel is inactive.
KillProcess  User requested to kill a process.
WaitingForProcess  This bit is active iff this is waiting for the end of a process after a call to wx.Build.BuildConfig.WaitForExit().
UsePlatformID  The behaviour of this class will be determined with reference to the System.Environment.OSInfo.Platform property. Refer to the remarks on the class. This is the default.
UseStaticStart  Configures this class to use the static start method of the System.Diagnostics.Process class.
UseInstanceMethodStart  This will start the process using the instance method System.Diagnostics.Process.Start().


Constructor & Destructor Documentation

wx.ProcessUtils.ProcessStarter.ProcessStarter ( ProcessStartInfo  programToRun,
MsgEventHandler  dataReceived 
)

Creates an instance describing the program that shall be startet and providing event handlers for receiving output and error data.

Parameters:
programToRun Info to start the program
dataReceived Event handler that will be called on receiving output or error data. Please note, that this might be emulated, i.e. all events will be raised AFTER the process ended. Use null here if you do not want to use this feature.

wx.ProcessUtils.ProcessStarter.ProcessStarter ( ProcessStartInfo  programToRun,
MsgEventHandler  outputDataReceived,
MsgEventHandler  errorDataReceived 
)

Creates an instance describing the program that shall be startet and providing event handlers for receiving output and error data.

Parameters:
programToRun Info to start the program
outputDataReceived Event handler that will be called on receiving output data. Please note, that this might be emulated, i.e. all events will be raised AFTER the process ended. Use null here if you do not want to use this feature.
errorDataReceived Event handler that will be called on receiving error data. Please note, that this might be emulated, i.e. all events will be raised AFTER the process ended. Use null here if you do not want to use this feature.

wx.ProcessUtils.ProcessStarter.ProcessStarter ( ProcessStartInfo  progrmToRun  ) 

Creates an instance describing the program that shall be startet and providing event handlers for receiving output and error data.

Parameters:
programToRun Info to start the program


Member Function Documentation

delegate void wx.ProcessUtils.ProcessStarter.HandlerProcessRefersToShellProcess ( ShellProcessEvent  evt  ) 

delegate void wx.ProcessUtils.ProcessStarter.HandlerProcessTerminated ( ProcessTerminatedEvent  evt  ) 

static void wx.ProcessUtils.ProcessStarter.PostProcessTerminated ( ProcessTerminatedEvent  evt  )  [static]

This will post an event to all handlers registeredat EvtProcessTerminated.

Parameters:
evt The event that will be posted.

System.Diagnostics.Process wx.ProcessUtils.ProcessStarter.Start (  ) 

This starts the program that has been configured by the start info passed to the ctor and this will also raise all output events.

Returns:
Returns the process, that has been used. The result may be null if

bool wx.ProcessUtils.ProcessStarter.WaitForExit ( System.Diagnostics.Process  process  ) 

Use this after starting a process when waiting for termination. This method will raise a EvtStartedShellProcess in order to inform interested parties and then call System.Diagnostics.Process.WaitForExit().

This method will also raise events of type EvtRunningShellProcess in order to provide user interfaces with an opportunity to cancel the process. Finally, if the process has not been killed, this method raises an EvtFinishedShellProcess.

Parameters:
process Process that this trace shall wait for.
Returns:
True if process succeeded (error code 0).


Member Data Documentation

event HandlerProcessRefersToShellProcess wx.ProcessUtils.ProcessStarter.EvtFinishedShellProcess [static]

This event will be raised after a shell process terminated successfully.

event HandlerProcessTerminated wx.ProcessUtils.ProcessStarter.EvtProcessTerminated [static]

This will be raised when the build process terminates.

event HandlerProcessRefersToShellProcess wx.ProcessUtils.ProcessStarter.EvtRunningShellProcess [static]

This event will be raised while a shell process runs

event HandlerProcessRefersToShellProcess wx.ProcessUtils.ProcessStarter.EvtStartedShellProcess [static]

This event will be raised immediately after the build process started a shell process e.g. in order to run a command tool like a compiler.


Property Documentation

Mode wx.ProcessUtils.ProcessStarter.ConfiguredMode [static, get, set]

This is the mode that has been configured.

Mode wx.ProcessUtils.ProcessStarter.EffectiveMode [static, get]

This is the mode that will actually be used by the instances. This equals the configured mode with the exception of Mode.UsePlatformID that will be replaced according to the current platform.

System.Diagnostics.ProcessStartInfo wx.ProcessUtils.ProcessStarter.StartInfo [get]

Description of the program to run.


The wx.NET Build System.   (c) 2009-2010 Harald Meyer auf'm Hofe