Пример #1
0
        public AbstractActivatedState(Connection connection, ConnectionParameter param, TcpClient tcpControlConnection)
        {
            innerState                = InnerState.ACTIVE;
            this.connection           = connection;
            this.param                = param;
            this.tcpControlConnection = tcpControlConnection;
            this.stream               = tcpControlConnection.GetStream();
            this.mouse                = new MouseExecutor(connection.HeightClientMonitor, connection.WidthClientMonitor);
            this.keyboard             = new KeyboardExecutor();
            this.clipboard            = null;

            controlConnectionListener = new BackgroundWorker();
            controlConnectionListener.WorkerSupportsCancellation = true;
            controlConnectionListener.WorkerReportsProgress      = true;
            controlConnectionListener.DoWork             += controlConnectionListener_DoWork;
            controlConnectionListener.RunWorkerCompleted += controlConnectionListener_RunWorkerCompleted;
            controlConnectionListener.ProgressChanged    += controlConnectionListener_ProgressChanged;
            controlConnectionListener.RunWorkerAsync();

            clipboardWorker = new BackgroundWorker();
            clipboardWorker.WorkerSupportsCancellation = true;
            clipboardWorker.WorkerReportsProgress      = true;
            clipboardWorker.DoWork             += clipboardWorker_DoWork;
            clipboardWorker.RunWorkerCompleted += clipboardWorker_RunWorkerCompleted;
            clipboardWorker.ProgressChanged    += clipboardWorker_ProgressChanged;

            ListeningForMouse();
        }
Пример #2
0
 public ServerWindow()
 {
     InitializeComponent();
     Closing                 += ServerWindow_Closing;
     isConfigured             = false;
     isConnected              = false;
     isServerActive           = false;
     passwordChanged          = false;
     notifyServer             = new System.Windows.Forms.NotifyIcon();
     notifyServer.MouseClick += new System.Windows.Forms.MouseEventHandler(notifyServer_mouseClickEvent);
     notifyServer.MouseMove  += new System.Windows.Forms.MouseEventHandler(notifyServer_MouseMove);
     path = Directory.GetCurrentDirectory().Remove(Directory.GetCurrentDirectory().Length - 9);
     notifyServer.Icon            = new System.Drawing.Icon(path + "\\Punto_rosso.ico");
     status                       = new StatusWindow(this);
     this.WindowState             = WindowState.Normal;
     this.ShowInTaskbar           = true; //cosi non compare l'icona
     notifyServer.Visible         = true;
     notifyServer.BalloonTipTitle = "Server AVVIATO";
     notifyServer.BalloonTipText  = "Caricate le impostazioni di default\nPremi START per mettere il server in attesa di connessioni";
     notifyServer.ShowBalloonTip(300);
     connectionParameter = new ConnectionParameter();
     dispatcherTimer     = new System.Windows.Threading.DispatcherTimer();
     //questo metodo mi serve per inserire tutti gli indirizzi presente sulla macchina server
     caricaInfoIndirizzoServer();
     caricaInfoTextBox();
     stopButton.IsEnabled = false;
     stateLabel.Content   = NON_CONNESSO;
     contHour             = 0;
     contMin = 0;
     contSec = 0;
 }
        public AbstractActivatedState(Connection connection, ConnectionParameter param, TcpClient tcpControlConnection)
        {
            innerState = InnerState.ACTIVE;
            this.connection = connection;
            this.param = param;
            this.tcpControlConnection = tcpControlConnection;
            this.stream = tcpControlConnection.GetStream();
            this.mouse = new MouseExecutor(connection.HeightClientMonitor, connection.WidthClientMonitor);
            this.keyboard = new KeyboardExecutor();
            this.clipboard = null;

            controlConnectionListener = new BackgroundWorker();
            controlConnectionListener.WorkerSupportsCancellation = true;
            controlConnectionListener.WorkerReportsProgress = true;
            controlConnectionListener.DoWork += controlConnectionListener_DoWork;
            controlConnectionListener.RunWorkerCompleted += controlConnectionListener_RunWorkerCompleted;
            controlConnectionListener.ProgressChanged += controlConnectionListener_ProgressChanged;
            controlConnectionListener.RunWorkerAsync();

            clipboardWorker = new BackgroundWorker();
            clipboardWorker.WorkerSupportsCancellation = true;
            clipboardWorker.WorkerReportsProgress = true;
            clipboardWorker.DoWork += clipboardWorker_DoWork;
            clipboardWorker.RunWorkerCompleted += clipboardWorker_RunWorkerCompleted;
            clipboardWorker.ProgressChanged += clipboardWorker_ProgressChanged;

            ListeningForMouse();
        }
 public ServerWindow()
 {
     InitializeComponent();
     Closing += ServerWindow_Closing;
     isConfigured = false;
     isConnected = false;
     isServerActive = false;
     passwordChanged = false;
     notifyServer = new System.Windows.Forms.NotifyIcon();
     notifyServer.MouseClick += new System.Windows.Forms.MouseEventHandler(notifyServer_mouseClickEvent);
     notifyServer.MouseMove += new System.Windows.Forms.MouseEventHandler(notifyServer_MouseMove);
     path = Directory.GetCurrentDirectory().Remove(Directory.GetCurrentDirectory().Length - 9);
     notifyServer.Icon = new System.Drawing.Icon(path + "\\Punto_rosso.ico");
     status = new StatusWindow(this);
     this.WindowState = WindowState.Normal;
     this.ShowInTaskbar = true; //cosi non compare l'icona
     notifyServer.Visible = true;
     notifyServer.BalloonTipTitle = "Server AVVIATO";
     notifyServer.BalloonTipText = "Caricate le impostazioni di default\nPremi START per mettere il server in attesa di connessioni";
     notifyServer.ShowBalloonTip(300);
     connectionParameter = new ConnectionParameter();
     dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
     //questo metodo mi serve per inserire tutti gli indirizzi presente sulla macchina server
     caricaInfoIndirizzoServer();
     caricaInfoTextBox();
     stopButton.IsEnabled = false;
     stateLabel.Content = NON_CONNESSO;
     contHour = 0;
     contMin = 0;
     contSec = 0;
 }
Пример #5
0
 public AbstractConnectedState(Connection connection, ConnectionParameter param, TcpClient client)
 {
     isStopped = false;
     this.tcpControlConnection = client;
     this.stream                                          = tcpControlConnection.GetStream();
     this.param                                           = param;
     this.connection                                      = connection;
     controlConnectionListener                            = new BackgroundWorker();
     controlConnectionListener.DoWork                    += controlConnectionListener_DoWork;
     controlConnectionListener.RunWorkerCompleted        += controlConnectionListener_RunWorkerCompleted;
     controlConnectionListener.WorkerSupportsCancellation = true;
     controlConnectionListener.WorkerReportsProgress      = true;
     controlConnectionListener.ProgressChanged           += controlConnectionListener_ProgressChanged;
     controlConnectionListener.RunWorkerAsync();
     Trace.TraceInformation("Stato connesso.");
 }
 public AbstractConnectedState(Connection connection, ConnectionParameter param, TcpClient client)
 {
     isStopped = false;
     this.tcpControlConnection = client;
     this.stream = tcpControlConnection.GetStream();
     this.param = param;
     this.connection = connection;
     controlConnectionListener = new BackgroundWorker();
     controlConnectionListener.DoWork += controlConnectionListener_DoWork;
     controlConnectionListener.RunWorkerCompleted += controlConnectionListener_RunWorkerCompleted;
     controlConnectionListener.WorkerSupportsCancellation = true;
     controlConnectionListener.WorkerReportsProgress = true;
     controlConnectionListener.ProgressChanged += controlConnectionListener_ProgressChanged;
     controlConnectionListener.RunWorkerAsync();
     Trace.TraceInformation("Stato connesso.");
 }
 public AbstractDisconnectedState(Connection connection, ConnectionParameter param)
 {
     isStopped = false;
     this.connectionParameter = param;
     this.connection = connection;
     controlConnectionListener = new BackgroundWorker();
     controlConnectionListener.WorkerSupportsCancellation = true;
     controlConnectionListener.DoWork += controlConnectionListener_DoWork;
     controlConnectionListener.RunWorkerCompleted += controlConnectionListener_RunWorkerCompleted;
     workerBroadcast = new BackgroundWorker();
     workerBroadcast.DoWork += workerBroadcast_DoWork;
     workerBroadcast.RunWorkerCompleted += workerBroadcast_RunWorkerCompleted;
     workerBroadcast.WorkerSupportsCancellation = true;
     workerBroadcast.RunWorkerAsync();
     StartListening();
     Trace.TraceInformation("Stato disconnesso.");
 }
Пример #8
0
 public AbstractDisconnectedState(Connection connection, ConnectionParameter param)
 {
     isStopped = false;
     this.connectionParameter  = param;
     this.connection           = connection;
     controlConnectionListener = new BackgroundWorker();
     controlConnectionListener.WorkerSupportsCancellation = true;
     controlConnectionListener.DoWork             += controlConnectionListener_DoWork;
     controlConnectionListener.RunWorkerCompleted += controlConnectionListener_RunWorkerCompleted;
     workerBroadcast                            = new BackgroundWorker();
     workerBroadcast.DoWork                    += workerBroadcast_DoWork;
     workerBroadcast.RunWorkerCompleted        += workerBroadcast_RunWorkerCompleted;
     workerBroadcast.WorkerSupportsCancellation = true;
     workerBroadcast.RunWorkerAsync();
     StartListening();
     Trace.TraceInformation("Stato disconnesso.");
 }
Пример #9
0
 public Connection(ConnectionParameter param)
 {
     connectionParameter = param;
 }
 public UdpActivatedState(Connection connection, ConnectionParameter param, System.Net.Sockets.TcpClient tcpControlConnection)
     : base(connection, param, tcpControlConnection) { }
Пример #11
0
 public Connection(ConnectionParameter param)
 {
     connectionParameter = param;
 }
Пример #12
0
 public TcpConnectedState(Connection connection, ConnectionParameter param, System.Net.Sockets.TcpClient tcpControlConnection)
     : base(connection, param, tcpControlConnection)
 {
 }
Пример #13
0
 public UdpConnectedState(Connection connection, ConnectionParameter param, TcpClient tcpControlConnection)
     : base(connection, param, tcpControlConnection)
 {
 }
 public UdpConnectedState(Connection connection, ConnectionParameter param, TcpClient tcpControlConnection)
     : base(connection, param, tcpControlConnection) { }
 public TcpDisconnectedState(Connection connection, ConnectionParameter param)
     : base(connection, param) { }
Пример #16
0
 public TcpDisconnectedState(Connection connection, ConnectionParameter param)
     : base(connection, param)
 {
 }