コード例 #1
0
ファイル: Join.razor.cs プロジェクト: DataJuggler/BlazorChat
        /// <summary>
        /// This method Signs Up a User
        /// </summary>
        public void SignUp()
        {
            // validate the user
            bool isValid = ValidateUser();

            // if everything is valid
            if (isValid)
            {
                // Set to 0 percent
                Percent = 0;

                // Process the Login
                bool started = StartProcessSignUp();

                // if the InvisiibleSprite exists
                if ((HasInvisibleSprite) && (started))
                {
                    // A login in process is true
                    LoginInProcess = true;

                    // Start the Timer
                    InvisibleSprite.Start();
                }

                // Show the ProgressBar
                ShowProgress = true;
            }
        }
コード例 #2
0
ファイル: Join.razor.cs プロジェクト: DataJuggler/BlazorChat
        /// <summary>
        /// method Refresh
        /// </summary>
        public void Refresh()
        {
            // if the value for LoginInProcess is true
            if (LoginInProcess)
            {
                // increment by 1
                Percent += 1;

                // go a little past 100 for effect
                if (Percent >= 100)
                {
                    // Increment
                    ExtraPercent++;
                }

                // if higher than 10
                if (ExtraPercent >= 10)
                {
                    // Stop the timer
                    InvisibleSprite.Stop();
                    ShowProgress = false;
                }
            }

            // Update the UI
            InvokeAsync(() =>
            {
                StateHasChanged();
            });
        }
コード例 #3
0
ファイル: Login.razor.cs プロジェクト: DataJuggler/BlazorChat
        /// <summary>
        /// This method Login Button _ Click
        /// </summary>
        public async void LoginButton_Click()
        {
            // if the value for HasParentIndexPage is true
            if (HasParentIndexPage)
            {
                // Set to 0 percent
                Percent = 0;

                // Process the Login
                bool started = await StartProcessLogin();

                // Now start the Timer in the invisible sprite.
                // The Refresh method gets called every time the Interval of the Sprite elapses.

                // if the InvisiibleSprite exists
                if ((HasInvisibleSprite) && (started))
                {
                    // A login in process is true
                    LoginInProcess = true;

                    // Start the Timer
                    InvisibleSprite.Start();
                }

                // Show the ProgressBar
                ShowProgress = true;
            }
        }
コード例 #4
0
ファイル: Login.razor.cs プロジェクト: DataJuggler/BlazorChat
        /// <summary>
        /// method Refresh
        /// </summary>
        public void Refresh()
        {
            // if the value for LoginInProcess is true
            if (LoginInProcess)
            {
                // increment by 4
                Percent += 4;

                // go a little past 100 for effect
                if (Percent >= 100)
                {
                    // Increment
                    ExtraPercent++;
                }

                // if higher than 10
                if (ExtraPercent >= 10)
                {
                    // Stop the timer
                    ShowProgress = false;
                }
                else if (ExtraPercent >= 20)
                {
                    // Stop the Sprite
                    InvisibleSprite.Stop();

                    // Show a login failed message
                    ValidationMessage = "The credentials entered were either not found or invalid.";
                }
            }

            // Update the UI
            InvokeAsync(() =>
            {
                StateHasChanged();
            });
        }