SilverScreen Solid Modeler

The Events class

The Events class

Previous topic Next topic  

The Events class

Previous topic Next topic JavaScript is required for the print function  

SilverSharpAPI

 

SilverSharp.Events

 

Synopsis

The Events class is where you'll find SilverSharp event handlers for common application events. It is the SilverSharp equivalent of the SilverEngine callback mechanism.

 


Delegates

The following code shows the delegate definitions used by the Events class:

 

C# Code

 

 delegate void LocationChangeEventHandler();

 

 delegate void MessageAreaConfigureEventHandler(int    lines,

                                                SS_RGB bg_rgb);

 

 delegate void MessageAreaWriteEventHandler(string message,

                                            int    line,

                                            SS_RGB fg_rgb);

 

 delegate void QMessageEventHandler(string message,

                                    SS_RGB foreground,

                                    SS_RGB background);

 

 delegate void ShowErrorEventHandler(string message,

                                     string title);

 

 delegate void StatusChangeEventHandler();

 

 delegate void TempfileCloseEventHandler(string path);

 

 delegate void TempfileCreateEventHandler(string path);

 

 

 


Structure

The following code shows the Events class declaration, which includes events and methods to raise them:

 

C# Code

 

 class Events sealed abstract

    {

    static event LocationChangeEventHandler       LocationChange;

    static event MessageAreaConfigureEventHandler MessageAreaConfigure;

    static event MessageAreaWriteEventHandler     MessageAreaWrite;

    static event QMessageEventHandler             QMessage;

    static event ShowErrorEventHandler            ShowError;

    static event StatusChangeEventHandler         StatusChange;

    static event TempfileCloseEventHandler        TempfileClose;

    static event TempfileCreateEventHandler       TempfileCreate;

       

    static void RaiseLocationChange();

 

    static void RaiseMessageAreaConfigure(int    lines,

                                          SS_RGB bg_rgb);

 

    static void RaiseMessageAreaWrite(string message,

                                      int    line,

                                      SS_RGB fg_rgb);

 

    static void RaiseQMessage(string text,

                              SS_RGB fg,

                              SS_RGB bg);

 

    static void RaiseShowError(string message,

                               string title);

         

    static void RaiseStatusChange();

         

    static void RaiseTempfileClose(string path);

         

    static void RaiseTempfileCreate(string path);

    };

 

 


Remarks

Each event is organized into 3 parts: a delegate, an event, and a function to raise the event. For instance, the ShowError event makes use of a delegate called ShowErrorEventHandler and can be raised via the RaiseShowError method. The following is a table of events, along with associated delegates and methods.

 

Event

Delegate

Method to raise event

LocationChange

LocationChangeHandler

RaiseLocationChange

MessageAreaConfigure

MessageAreaConfigureHandler

RaiseMessageAreaConfigure

MessageAreaWrite

MessageAreaWriteHandler

RaiseMessageAreaWrite

QMessage

QMessageHandler

RaiseQMessage

ShowError

ShowErrorHandler

RaiseShowError

StatusChange

StatusChangeHandler

RaiseStatusChange

TempfileClose

TempfileCloseHandler

RaiseTempfileClose

TempfileCreate

TempfileCreateHandler

RaiseTempfileCreate

 

 

See Also

Callback Routine Types