예제 #1
0
        public AccessoriesPage()
        {
            this.InitializeComponent();
            GetTimer.DispatcherTimerExtendOverwrite(GetTimer.defaultIdleTime);

            UpdateUI();
        }
예제 #2
0
 public XboxOneSAllDigitalPage()
 {
     this.InitializeComponent();
     GetTimer.DispatcherTimerExtendOverwrite(GetTimer.defaultIdleTime);
     UpdateUI();
     GetSerialDevice.ShowCenterConsole();
 }
        public HelpMeChoosePage1()
        {
            this.InitializeComponent();
            GetTimer.DispatcherTimerExtendOverwrite(GetTimer.defaultIdleTime);

            GetChoices.InitializeBlankAnswers();
        }
예제 #4
0
 public ConsolesPage()
 {
     this.InitializeComponent();
     GetTimer.DispatcherTimerExtendOverwrite(GetTimer.defaultIdleTime);
     UpdateUI();
     GetSerialDevice.ResetConsoles();
 }
예제 #5
0
        public GamePassVideoPage()
        {
            this.InitializeComponent();
            GetTimer.DispatcherTimerExtendOverwrite(GetTimer.defaultIdleTime);

            UpdateUI();
        }
 public GamesPage()
 {
     this.InitializeComponent();
     GetTimer.DispatcherTimerExtendOverwrite(GetTimer.defaultIdleTime);
     UpdateUI();
     GetSerialDevice.ShowNormalRingDpadColours();
 }
예제 #7
0
        public async Task GetImage(string filename, string foldername, Image image, bool wait)
        {
            try
            {
                StorageFolder folder;
                if (foldername == null)
                {
                    folder = await KnownFolders.VideosLibrary.GetFolderAsync("AppAssets");
                }
                else
                {
                    folder = await KnownFolders.VideosLibrary.GetFolderAsync("AppAssets\\" + foldername);
                }
                StorageFile file = await folder.GetFileAsync(filename);

                var stream = await file.OpenAsync(FileAccessMode.Read);

                image.Visibility = Visibility.Visible;
                BitmapImage bitmapImage = new BitmapImage();
                image.Source = bitmapImage;
                await bitmapImage.SetSourceAsync(stream);

                if (wait == true)
                {
                    GetTimer.DispatcherTimerExtend(staticImageWaitTime);
                }
            }
            catch (Exception ex)
            {
                try
                {
                    StorageFolder folder;
                    if (foldername == null)
                    {
                        folder = await KnownFolders.VideosLibrary.GetFolderAsync("AppAssets");
                    }
                    else
                    {
                        folder = await KnownFolders.VideosLibrary.GetFolderAsync("AppAssets\\" + foldername);
                    }
                    StorageFile file = await folder.GetFileAsync("x.png");

                    var stream = await file.OpenAsync(FileAccessMode.Read);

                    image.Visibility = Visibility.Visible;
                    BitmapImage bitmapImage = new BitmapImage();
                    image.Source = bitmapImage;
                    await bitmapImage.SetSourceAsync(stream);
                }
                catch (Exception ex2)
                {
                    if (ex2 is FormatException)
                    {
                        image.Visibility = Visibility.Collapsed;
                    }
                }
            }
        }
        private void Start_Button_Click(object sender, RoutedEventArgs e)
        {
            GetTimer.DispatcherTimerSetup();

            var frame    = (Frame)Window.Current.Content;
            var mainPage = (MainPage)frame.Content;

            mainPage.navigateWithOpacityTransition(typeof(HomePage));
        }
예제 #9
0
        public HelpMeChoosePageCalculating()
        {
            this.InitializeComponent();
            GetTimer.DispatcherTimerExtendOverwrite(GetTimer.defaultIdleTime);
            RedirectTimerSetup();


            GetChoices.CalculateResults();
        }
예제 #10
0
        //Condition when download data complete
        void Detail_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                HTMLText = e.Result;
            }

            GetTimer.Start();
        }
예제 #11
0
        //Function download string from HTTPserver
        private void DownloadInformation()
        {
            GetTimer.Stop();

            WebClient Detail = new WebClient();

            Detail.DownloadStringCompleted += new DownloadStringCompletedEventHandler(Detail_DownloadStringCompleted);
            Detail.DownloadStringAsync(new Uri("http://192.168.70.61"));
        }
        public HomePage()
        {
            this.InitializeComponent();
            GetTimer.DispatcherTimerExtendOverwrite(GetTimer.defaultIdleTime);

            UpdateUI();


            string[] messages = { "[2E1]", "[1E0]", "[3E0]" };
            GetSerialDevice.AddMessagesToQueue(messages);
        }
예제 #13
0
        //Button Stop
        private void StopBtn_Click_1(object sender, EventArgs e)
        {
            //set button color when click stop
            StopBtn.BackColor  = Color.OrangeRed;
            StartBtn.BackColor = Color.Empty;

            //timer get data start
            GetTimer.Enabled = false;
            GetTimer.Stop();

            //timer 1000 milisec stop
            timer2.Enabled = true;
            timer2.Stop();
        }
예제 #14
0
        private async void Gamepad_GamepadRemoved(object sender, Gamepad e)
        {
            mainGamepad = null;

            instinct.PostError("Controller Removed");

            await Dispatcher.RunAsync(
                CoreDispatcherPriority.Normal, () =>
            {
                //Debug.Write("Controller Removed!\r\n");
                GetSerialDevice.ShowControllerRemoved();
                GetTimer.DispatcherTimerStop();
            });
        }
예제 #15
0
        //Button Start
        private void StartBtn_Click_1(object sender, EventArgs e)
        {
            //set button color when click start
            StartBtn.BackColor = Color.LimeGreen;
            StopBtn.BackColor  = Color.Empty;

            //timer 1000 milisec start
            timer2.Enabled = true;
            timer2.Start();

            //start get data
            string result = null;
            string url    = "http://192.168.70.61";

            //timer get data start
            GetTimer.Enabled = true;
            GetTimer.Start();
        }
예제 #16
0
        //When form loadding
        private void Dataform_Load(object sender, EventArgs e)
        {
            //set url to get data from sensor
            string result = null;
            string url    = "http://192.168.70.61";

            //start get data
            GetTimer.Enabled = true;
            GetTimer.Start();

            //set button color
            StartBtn.BackColor = Color.LimeGreen;

            //set timer star
            timer2.Enabled = true;
            timer2.Start();

            //set size graph and set plot graph
            SetSize();
            stopwatch.Start();
        }
예제 #17
0
        public async Task GetVideo(string filename, string foldername, MediaElement mediaElement, bool wait)
        {
            try
            {
                StorageFolder folder;
                if (foldername == null)
                {
                    folder = await KnownFolders.VideosLibrary.GetFolderAsync("AppAssets");
                }
                else
                {
                    folder = await KnownFolders.VideosLibrary.GetFolderAsync("AppAssets\\" + foldername);
                }

                StorageFile file = await folder.GetFileAsync(filename);

                var stream = await file.OpenAsync(FileAccessMode.Read);

                mediaElement.Visibility = Visibility.Visible;
                mediaElement.SetSource(stream, file.ContentType);
                Windows.Storage.FileProperties.VideoProperties videoProperties = await file.Properties.GetVideoPropertiesAsync();

                int duration = Convert.ToInt32(videoProperties.Duration.TotalSeconds);
                if (wait == true)
                {
                    GetTimer.DispatcherTimerExtendOverwrite(duration + GetTimer.defaultIdleTime);
                }
                await Task.Delay(duration * 1000);

                return;
            }
            catch (Exception ex)
            {
                if (ex is FormatException)
                {
                    mediaElement.Visibility = Visibility.Collapsed;
                }
            }
        }
예제 #18
0
        /// <summary>
        /// 根据键获得对应的值。
        /// </summary>
        /// <param name="key">键。</param>
        /// <returns><paramref name="key"/> 对应的值。</returns>
        /// <exception cref="ArgumentNullException">当 <paramref name="key"/> 为 <c>null</c> 时抛出此异常。</exception>
        public TValue Get(TKey key)
        {
            GetTimer.Start();
            if (key == null)
            {
                throw new ArgumentNullException("argument to Get() is null");
            }
            if (IsEmpty())
            {
                GetTimer.Stop();
                return(default(TValue));
            }
            var rank = Rank(key);

            if (rank < n && keys[rank].Equals(key))
            {
                return(values[rank]);
            }

            GetTimer.Stop();
            return(default(TValue));
        }
예제 #19
0
        public MainPage()
        {
            this.InitializeComponent();

            Debug.WriteLine("Main page constructor");

            GetTimer.DispatcherTimerExtendOverwrite(GetTimer.defaultIdleTime);

            // Set Fullscreen
            ApplicationView view = ApplicationView.GetForCurrentView();

            view.TryEnterFullScreenMode();

            frame = new Frame {
            };
            ScreenContent.Content = frame;
            frame.Navigate(typeof(LandingPage), null, new SuppressNavigationTransitionInfo());

            GetSerialDevice.SendMessageQueue();
            ReadGamepad();

            SyncApplication();
        }
 private void Bottom_Button_GotFocus(object sender, RoutedEventArgs e)
 {
     GetSerialDevice.ShowBottomDpad();
     GetTimer.DispatcherTimerExtend(GetTimer.defaultIdleTime);
 }
        public HelpMeChooseResults()
        {
            this.InitializeComponent();
            GetTimer.DispatcherTimerExtendOverwrite(GetTimer.defaultIdleTime);

            string url;

            // Console Image
            switch (GetChoices.Recommendations.console)
            {
            case "Xbox One X":
                url = "ms-appx:///Assets/11100_XboxOneX.png";
                RecommendedConsole.Source = new BitmapImage(new Uri(url, UriKind.Absolute));
                //instinct.GetImage("11100_XboxOneX.png", null, RecommendedConsole);
                GetSerialDevice.ShowLeftConsole();
                break;

            case "Xbox One S":
                url = "ms-appx:///Assets/11100_XboxOneS.png";
                RecommendedConsole.Source = new BitmapImage(new Uri(url, UriKind.Absolute));
                //instinct.GetImage("11100_XboxOneS.png", null, RecommendedConsole);
                GetSerialDevice.ShowRightConsole();
                break;

            case "Xbox One S All Digital":
                url = "ms-appx:///Assets/11100_XboxOneSAD.png";
                RecommendedConsole.Source = new BitmapImage(new Uri(url, UriKind.Absolute));
                //instinct.GetImage("11100_XboxOneSAD.png", null, RecommendedConsole);
                GetSerialDevice.ShowCenterConsole();
                break;
            }


            // Accessory Image

            // With headset
            if (GetChoices.Recommendations.headset == true)
            {
                if (GetChoices.Recommendations.controller == true)
                {
                    if (GetChoices.Recommendations.premium == true)
                    {
                        // Headset w premium controller
                        url = "ms-appx:///Assets/11100_PremiumControllerHeadset.png";
                        RecommendedAccessories.Source = new BitmapImage(new Uri(url, UriKind.Absolute));
                        //instinct.GetImage("11100_PremiumControllerHeadset.png", null, RecommendedAccessories);
                    }
                    else
                    {
                        // Headset w basic controller
                        url = "ms-appx:///Assets/11100_BasicControllerHeadset.png";
                        RecommendedAccessories.Source = new BitmapImage(new Uri(url, UriKind.Absolute));
                        //instinct.GetImage("11100_BasicControllerHeadset.png", null, RecommendedAccessories);
                    }
                }
                else
                {
                    if (GetChoices.Recommendations.premium == true)
                    {
                        // Premium Headset only
                        url = "ms-appx:///Assets/11100_PremiumHeadset.png";
                        RecommendedAccessories.Source = new BitmapImage(new Uri(url, UriKind.Absolute));
                        //instinct.GetImage("11100_PremiumHeadset.png", null, RecommendedAccessories);
                    }
                    else
                    {
                        // Basic Headset only
                        url = "ms-appx:///Assets/11100_BasicHeadset.png";
                        RecommendedAccessories.Source = new BitmapImage(new Uri(url, UriKind.Absolute));
                        //instinct.GetImage("11100_BasicHeadset.png", null, RecommendedAccessories);
                    }
                }
            }

            // No headset
            else
            {
                if (GetChoices.Recommendations.controller == true)
                {
                    if (GetChoices.Recommendations.premium == true)
                    {
                        // Premium controller
                        url = "ms-appx:///Assets/11100_PremiumController.png";
                        RecommendedAccessories.Source = new BitmapImage(new Uri(url, UriKind.Absolute));

                        //instinct.GetImage("11100_PremiumController.png", null, RecommendedAccessories);
                    }
                    else
                    {
                        // Basic controller
                        url = "ms-appx:///Assets/11100_BasicController.png";
                        RecommendedAccessories.Source = new BitmapImage(new Uri(url, UriKind.Absolute));

                        //instinct.GetImage("11100_BasicController.png", null, RecommendedAccessories);
                    }
                }
                else
                {
                    Debug.WriteLine("Something went wrong");
                }
            }


            // Service Image
            url = "ms-appx:///Assets/11100_GamePass.png";
            RecommendedService.Source = new BitmapImage(new Uri(url, UriKind.Absolute));
            //instinct.GetImage("11100_GamePass.png", null, RecommendedService);
        }
 private void Right_Button_GotFocus(object sender, RoutedEventArgs e)
 {
     GetSerialDevice.ShowRightDpad();
     GetTimer.DispatcherTimerExtend(GetTimer.defaultIdleTime);
     Show_Answer(3);
 }
 public HelpMeChoosePage4()
 {
     this.InitializeComponent();
     GetTimer.DispatcherTimerExtendOverwrite(GetTimer.defaultIdleTime);
 }