Ejemplo n.º 1
0
        /// <summary>
        /// Logs a user off the system and sets objects to null
        /// </summary>
        public static void LogOff()
        {
            _accountDetails.CreateUserDetailsFile(_accountDetails, _account.UserName);

            //Bellow needs implementing without errors

            /*foreach (Game game in AccountDetail.AccountShoppingCart.Games)
             * {
             *  ShoppingCart.Instance.RemoveGame(game);
             * }*/


            _account                 = null;
            _displaynameForUI        = null;
            _accountDetails          = null;
            SetProfileImagePathForUI = null;
            MainPageVm?.CallForAccountStatus();
            StoreVm?.OnAccountChanged();
            GameTemplateVm?.OnAccountChanged();
            ShoppingCart.Instance.ClearShoppingCart();
            MainPageVm?.RefreshPurchaseSelectedGame();
        }
Ejemplo n.º 2
0
 public void CreateUserDetailsFile(AccountDetails accountDetails, string username)
 {
     //Creates or writes the details stored in the properties of an object of this class to a file with the username provided, where username is a passed argument.
     FileHandler.WriteFile(Constants.AccountDetailsFolderPath + username + ".json", accountDetails);
 }
Ejemplo n.º 3
0
 static AccountHandler()
 {
     _account        = null;
     _accountDetails = null;
 }