Пример #1
0
        public Form1(string ipaddress)
        {
            InitializeComponent();
            FormClosing += Form1_FormClosing;
            _Viewer_Loop = new DesktopSharing_Viewer.Code.Viewer_Loop();
            _Viewer_Loop.UpdateImageEvent += Update_Image;
            _Viewer_Loop.NewImageEvent += New_Image;
            _Viewer_Loop.MouseImageChangedEvent += _Viewer_Loop_MouseUpdateEvent;
            _Viewer_Loop.MousePositionChangedEvent += _Viewer_Loop_MousePositionChangedEvent;
            var t = new InputListener(pictureBox1.Handle);
            t.InputMouseEvent += _Viewer_Loop.OnMouseEvent;
            t.InputKeyEvent += _Viewer_Loop.OnKeyEvent;

            Application.AddMessageFilter(t);
            this.DragDrop += new DragEventHandler(this.Form1_DragDrop);
            this.DragEnter += new DragEventHandler(this.Form1_DragEnter);

            _Viewer_Loop.IPtoConnect = ipaddress;
            _Viewer_Loop.Start();
        }
Пример #2
0
        public Form1(string ipaddress)
        {
            InitializeComponent();
            FormClosing += Form1_FormClosing;
            _Viewer_Loop = new DesktopSharing_Viewer.Code.Viewer_Loop();
            _Viewer_Loop.UpdateImageEvent          += Update_Image;
            _Viewer_Loop.NewImageEvent             += New_Image;
            _Viewer_Loop.MouseImageChangedEvent    += _Viewer_Loop_MouseUpdateEvent;
            _Viewer_Loop.MousePositionChangedEvent += _Viewer_Loop_MousePositionChangedEvent;
            var t = new InputListener(pictureBox1.Handle);

            t.InputMouseEvent += _Viewer_Loop.OnMouseEvent;
            t.InputKeyEvent   += _Viewer_Loop.OnKeyEvent;

            Application.AddMessageFilter(t);
            this.DragDrop  += new DragEventHandler(this.Form1_DragDrop);
            this.DragEnter += new DragEventHandler(this.Form1_DragEnter);

            _Viewer_Loop.IPtoConnect = ipaddress;
            _Viewer_Loop.Start();
        }