Example #1
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();
            }
        }
Example #2
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();
        }