SilverScreen Solid Modeler

StatusChange Event

StatusChange Event

Previous topic Next topic  

StatusChange Event

Previous topic Next topic JavaScript is required for the print function  

SilverSharpAPI

 

The StatusChange Event

 

Synopsis

The StatusChange event is raised when SilverSharp status information changes. This is similar to the LocationChange event, but it is called  with more frequency for general drawing state changes.

 

 

Delegate

The StatusChange delegate is declared as follows:

 

C# Code

 

 delegate void StatusChangeEventHandler();

 

 

A delegate is similar to a C/C++ function pointer, but delegates are type-safe and can only refer to a method that matches the signature of the delegate. The StatusChange delegate declares a function signature that must be used when installing an event handler for the StatusChange event.

 

 

Event

The StatusChange event is declared within Events as follows:

 

C# Code

 

 static event StatusChangeEventHandler StatusChange;

 

 

StatusChange allows your application to subscribe to or unsubscribe from the StatusChange event.

 

 

Raise method

The method to raise the StatusChange event is declared within Events as follows:

 

C# Code

 

 static void RaiseStatusChange();

 

 

The SilverSharp assembly will automatically raise the StatusChange event when the general drawing state changes. It would not be typical for a SilverSharp application to raise the event itself.

 

 

Remarks

It is not necessary for a SilverSharp application to establish a handler for the StatusChange event.

 

 

See Also

Events, set_status_change_handler

 

Example

The following C# code for WPF shows a sample StatusChange event handler. Note that the method declaration must match the delegate for this event in parameters and return type:

 

C# Code

   

 using SilverSharp;

 

 . . .

 

 void OnStatusChange()

    {

    // Take action appropriate for a change of drawing status

    }

 

 

The following code shows how to subscribe to the StatusChange event, assigning the above handler:

 

C# Code

   

 Events.StatusChange += new StatusChangeEventHandler(this.OnStatusChange);

 

 

The following code shows how to unsubscribe from the StatusChange event, removing the above handler:

 

C# Code

   

 Events.StatusChange -= new StatusChangeEventHandler(this.OnStatusChange);