Verastream SDK .Net Reference
addIScreenListenerEx Method
Example 



For COM-based languages, pass in the dispatch ID. For .NET-based languages, a null parameter should be passed in. Then, manually set up the delegates for which the application would like to receive events.
Enables your application to receive various screen event notifications from the Screen object.
Syntax
'Declaration
 
Public Sub addIScreenListenerEx( _
   ByVal inListener As ScreenUPG _
) 
'Usage
 
Dim instance As ScreenUPG
Dim inListener As ScreenUPG
 
instance.addIScreenListenerEx(inListener)
public void addIScreenListenerEx( 
   ScreenUPG inListener
)
public:
void addIScreenListenerEx( 
   ScreenUPG^ inListener
) 

Parameters

inListener
For COM-based languages, pass in the dispatch ID. For .NET-based languages, a null parameter should be passed in. Then, manually set up the delegates for which the application would like to receive events.
Example
[C#] [VB]
class Program
{
	public ScreenUPG.ScreenUPG screen;
	public Program instance = new Program();
            
	// Delegate handlers
	public ScreenUPG.ScreenUPG.onConnectionLostHandler myConnectionLostHandler;
	public ScreenUPG.ScreenUPG.onScreenChangedHandler myScreenChangedHandler;
	public ScreenUPG.ScreenUPG.onScreenChangedHandler myScreenShapeChangedHandler;
	public ScreenUPG.ScreenUPG.onLostRemoteWindowHandler myLostRemoteWindowHandler;
	public ScreenUPG.ScreenUPG.onErrorHandler myErrorHandler;
            
	public void onScreenChanged()
	{
		....// TODO: Place your code here
	}
	
	public void onConnectionLost()
	{
		....// TODO: Place your code here
	}
	
	public void onError()
	{
		....// TODO: Place your code here
	}
	
	public void onScreenShapeChanged()
	{
		....// TODO: Place your code here
	}
	
	public void onLostRemoteWindow()
	{
		....// TODO: Place your code here
	}
	
	static void Main(string[] args)
	{
		SessionLoader.SessionLoader sl = new SessionLoader.SessionLoader();
		string xmlConfig = "your host XML configuration";
		screen = sl.requestScreenEx("", "", xmlConfig, 0);
		if (screen != null)
		{
			// Setup the delegates
			instance = new Program();
			myConnectionLostHandler = new ScreenUPG.ScreenUPG.onConnectionLostHandler(instance.onConnectionLost);
			screen.onConnectionLost += myConnectionLostHandler;
			myScreenChangedHandler = new ScreenUPG.ScreenUPG.onScreenChangedHandler(instance.onScreenChanged);
			screen.onScreenChanged += myScreenChangedHandler;
			myScreenShapeChangedHandler = new ScreenUPG.ScreenUPG.onScreenShapeChangedHandler(instance.onScreenShapeChanged);
			screen.onScreenShapeChanged += myScreenShapeChangedHandler;
			myLostRemoteWindowHandler = new ScreenUPG.ScreenUPG.onLostRemoteWindowHandler(instance.onLostRemoteWindow);
			screen.onLostRemoteWindow += myLostRemoteWindowHandler;
			myOnErrorHandler = new ScreenUPG.ScreenUPG.onErrorHandler(instance.onError);
			screen.onError += onErrorHandler;
            
			// Register a listener and it's delegates
			screen.addIScreenListenerEx(null);
            
			// Open host connection
			if (screen.Open())
			{
				....// TODO: Place your code here
			}
		}
	}
}
Dim WithEvents screen As ScreenUPG.ScreenUPG
            
Private Sub screen_onConnectionLost()
'TODO: Place your code here
End Sub
            
Private Sub screen_onError()
'TODO: Place your code here
End Sub
            
Private Sub screen_onScreenChanged()
'TODO: Place your code here
End Sub
            
Private Sub screen_onScreenShapeChanged()
'TODO: Place your code here
End Sub
            
Private Sub screen_onLostRemoteWindow()
'TODO: Place your code here
End Sub
            
Private Sub addScreenListener()
screen.addIScreenListenerEx screen
End Sub
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also