コード例 #1
0
        private void GetStandardBilder()
        {
            DownloadWaitRing.IsActive = true;
            Nutzer.Getinstance().StManager.DownloadAction += async(file) => await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => FuegeBildZuListeHinzu(file));

            Nutzer.Getinstance().StManager.DownloadEndedAction += async() => await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => DownloadWaitRing.IsActive = false);

            Nutzer.Getinstance().StManager.GetStandardImagesAsync();
        }
コード例 #2
0
        /* Bei Seitenwechsel den Blobstorage aktualisieren */
        protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            if (App.OFFLINE_MODE)
            {
                return;
            }
            StorageAccountManager st = Nutzer.Getinstance().StManager;

            st.UploadFileAsync(Add);
            st.DeleteFileAsync(Delete);
        }
コード例 #3
0
        public async void InitializeAsync()
        {
            DownloadWaitRing.IsActive = true;
            StorageFolder ordner = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFolderAsync("Puzzlebilder");

            foreach (StorageFile f in await ordner.GetFilesAsync())
            {
                FuegeBildZuListeHinzu(f);
            }


            if (Nutzer.Getinstance().StManager.IsDownloading)
            {
                Nutzer.Getinstance().StManager.DownloadAction += async(file) => await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => FuegeBildZuListeHinzu(file));

                Nutzer.Getinstance().StManager.DownloadEndedAction += async() => await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => DownloadWaitRing.IsActive = false);
            }
            else
            {
                DownloadWaitRing.IsActive = false;
            }
        }
コード例 #4
0
 public static void Abmelden(string s)
 {
     Nutzer.Getinstance().Abmelden();
     currentPage.Frame.Navigate(typeof(AnmeldeSeite), s);
 }
コード例 #5
0
        private void LoginButton_Click(object sender, RoutedEventArgs e)
        {
            Sounddesign.PlaySoundAsync(Sounddesign.BUTTON_PUSH1);

            if (App.OFFLINE_MODE)
            {
                Nutzer.Getinstance();
                this.Frame.Navigate(typeof(SpieleHub));
                return;
            }


            // Prüfe Eingaben
            if (nickname.Text.Length < 3)
            {
                FehlerAusgabe.Text = "Nickname zu kurz. Min. 3 Zeichen";
                return;
            }
            if (pwd.Password.Length < 6)
            {
                FehlerAusgabe.Text = "Passwort zu kurz. Min. 6 Zeichen";
                return;
            }

            if (!IsLogin && !pwdConfirm.Password.Equals(pwd.Password))
            {
                FehlerAusgabe.Text = "Passwörter stimmen nicht überein";
                return;
            }

            if (logingIn)
            {
                return;
            }
            logingIn = true;

            WaitRing.IsActive = true;

            loginButton.IsEnabled   = false;
            ToggleAuswahl.IsEnabled = false;
            nickname.IsEnabled      = false;
            pwd.IsEnabled           = false;
            pwdConfirm.IsEnabled    = false;
            credits.IsEnabled       = false;

            //Einloggen
            Request <Nutzer> request = null;
            string           name    = nickname.Text;
            string           pass    = pwd.Password;
            BackgroundWorker bw      = new BackgroundWorker();

            bw.DoWork += (s, e1) =>
            {
                request = Nutzer.Einloggen((IsLogin ? App.FUNCTION_LOGIN : App.FUNCTION_REGISTER), name, pass).GetAwaiter().GetResult();
                if (request != null && request.Success)
                {
                    SpielHighscores.HoleHighscoresAsync().GetAwaiter();
                }
            };
            bw.RunWorkerCompleted += (s, e1) => Login(request);
            bw.RunWorkerAsync();
        }