コード例 #1
0
ファイル: OTBClient.cs プロジェクト: wj-wong/OutsideTheBox
        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 HookManager(ServerEventDispatcher dispatcher, VirtualScreenManager screen)
 {
     _dispatcher = dispatcher;
     _screen     = screen;
     if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
     {
         Hook = new WindowsGlobalHook();
     }
     if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
     {
         Hook = new OsxGlobalHook();
     }
 }