Exemple #1
0
        public string Delete(string[] @params, MooNetClient invokerClient)
        {
            if (@params.Count() == 0)
            {
                return("Invalid arguments. Type 'help account delete' to get help.");
            }

            var account = AccountManager.GetAccountByEmail(@params[0]);

            if (account == null)
            {
                return(string.Format("No account with email '{0}' exists.", @params));
            }

            //Delete toons of the account.
            foreach (var toon in ToonManager.GetToonsForAccount(account).Values)
            {
                ToonManager.DeleteToon(toon);
            }

            AccountManager.DeleteAccount(account);

            return(string.Format("Deleted account {0}.", @params));
        }