OnConnectionStatusUpdate()

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference > Common >

OnConnectionStatusUpdate()

Previous page Return to chapter overview Next page

Definition

An event driven method used which is called for every change in connection status.

 

Method Return Value

This method does not return a value.

 

Syntax
You must override the method in your indicator with the following syntax:

 

protected override void OnConnectionStatusUpdate(ConnectionStatusEventArgs connectionStatusUpdate)
{
 
}

 

 

Method Parameters

connectionStatusUpdate

A ConnectionStatusEventArgs object representing the most recent update in connection.        

 

 

Examples

ns

protected override void OnConnectionStatusUpdate(ConnectionStatusEventArgs connectionStatusUpdate)
{
  if(connectionStatusUpdate.Status == ConnectionStatus.Connected)
  {
    Print("Connected at " + DateTime.Now);
  }
 
  else if(connectionStatusUpdate.Status == ConnectionStatus.ConnectionLost)
  {
    Print("Connection lost at: " + DateTime.Now);
  }
}