SilverScreen Solid Modeler

TempfileClose Event

TempfileClose Event

Previous topic Next topic  

TempfileClose Event

Previous topic Next topic JavaScript is required for the print function  

SilverSharpAPI

 

The TempfileClose Event

 

Synopsis

The TempfileClose event is raised when SilverSharp closes a temporary file.

 

 

Delegate

The TempfileClose delegate is declared as follows:

 

C# Code

 

 delegate void TempfileCloseEventHandler(string path);

 

 

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 TempfileClose delegate declares a function signature that must be used when installing an event handler for the TempfileClose event.

 

 

Event

The TempfileClose event is declared within Events as follows:

 

C# Code

 

 static event TempfileCloseEventHandler TempfileClose;

 

 

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

 

 

Raise method

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

 

C# Code

 

 static void RaiseTempfileClose(string path)

 

 

The SilverSharp assembly will automatically raise the TempfileClose event whenever a temporary file is closed. 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 TempfileClose event.

 

 

See Also

Events, TempfileCreate, set_tempfile_close_handler

 

Example

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

 

C# Code

   

 using SilverSharp;

 

 . . .

 

 void OnTempfileClose(string path)

    {

    // Take action appropriate for the closing of a temporary file

    }

 

 

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

 

C# Code

   

Events.TempfileClose += new TempfileCloseEventHandler(this.OnTempfileClose);

 

 

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

 

C# Code

   

Events.TempfileClose -= new TempfileCloseEventHandler(this.OnTempfileClose);