SFSEvent is the class representing all events dispatched by the SmartFoxClient instance.
The SFSEvent class uses delegates to callback on specific event types.
The SFSEvent class uses delegates to callback on specific event types.

C# | Visual Basic | Visual C++ |
public class SFSEvent
Public Class SFSEvent
public ref class SFSEvent

All Members | Constructors | Methods | Fields | ||

Version:
1.0.0
Author:
Thomas Hentschel Lund
http://www.fullcontrol.dk
sfs-api@fullcontrol.dk
http://www.smartfoxserver.com
http://www.gotoandplay.it

The following example show a generic usage of a SFSEvent. Please refer to the specific events for the return signature/parameters.
CopyC#NOTE: in the following examples, smartFox always indicates a SmartFoxClient instance.

using SmartFoxClientAPI; using SmartFoxClientAPI.Data; ...(+ all the System.* references) public partial class Page : UserControl { SmartFoxClient smartFox; public function MyTest() { // Create instance smartFox = new SmartFoxClient(); // Add event handler for connection SFSEvent.onConnection += OnConnection; // Connect to server smartFox.Connect("127.0.0.1", 4502) } // Handle connection event public void OnConnection(bool success, string error) { if (success) Debug.WriteLine("Great, successfully connected!"); else Debug.WriteLine("Ouch, connection failed!"); } }

Object | |
![]() | SFSEvent |