Пример #1
0
        public OTBClient(string serverAddress)
        {
            ClientState.ClientName = Environment.MachineName;

            _connection = new ServerConnectionManager(serverAddress);
            _dispatcher = new ServerEventDispatcher(_connection);
            _screen     = new VirtualScreenManager();
            _hook       = new HookManager(_dispatcher, _screen);
            _receiver   = new ServerEventReceiver(_connection, _hook, _screen);

            ClientState.Logger = LoggerFactory.Create(builder => builder.AddConsole()).CreateLogger("OTB");
        }
Пример #2
0
        public ServerEventReceiver(ServerConnectionManager manager, HookManager hookManager, VirtualScreenManager screen)
        {
            _manager = manager;
            _hook    = hookManager;
            _screen  = screen;

            _manager.HubConnection.On <double, double>("MouseMove", OnMouseMoveFromServer);
            _manager.HubConnection.On <int, int>("MouseWheel", OnMouseWheelFromServer);
            _manager.HubConnection.On <MouseButton>("MouseDown", OnMouseDownFromServer);
            _manager.HubConnection.On <MouseButton>("MouseUp", OnMouseUpFromServer);
            _manager.HubConnection.On <Key>("KeyUp", OnKeyUpFromServer);
            _manager.HubConnection.On <Key>("KeyDown", OnKeyDownFromServer);
            _manager.HubConnection.On <string>("Clipboard", OnClipboardFromServer);
            _manager.HubConnection.On <List <VirtualScreen> >("ScreenConfigUpdate", OnScreenConfig);
        }
 public ServerEventDispatcher(ServerConnectionManager manager)
 {
     _manager = manager;
 }