示例#1
0
        private void btnGeneralStart_Click(object sender, EventArgs e)
        {
            int portMax = 0;

            if (textBoxGeneralMax.Text.Length == 0 ||
                false == int.TryParse(textBoxGeneralMax.Text, out portMax))
            {
                MessageBox.Show("Invalid data");
                return;
            }

            int portMin = 0;

            if (textBoxGeneralMin.Text.Length == 0 ||
                false == int.TryParse(textBoxGeneralMin.Text, out portMin))
            {
                MessageBox.Show("Invalid data");
                return;
            }

            // initialize vnc client
            vncClient = new VncMarshall.Client(vncServerPath);

            // save the matrix setting
            desktopRow    = Convert.ToInt32(numericUpDownRow.Value);
            desktopColumn = Convert.ToInt32(numericUpDownCol.Value);

            // start the server
            int portOpened = connectionMgr.StartServer(portMin, portMax);

            if (portOpened == -1)
            {
                // error start server
                MessageBox.Show("Error start server", "Error");
                return;
            }


            this.Text             = String.Format("Vistrol Server (Listening Port: {0})", portOpened);
            notifyIconServer.Text = String.Format("Vistrol server is running at port {0}", portOpened);

            refreshGeneralPanel();

            // save current setting to db
            mainPresenter.PortMin      = portMin;
            mainPresenter.PortMax      = portMax;
            mainPresenter.ScreenColumn = desktopColumn;
            mainPresenter.ScreenRow    = desktopRow;
            mainPresenter.VncPath      = vncServerPath;

            // open the telnet command listening
            CommandParser.GetInstance().Initialize(vncClient, connectionPresenter.runningWndsMgr);
            Provider = new TelnetServiceProvider();
            Servidor = new SocketCommand.TcpServer(Provider, Properties.Settings.Default.TelnetPort);
            Servidor.Start();
        }
示例#2
0
 public void Initialize(VncMarshall.Client vncClient, Windows.WindowsAppMgr wndMgr)
 {
     _clearWall          = new ClearWall(wndMgr);
     _creatPreset        = new CreatePreset();
     _getInputSourceList = new GetInputSourceList();
     _getPresetList      = new GetPresetList();
     _getRemoteList      = new GetRemoteList();
     _getWndList         = new GetWindowList();
     _launchInputSource  = new LaunchInputSource();
     _launchPreset       = new LaunchPreset(vncClient);
     _launchRemote       = new LaunchRemote(vncClient);
     _messageBox         = new MessageBox();
     _removePreset       = new RemovePreset();
 }
示例#3
0
 public LaunchRemote(VncMarshall.Client vncClient)
 {
     this._vncClient = vncClient;
 }
示例#4
0
 public ClientPresetCmdImpl(IServer server, int userId, VncMarshall.Client vncClient)
 {
     this.clientId  = userId;
     this.server    = server;
     this.vncClient = vncClient;
 }
示例#5
0
 /// <summary>
 /// constructor for external class used (telnet)
 /// </summary>
 public ClientPresetCmdImpl(VncMarshall.Client vncClient)
 {
     this.vncClient = vncClient;
 }
示例#6
0
 public LaunchPreset(VncMarshall.Client vncClient)
 {
     this.vncClient = vncClient;
 }
示例#7
0
 public ClientVncCmdImpl(IServer server, VncMarshall.Client vncClient)
 {
     this.vncClientImpl = vncClient;
     this.server        = server;
 }