Exemplo n.º 1
0
 public void OnKeyEvent(Desktop_Sharing_Shared.Keyboard.KeyboardEventStruct k)
 {
     var t = new SecureTcp.Tcp_Message((int)Desktop_Sharing_Shared.Message_Types.KEY_EVENT);
     t.Add_Block(BitConverter.GetBytes(k.bVk));
     t.Add_Block(BitConverter.GetBytes((int)k.s));
     lock(_OutGoingMessagesLock)
     {
         _OutGoingMessages.Add(t);
     }
 }
Exemplo n.º 2
0
        public void OnKeyEvent(Desktop_Sharing_Shared.Keyboard.KeyboardEventStruct k)
        {
            var t = new SecureTcp.Tcp_Message((int)Desktop_Sharing_Shared.Message_Types.KEY_EVENT);

            t.Add_Block(BitConverter.GetBytes(k.bVk));
            t.Add_Block(BitConverter.GetBytes((int)k.s));
            lock (_OutGoingMessagesLock)
            {
                _OutGoingMessages.Add(t);
            }
        }
Exemplo n.º 3
0
        public void OnMouseEvent(Desktop_Sharing_Shared.Mouse.MouseEventStruct m)
        {
            var t = new SecureTcp.Tcp_Message((int)Desktop_Sharing_Shared.Message_Types.MOUSE_EVENT);

            t.Add_Block(BitConverter.GetBytes((int)m.msg));
            t.Add_Block(BitConverter.GetBytes(m.x));
            t.Add_Block(BitConverter.GetBytes(m.y));
            t.Add_Block(BitConverter.GetBytes(m.wheel_delta));
            lock (_OutGoingMessagesLock)
            {
                _OutGoingMessages.Add(t);
            }
        }
Exemplo n.º 4
0
 private void AddFileOrDirectory(string root1, string fullpath)
 {
     if (Directory.Exists(fullpath))
     {
         try
         {
             var di         = new DirectoryInfo(fullpath);
             var t          = new SecureTcp.Tcp_Message((int)Desktop_Sharing_Shared.Message_Types.FOLDER);
             var foldername = root1 + di.Name;
             t.Add_Block(Desktop_Sharing_Shared.Utilities.Format.GetBytes(foldername));
             _OutGoingMessages.Add(t);
             foreach (var item in di.GetDirectories())
             {
                 AddFileOrDirectory(foldername + "\\", item.FullName);
             }
             foreach (var item in di.GetFiles())
             {
                 AddFileOrDirectory(foldername + "\\", item.FullName);
             }
         } catch (Exception e)
         {
             Debug.WriteLine(e.Message);
         }
     }
     else
     {
         try
         {
             var fi = File.ReadAllBytes(fullpath);
             var t  = new SecureTcp.Tcp_Message((int)Desktop_Sharing_Shared.Message_Types.FILE);
             t.Add_Block(Desktop_Sharing_Shared.Utilities.Format.GetBytes(root1 + Path.GetFileName(fullpath)));
             t.Add_Block(fi);
             _OutGoingMessages.Add(t);
         } catch (Exception e)
         {
             Debug.WriteLine(e.Message);
         }
     }
 }
Exemplo n.º 5
0
 public void OnMouseEvent(Desktop_Sharing_Shared.Mouse.MouseEventStruct m)
 {
     var t = new SecureTcp.Tcp_Message((int)Desktop_Sharing_Shared.Message_Types.MOUSE_EVENT);
     t.Add_Block(BitConverter.GetBytes((int)m.msg));
     t.Add_Block(BitConverter.GetBytes(m.x));
     t.Add_Block(BitConverter.GetBytes(m.y));
     t.Add_Block(BitConverter.GetBytes(m.wheel_delta));
     lock(_OutGoingMessagesLock)
     {
         _OutGoingMessages.Add(t);
     }
 }
Exemplo n.º 6
0
        private void AddFileOrDirectory(string root1, string fullpath)
        {
            if(Directory.Exists(fullpath))
            {
                try
                {
                    var di = new DirectoryInfo(fullpath);
                    var t = new SecureTcp.Tcp_Message((int)Desktop_Sharing_Shared.Message_Types.FOLDER);
                    var foldername = root1 + di.Name;
                    t.Add_Block(Desktop_Sharing_Shared.Utilities.Format.GetBytes(foldername));
                    _OutGoingMessages.Add(t);
                    foreach(var item in di.GetDirectories())
                    {
                        AddFileOrDirectory(foldername + "\\", item.FullName);
                    }
                    foreach(var item in di.GetFiles())
                    {
                        AddFileOrDirectory(foldername + "\\", item.FullName);
                    }
                } catch(Exception e)
                {
                    Debug.WriteLine(e.Message);
                }
            } else
            {
                try
                {
                    var fi = File.ReadAllBytes(fullpath);
                    var t = new SecureTcp.Tcp_Message((int)Desktop_Sharing_Shared.Message_Types.FILE);
                    t.Add_Block(Desktop_Sharing_Shared.Utilities.Format.GetBytes(root1 + Path.GetFileName(fullpath)));
                    t.Add_Block(fi);
                    _OutGoingMessages.Add(t);

                } catch(Exception e)
                {
                    Debug.WriteLine(e.Message);
                }
            }
        }