Project

General

Profile

Download (1.15 KB) Statistics
| Branch: | Revision:
1
define([
2
'dojo/_base/declare',
3
'dojo/_base/connect',           
4
'dojo/_base/lang',
5
'vnc/Viewer',
6
'rdp/Viewer'
7
], function(declare, connect, lang, VncViewer, RdpViewer){
8
    
9
    return declare('evd.Display', null, {
10
        // A wrapper around rdp and vnc.
11
        
12
        viewer: null,
13

    
14
        constructor: function(args){
15
            if(args.type == 'rdp'){
16
                this.viewer = new RdpViewer(args);
17
            }
18
            else if(args.type == 'vnc'){
19
                this.viewer = new VncViewer(args);
20
            }
21
            else{
22
                throw 'display::start no display type supplied';
23
            }
24
     
25
            connect.connect(this.viewer, 'onDestroy', lang.hitch(this, function(){
26
                this.onDestroy();
27
            }));
28
     
29
            connect.connect(this.viewer, 'onStart', lang.hitch(this, function(){
30
                this.onStart();
31
            }));
32
     
33
        },
34
     
35
        start: function(){
36
            this.viewer.start();
37
        },
38
                     
39
        stop: function(){
40
            this.viewer.stop();
41
        },
42
     
43
        onDestroy: function(){},
44
        onStart: function(){}
45

    
46
    });    
47
});
(1-1/6)