public async void Initialize() { InputFactory.InputType inputType = InputFactory.getType(Settings.Default.input); OutputFactory.OutputType outputType = OutputFactory.getType(Settings.Default.output); switch (inputType) { case InputFactory.InputType.POINTER: this.cbiPointer.IsSelected = true; break; case InputFactory.InputType.PEN: this.cbiPen.IsSelected = true; break; } this.cbConnectOnStart.IsChecked = Settings.Default.connectOnStart; Application.Current.Exit += appWillExit; wiiPair = new WiiCPP.WiiPair(); wiiPair.addListener(this); Settings.Default.PropertyChanged += Settings_PropertyChanged; if (!Settings.Default.pairedOnce) { this.tbConnect.Visibility = Visibility.Hidden; this.tbPair.Visibility = Visibility.Visible; } else { this.tbConnect.Visibility = Visibility.Visible; this.tbPair.Visibility = Visibility.Hidden; } //this.cbWindowsStart.IsChecked = await ApplicationAutostart.IsAutostartAsync("Touchmote"); // Create the providers. this.createProvider(); this.createProviderHandler(); if (Settings.Default.connectOnStart) { this.connectProvider(); } }
public async void Initialize() { InputFactory.InputType inputType = InputFactory.getType(Settings.Default.input); OutputFactory.OutputType outputType = OutputFactory.getType(Settings.Default.output); switch (inputType) { case InputFactory.InputType.POINTER: this.cbiPointer.IsSelected = true; break; case InputFactory.InputType.PEN: this.cbiPen.IsSelected = true; break; } this.cbConnectOnStart.IsChecked = Settings.Default.connectOnStart; Application.Current.Exit += appWillExit; wiiPair = new WiiCPP.WiiPair(); wiiPair.addListener(this); Settings.Default.PropertyChanged += Settings_PropertyChanged; if (!Settings.Default.pairedOnce) { this.tbConnect.Visibility = Visibility.Hidden; this.tbPair.Visibility = Visibility.Visible; } else { this.tbConnect.Visibility = Visibility.Visible; this.tbPair.Visibility = Visibility.Hidden; } //this.cbWindowsStart.IsChecked = await ApplicationAutostart.IsAutostartAsync("Touchmote"); // Create the providers. this.createProvider(); this.createProviderHandler(); if (Settings.Default.connectOnStart) { this.connectProvider(); } }
protected override void OnInitialized(EventArgs e) { base.OnInitialized(e); KeymapConfigWindow.Instance.Visibility = System.Windows.Visibility.Collapsed; KeymapDatabase.Current.CreateDefaultFiles(); this.mainPanel.Visibility = Visibility.Visible; this.canvasSettings.Visibility = Visibility.Collapsed; this.canvasAbout.Visibility = Visibility.Collapsed; this.spPairing.Visibility = Visibility.Collapsed; this.tbPair2.Visibility = Visibility.Visible; this.tbPairDone.Visibility = Visibility.Collapsed; this.spErrorMsg.Visibility = Visibility.Collapsed; this.spInfoMsg.Visibility = Visibility.Collapsed; this.animateExpand(this.mainPanel); Thread overlayUIThread = new Thread(() => { OverlayWindow.Current.Show(); if (Settings.Default.pointer_customCursor) { System.Windows.Threading.Dispatcher.CurrentDispatcher.BeginInvoke(new Action(delegate() { D3DCursorWindow.Current.Start((new WindowInteropHelper(OverlayWindow.Current)).Handle, Util.ScreenWidth, Util.ScreenHeight); })); } System.Windows.Threading.Dispatcher.Run(); }); overlayUIThread.SetApartmentState(ApartmentState.STA); overlayUIThread.IsBackground = true; overlayUIThread.Priority = ThreadPriority.Highest; overlayUIThread.Start(); Application.Current.Exit += appWillExit; Application.Current.SessionEnding += windowsShutdownEvent; wiiPair = new WiiCPP.WiiPair(); wiiPair.addListener(this); Settings.Default.PropertyChanged += Settings_PropertyChanged; // Create the providers. this.createProvider(); this.createProviderHandler(); if (Settings.Default.pairOnStart) { this.startupPair = true; this.runWiiPair(); } else //if (Settings.Default.connectOnStart) { this.connectProvider(); } AppSettingsUC settingspanel = new AppSettingsUC(); settingspanel.OnClose += SettingsPanel_OnClose; this.canvasSettings.Children.Add(settingspanel); AboutUC aboutpanel = new AboutUC(); aboutpanel.OnClose += AboutPanel_OnClose; this.canvasAbout.Children.Add(aboutpanel); Loaded += MainWindow_Loaded; }
protected override void OnInitialized(EventArgs e) { base.OnInitialized(e); KeymapConfigWindow.Instance.Visibility = System.Windows.Visibility.Collapsed; KeymapDatabase.Current.CreateDefaultFiles(); this.mainPanel.Visibility = Visibility.Visible; this.canvasSettings.Visibility = Visibility.Collapsed; this.canvasAbout.Visibility = Visibility.Collapsed; this.spPairing.Visibility = Visibility.Collapsed; this.tbPair2.Visibility = Visibility.Visible; this.tbPairDone.Visibility = Visibility.Collapsed; this.spErrorMsg.Visibility = Visibility.Collapsed; this.spInfoMsg.Visibility = Visibility.Collapsed; this.animateExpand(this.mainPanel); Thread overlayUIThread = new Thread(() => { OverlayWindow.Current.Show(); if (Settings.Default.pointer_customCursor) { System.Windows.Threading.Dispatcher.CurrentDispatcher.BeginInvoke(new Action(delegate() { D3DCursorWindow.Current.Start((new WindowInteropHelper(OverlayWindow.Current)).Handle, Util.ScreenWidth, Util.ScreenHeight); })); } System.Windows.Threading.Dispatcher.Run(); }); overlayUIThread.SetApartmentState(ApartmentState.STA); overlayUIThread.IsBackground = true; overlayUIThread.Priority = ThreadPriority.Highest; overlayUIThread.Start(); Application.Current.Exit += appWillExit; Application.Current.SessionEnding += windowsShutdownEvent; wiiPair = new WiiCPP.WiiPair(); wiiPair.addListener(this); Settings.Default.PropertyChanged += Settings_PropertyChanged; // Create the providers. this.createProvider(); this.createProviderHandler(); if (Settings.Default.pairOnStart) { this.startupPair = true; this.runWiiPair(); } else //if (Settings.Default.connectOnStart) { this.connectProvider(); } AppSettingsUC settingspanel = new AppSettingsUC(); settingspanel.OnClose += SettingsPanel_OnClose; this.canvasSettings.Children.Add(settingspanel); AboutUC aboutpanel = new AboutUC(); aboutpanel.OnClose += AboutPanel_OnClose; this.canvasAbout.Children.Add(aboutpanel); Loaded += MainWindow_Loaded; }