コード例 #1
0
        /*
         * Whenever the register button is called create a file with the details parsed through the Entry controls
         *
         * PARAM
         * sender: reference to the control object
         * eventargs: object data
         * RETURNS Nothing
         */
        public async Task RegisterAddAccountFIREBASE()
        {
            try
            {
                if ((!Username.Equals("") && !Password.Equals("") && !FullName.Equals("")))// check if both username, password and equals are not filled
                {
                    IsRunning = true;
                    FirebaseUser client = new FirebaseUser();
                    await client.Register(FullName, Username, Password, Navigation);

                    IsRunning = false;
                    return;
                }
                else
                {
                    throw new Exception("Please enter all credentials... ");// throw exception
                }
            }
            catch (Exception es)
            {
                if (es != null)
                {
                    try
                    {
                        await page.DisplayAlert("Error", es.Message, "Close");
                    }catch { throw new Exception(es.Message); }
                }// display error message
                else
                {
                    await page.DisplayAlert("Error", "Please delete current account", "Close");
                }
            }
        }