Esempio n. 1
0
        public OtherControllerPage()
        {
            this.InitializeComponent();

            GlobalSettings.ApplyThemeTo(this);

            CancellationToken = new CancellationTokenSource();

            this.Loaded += (s1, e1) =>
            {
                X_Button_TextBlock.Foreground = new SolidColorBrush(Colors.Blue);
                Y_Button_TextBlock.Foreground = new SolidColorBrush(Colors.Yellow);
                B_Button_TextBlock.Foreground = new SolidColorBrush(Colors.Red);
                A_Button_TextBlock.Foreground = new SolidColorBrush(Colors.LawnGreen);

                Initialize();

                controller = new GenericController();

                controller.Connected += (s2, e2) =>
                {
                    SetConnectedAsync();
                };

                controller.Disconnected += (s2, e2) =>
                {
                    SetDisonnectedAsync();
                };

                controller.Refresh();
            };
        }
Esempio n. 2
0
        void LoadController()
        {
            Controller = new GenericController();

            Controller.Connected += (s2, e2) =>
            {
                Connected();
            };

            Controller.Disconnected += (s2, e2) =>
            {
                Disconnected();
            };

            Controller.Refresh();
        }
Esempio n. 3
0
        public ControllerDeadzonePage()
        {
            this.InitializeComponent();

            GlobalSettings.ApplyThemeTo(this);

            RightDeadzoneCoordinatesGrid.BorderThickness = new Windows.UI.Xaml.Thickness(0);
            LeftDeadzoneCoordinatesGrid.BorderThickness  = new Windows.UI.Xaml.Thickness(0);
            RightDeadzoneSliderGrid.BorderThickness      = new Windows.UI.Xaml.Thickness(0);
            LeftDeadzoneSliderGrid.BorderThickness       = new Windows.UI.Xaml.Thickness(0);

            CancellationToken = new CancellationTokenSource();

            LeftPainter  = new Painter(CreateAnEllipse(5, 5), LeftCanvas, LEFT);
            RightPainter = new Painter(CreateAnEllipse(5, 5), RightCanvas, RIGHT);

            this.Loaded += (s1, e1) =>
            {
                switch (GlobalSettings.ControllerType)
                {
                case CONTROLLER_TYPE.XBOX:
                    XboxController xboxController = new XboxController();

                    xboxController.Connected += (s2, e2) =>
                    {
                        SetConnectedAsync();
                    };

                    xboxController.Disconnected += (s2, e2) =>
                    {
                        SetDisconnectedAsync();
                    };

                    xboxController.Refresh();

                    Controller = xboxController;

                    break;

                case CONTROLLER_TYPE.GENERIC:
                    GenericController genericController = new GenericController();

                    genericController.Connected += (s2, e2) =>
                    {
                        SetConnectedAsync();
                    };

                    genericController.Disconnected += (s2, e2) =>
                    {
                        SetDisconnectedAsync();
                    };

                    genericController.Refresh();

                    Controller = genericController;

                    break;

                case CONTROLLER_TYPE.PLAYSTATION:
                    PlaystationController playstationController = new PlaystationController();

                    playstationController.Connected += (s2, e2) =>
                    {
                        SetConnectedAsync();
                    };

                    playstationController.Disconnected += (s2, e2) =>
                    {
                        SetDisconnectedAsync();
                    };

                    playstationController.Refresh();

                    Controller = playstationController;

                    break;
                }
            };
        }
Esempio n. 4
0
 private void Refresh_Button_Click(object sender, RoutedEventArgs e)
 {
     Controller.Refresh();
 }