Exemplo n.º 1
0
        public static async Task <List <Stars> > LoadStarsAsync()
        {
            if (Storage.Exists(StarMapFile))
            {
                var list = await Storage.LoadTextAsync(StarMapFile);

                return(JsonConvert.DeserializeObject <List <Stars> >(list));
            }
            else
            {
                return(null);
            }
        }
        public async Task <AccountCollection> LoadAccountsAsync()
        {
            if (Storage.Exists(AccountFile))
            {
                var file = await Storage.LoadTextAsync(AccountFile);

                if (file.Length > 0)
                {
                    var des = Newtonsoft.Json.JsonConvert.DeserializeObject <AccountCollection>(file);
                    return(des);
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                return(null);
            }
        }