internal ServerAreaSelector(ServerState pState)
        {
            InitializeComponent();

            this._state = pState;

            this._sync = new Object();

            this._top = this._state.Area.Y;
            this._bottom = this._state.Area.Y + this._state.Area.Height;
            this._left = this._state.Area.X;
            this._right = this._state.Area.X + this._state.Area.Width;

            this.TopTrackBar.Maximum = Screen.PrimaryScreen.Bounds.Height;
            this.BottomTrackBar.Maximum = Screen.PrimaryScreen.Bounds.Height;
            this.LeftTrackBar.Maximum = Screen.PrimaryScreen.Bounds.Width;
            this.RightTrackBar.Maximum = Screen.PrimaryScreen.Bounds.Width;

            this.SetTrackbars();

            this._updatePreviewTimer = new System.Timers.Timer();
            this._updatePreviewTimer.Elapsed += new System.Timers.ElapsedEventHandler(OnUpdatePreviewEvent);
            this._updatePreviewTimer.Interval = Constants.MS_PREVIEW_AREA_SELECTOR;
            this._updatePreviewTimer.AutoReset = true;
            this._updatePreviewTimer.Enabled = true;
        }
Beispiel #2
0
 internal TaskInfo(TcpClient pChatControl, ServerState pState)
 {
     this._chatControl = pChatControl;
     this._clipboard = null;
     this._video = null;
     this._state = pState;
     this._name = String.Empty;
 }
        internal ServerChatClipboard(ServerState pState)
        {
            InitializeComponent();
            this._state = pState;

            this._state.dUpdateHistory = this.UpdateHistory;
            this._state.dUpdateClipboard = this.UpdateClipboard;
        }
        internal ServerWindowSelector(ServerState pState)
        {
            InitializeComponent();

            this._state = pState;

            this._openWindows = OpenWindowsGetter.GetOpenWindows();

            foreach (var lWindow in this._openWindows)
            {
                this.WindowsListBox.Items.Add(lWindow.Value);
            }
        }
Beispiel #5
0
        public ServerState selectControl(MControl control)
        {
            if (isSameSolidColor(control.color))
            {
                if (control.controlClass == typeof(Button))
                {
                    buttonsList.Add(control);
                }

                else
                {
                    labelsList.Add(control);
                }
            }

            ServerState state = new ServerState();

            state.buttons = buttonsList.ToArray();
            state.labels  = labelsList.ToArray();

            return(state);
        }
Beispiel #6
0
        public static void ReadCallback(IAsyncResult ar)
        {
            String content = String.Empty;

            // Retrieve the state object and the handler socket
            // from the asynchronous state object.
            ServerState state   = (ServerState)ar.AsyncState;
            Socket      handler = state.workSocket;

            // Read data from the client socket.
            int bytesRead = handler.EndReceive(ar);

            if (bytesRead > 0)
            {
                // There  might be more data, so store the data received so far.
                state.sb.Append(Encoding.ASCII.GetString(
                                    state.buffer, 0, bytesRead));

                // Check for end-of-file tag. If it is not there, read
                // more data.
                content = state.sb.ToString();
                if (content.IndexOf("<EOF>") > -1)
                {
                    // All the data has been read from the
                    // client. Display it on the console.
                    Console.WriteLine("Read {0} bytes from socket. \n Data : {1}",
                                      content.Length, content);
                    // Echo the data back to the client.
                    Send(handler, content);
                }
                else
                {
                    // Not all data received. Get more.
                    handler.BeginReceive(state.buffer, 0, ServerState.BufferSize, 0,
                                         new AsyncCallback(ReadCallback), state);
                }
            }
        }
Beispiel #7
0
        internal ServerMain()
        {
            InitializeComponent();

            // Server state class, locked only by event callback functions
            // when modifying GUI fields not by subroutines
            this._state = new ServerState();

            // Setting of delegates
            this._state.dSendClipboard = this.SendClipboardDataToAll;
            this._state.dDisconnect = this.ServerDown;

            // Setting default streaming area
            this._state.Area = new Rectangle(0, 0, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);

            // Setting ThreadPool threads minimum
            ThreadPool.SetMinThreads(MAX_CLIENTS + Constants.NUM_ROWS_GRID + 1, MAX_CLIENTS + Constants.NUM_ROWS_GRID + 1);

            // Creates or empties Clipboard Shared Items directory
            if (Directory.Exists(Directory.GetCurrentDirectory() + "\\" + Constants.CLIPBOARD_FILES_DIR))
                Directory.Delete(Directory.GetCurrentDirectory() + "\\" + Constants.CLIPBOARD_FILES_DIR, true);
            Directory.CreateDirectory(Directory.GetCurrentDirectory() + "\\" + Constants.CLIPBOARD_FILES_DIR);
        }
 //public static void Main()
 //{
 //    _hookID = SetHook(_proc);
 //    Application.Run();
 //    UnhookWindowsHookEx(_hookID);
 //}
 public SelectAreaHook(ServerState pState)
 {
     this._state = pState;
 }
Beispiel #9
0
 private void _SetServerState(ServerState state)
 {
     this.state = state;
     LogHelper.DEBUGLOG("GameServer " + state.ToString() + "!");
 }