Esempio n. 1
0
        public MainWindow()
        {
            InitializeComponent();
            if (Application.Current == null)
            {
                return;
            }

            ButtplugTab.SetServerDetails("Kiiroo Emulator", 0);
            _bpServer = ButtplugTab.GetServer();
            _bpServer.SendMessage(new RequestServerInfo("Kiiroo Emulator")).Wait();
            InitializeComponent();
            _kiirooEmulator = new KiirooPlatformEmulator();
            _kiirooEmulator.OnKiirooPlatformEvent += HandleKiirooPlatformMessage;
            _kiirooEmulator.OnException           += HandleKiirooPlatformMessage;
            _translator = new KiirooMessageTranslator();
            _translator.VibrateEvent += OnVibrateEvent;
            _ops = new List <DispatcherOperation>();
            var emu = new KiirooEmulatorPanel();

            ButtplugTab.AddDevicePanel(_bpServer);
            ButtplugTab.SetApplicationTab("Kiiroo Emulator", emu);
            Closing += ClosingHandler;
            StartServer();
            emu.ServerStatusChanged            += OnServerStatusChanged;
            ButtplugTab.SelectedDevicesChanged += SelectionChangedHandler;

            var config = new ButtplugConfig("B******g");

            ButtplugTab.GetAboutControl().CheckUpdate(config, "b******g-csharp");
        }
 public KiirooEmulatorPanel(ButtplugService aBpService)
 {
     _bpServer = aBpService;
     _bpServer.SendMessage(new RequestServerInfo("Kiiroo Emulator")).Wait();
     _devices = new DeviceList();
     InitializeComponent();
     DeviceListBox.ItemsSource              = _devices;
     _bpServer.MessageReceived             += OnMessageReceived;
     _kiirooEmulator                        = new KiirooPlatformEmulator();
     _kiirooEmulator.OnKiirooPlatformEvent += HandleKiirooPlatformMessage;
     _kiirooEmulator.OnException           += HandleKiirooPlatformMessage;
     _translator = new KiirooMessageTranslator();
     _translator.VibrateEvent       += OnVibrateEvent;
     DeviceListBox.SelectionMode     = SelectionMode.Multiple;
     DeviceListBox.SelectionChanged += SelectionChangedHandler;
     _ops = new List <DispatcherOperation>();
 }