Example #1
0
        private async void FetchExistingData()
        {
            List <string> existingEmailList_ = new List <string>();

            AppCommunicator.ReadLineFromFile("ExistingEmailList.txt", existingEmailList_);

            await System.Threading.Tasks.Task.Delay(500);

            AppCommunicator.ReadLineFromFile("ExistingContactList.txt", existingContactList);

            await System.Threading.Tasks.Task.Delay(500);

            AppCommunicator.ReadLineFromFile("used_redeem_codes.txt", used_redeem_codes);


            await System.Threading.Tasks.Task.Delay(500);

            for (int i = 0; i < existingEmailList_.Count; i++)
            {
                existingEmailList.Add(existingEmailList_[i]);
            }

            for (int i = 0; i < used_redeem_codes.Count; i++)
            {
                existingEmailList.Add(used_redeem_codes[i]);
            }
        }
        private async void OpenStockUI()
        {
            var view = ApplicationView.GetForCurrentView();

            if (view.IsFullScreenMode)
            {
                view.ExitFullScreenMode();
                ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.Auto;

                StockUIButton.IsEnabled = false;

                AppCommunicator.LaunchStockUIApp();

                await Task.Delay(1000);

                StockUIButton.IsEnabled = true;
            }
            else
            {
                StockUIButton.IsEnabled = false;

                if (view.TryEnterFullScreenMode())
                {
                    ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.FullScreen;
                }
                await Task.Delay(1000);

                StockUIButton.IsEnabled = true;
            }
        }
Example #3
0
        private async void submitButton_Click(object sender, RoutedEventArgs e)
        {
            // if checkbox and field is validate
            if ((nameValid == true) && (emailValid == true) &&
                (contactValid == true) && (checkboxValid == true) && !emailDuplicate && !contactDuplicate)
            {
                Click.Play();
                submitButton.IsEnabled = false;
                SubmitIMG.Scale(scaleX: 1.3f, scaleY: 1.3f, centerX: 0f, centerY: 0, duration: 200, delay: 0, easingType: EasingType.Default).Start();

                await System.Threading.Tasks.Task.Delay(200);

                SubmitIMG.Scale(scaleX: 1, scaleY: 1f, centerX: 0f, centerY: 0f, duration: 200, delay: 0, easingType: EasingType.Default).Start();

                AppCommunicator.WriteLinesToFile("PlayerData.txt",
                                                 new string[] { nameField.Text, emailField.Text, contactField.Text, "0", "0000-00-00", "0", "Panel01",
                                                                System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").ToString(), "no" });
                // email , voucher_code, redeem_code, created_at, is_sync
                AppCommunicator.WriteLinesToFile("VoucherDistributionData.txt",
                                                 new string[] { emailField.Text, "PEDIASURE", emailField.Text, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").ToString(), "no" });

                AppCommunicator.SaveData();

                await System.Threading.Tasks.Task.Delay(1600);

                Frame.Navigate(typeof(Pages.Webpage));
            }
            else
            {
                ShowWarning();
            }
        }
        private async void App_CloseRequested(object sender, SystemNavigationCloseRequestedPreviewEventArgs e)
        {
            var deferral = e.GetDeferral();

            await System.Threading.Tasks.Task.Run(() => { AppCommunicator.ExitAllApp(); });

            deferral.Complete();
        }
        private async void LaunchDropApp()
        {
            AppCommunicator.LaunchDropApp();

            await Task.Delay(5000);

            Frame.Navigate(typeof(Questions));
        }
        private async void ExitButton_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            AppCommunicator.ExitAllApp();
            ExitButton.IsEnabled = false;

            await Task.Delay(100);

            Application.Current.Exit();
        }
        private void Setup()
        {
            AppCommunicator.LaunchAutoSyncApp();

            CheckStock();
        }
 private void OnCloseRequest(object sender, SystemNavigationCloseRequestedPreviewEventArgs e)
 {
     AppCommunicator.ExitAllApp();
 }