ServicesCtl.ProgressDialog Class Reference

This class encapsulates a dialog which more or less contains one progressbar. The class offers two public methods for showing the progress while starting/stopping a service. As soon as the service has been started/stopped the dialog closes. More...

List of all members.

Public Member Functions

 ProgressDialog ()
 Creates a new instance.
void StartService (ServiceController service)
 Monitors the start of a service.
void StopService (ServiceController service)
 Monitors the stop of a service.
void Cancel ()
 Closes the dialog and stops the monitor thread when running.

Protected Member Functions

override void Dispose (bool disposing)
 Clean up any resources being used.

Private Member Functions

delegate void SetTextCallback (string text)
 This delegate enables asynchronous calls for setting the text property of the labe1 TextBox control.
delegate void CloseDialogCallback ()
 This delegate enables asynchronous calls for Closing the dialog.
void DoStartService (object serviceObject)
 Thread Start method. This method delegates to DoService(ServiceController service, bool start).
void DoStopService (object serviceObject)
 Thread Start method. This method delegates to DoService(ServiceController service, bool start).
void DoService (ServiceController service, bool start)
 Checks the status of a service and closes the dialog when the final status has been reached.
void button1_Click (object sender, EventArgs e)
 Event handler for the cancel button.
void SetLabelText (string text)
 Sets the Text of this.label1.
void CloseDialog ()
 Closes the dialog.
void InitializeComponent ()
 Required method for Designer support - do not modify the contents of this method with the code editor.

Private Attributes

bool isRunning = false
 Thread synchronization object. true when the service is still being starting/stopping.
ResourceManager messages = null
 The private System.Resources.ResourceManager used for internationalization.
System.ComponentModel.IContainer components = null
 Required designer variable.


Detailed Description

This class encapsulates a dialog which more or less contains one progressbar. The class offers two public methods for showing the progress while starting/stopping a service. As soon as the service has been started/stopped the dialog closes.

StartService(ServiceController)


Constructor & Destructor Documentation

ServicesCtl.ProgressDialog.ProgressDialog (  ) 

Creates a new instance.

Initialize the Form and creates a ResourceManager.


Member Function Documentation

delegate void ServicesCtl.ProgressDialog.SetTextCallback ( string  text  )  [private]

This delegate enables asynchronous calls for setting the text property of the labe1 TextBox control.

Parameters:
text The already translated text

delegate void ServicesCtl.ProgressDialog.CloseDialogCallback (  )  [private]

This delegate enables asynchronous calls for Closing the dialog.

void ServicesCtl.ProgressDialog.StartService ( ServiceController  service  ) 

Monitors the start of a service.

Parameters:
service The service to monitor
This method monitors the start of a service. It creates a Thread which continously checks the status of the service. As soon as the service has reached the running status, the dialog is being closed.

void ServicesCtl.ProgressDialog.DoStartService ( object  serviceObject  )  [private]

Thread Start method. This method delegates to DoService(ServiceController service, bool start).

Parameters:
serviceObject The service to monitor

void ServicesCtl.ProgressDialog.StopService ( ServiceController  service  ) 

Monitors the stop of a service.

Parameters:
service The service to monitor
This method monitors the stop of a service. It creates a Thread which continously checks the status of the service. As soon as the service has reached the stopped status, the dialog is being closed.

void ServicesCtl.ProgressDialog.DoStopService ( object  serviceObject  )  [private]

Thread Start method. This method delegates to DoService(ServiceController service, bool start).

Parameters:
serviceObject The service to monitor

void ServicesCtl.ProgressDialog.DoService ( ServiceController  service,
bool  start 
) [private]

Checks the status of a service and closes the dialog when the final status has been reached.

Parameters:
service The service to monitor
start true when a service start should be monitored, false when a service stop should be monitored
This method refreshes the status of the service object continously and updates the status in the dialog according to the status. When the final status of the service has been reached (started or stopped) this method closes the dialog.

void ServicesCtl.ProgressDialog.Cancel (  ) 

Closes the dialog and stops the monitor thread when running.

void ServicesCtl.ProgressDialog.button1_Click ( object  sender,
EventArgs  e 
) [private]

Event handler for the cancel button.

Parameters:
sender sender
e EventArgs

void ServicesCtl.ProgressDialog.SetLabelText ( string  text  )  [private]

Sets the Text of this.label1.

Parameters:
text The text to set
This method handles calls from the UI and non-UI Threads.

void ServicesCtl.ProgressDialog.CloseDialog (  )  [private]

Closes the dialog.

This method handles calls from the UI and non-UI Threads.

override void ServicesCtl.ProgressDialog.Dispose ( bool  disposing  )  [protected]

Clean up any resources being used.

Parameters:
disposing true if managed resources should be disposed; otherwise, false.

void ServicesCtl.ProgressDialog.InitializeComponent (  )  [private]

Required method for Designer support - do not modify the contents of this method with the code editor.


Member Data Documentation

bool ServicesCtl.ProgressDialog.isRunning = false [private]

Thread synchronization object. true when the service is still being starting/stopping.

ResourceManager ServicesCtl.ProgressDialog.messages = null [private]

The private System.Resources.ResourceManager used for internationalization.

System.ComponentModel.IContainer ServicesCtl.ProgressDialog.components = null [private]

Required designer variable.


The documentation for this class was generated from the following files:
Generated on Tue May 1 16:31:06 2007 for ServiceCtl by  doxygen 1.5.2