예제 #1
0
 private void ComboBox_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
 {
     if (ModeComboBox.SelectedItem != null && ((ComboBoxItem)ModeComboBox.SelectedItem).Content != null)
     {
         ComboBoxItem cbItem = (ComboBoxItem)ModeComboBox.SelectedItem;
         if (cbItem == cbiPointer)
         {
             Settings.Default.input = InputFactory.getType(InputFactory.InputType.POINTER);
         }
         else if (cbItem == cbiPen)
         {
             Settings.Default.input = InputFactory.getType(InputFactory.InputType.PEN);
         }
     }
 }
예제 #2
0
        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();
            }
        }
예제 #3
0
        private async void reloadState()
        {
            this.cbMinimizeOnStart.IsChecked = Settings.Default.minimizeOnStart;
            this.cbMinimizeToTray.IsChecked  = Settings.Default.minimizeToTray;
            this.cbPairOnStart.IsChecked     = Settings.Default.pairOnStart;
            this.cbUseCustomCursor.IsChecked = Settings.Default.pointer_customCursor;

            InputFactory.InputType inputType = InputFactory.getType(Settings.Default.input);

            switch (inputType)
            {
            case InputFactory.InputType.POINTER:
                this.cbiPointer.IsSelected = true;
                break;

            case InputFactory.InputType.PEN:
                this.cbiPen.IsSelected = true;
                break;
            }
            this.providerSettingsContent.Children.Clear();
            this.providerSettingsContent.Children.Add(MultiWiiPointerProvider.getSettingsControl());

            this.cbWindowsStart.IsChecked = Autostart.IsAutostart();
        }