Enables your application to receive various screen event notifications from the Screen object.


Namespace: ScreenUPG
Assembly: ScreenUPG (in ScreenUPG.dll)

Syntax

Visual Basic (Declaration)
Public Sub addIScreenListenerEx( _ 
   ByVal inListener As ScreenUPG _ 
)
C#
public void addIScreenListenerEx(
   ScreenUPG inListener
)
C++
public:
 void addIScreenListenerEx(
   ScreenUPG inListener
) sealed 
J#
public void addIScreenListenerEx(
   ScreenUPG inListener
)
JScript
public  function addIScreenListenerEx(
   inListener : ScreenUPG
)

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#]

 Copy Code
            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
                        }
                    }
                }
            }
            
[VB]
 Copy Code
            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
            

See Also