Beispiel #1
0
        public async static Task <List <Item> > GetSIHistory()
        {
            var fileService = DependencyService.Get <ISaveAndLoad>();

            List <Item> result = null;

            string localFile = "SIData.xml";

            try
            {
                if (localFile != null)
                {
                    string localData = await fileService.LoadTextAsync(localFile);

                    result = ObjectSerializer <List <Item> > .FromXml((string)localData);
                }
            }
            catch (Exception ex)
            {
                localFile = null;
                //LoggingService.WriteLine(ex.Message, Severities.Error, Targets.Debug);
            }


            return(result);
        }
Beispiel #2
0
        private async void ReadOtherEventsData()
        {
            Windows.Storage.StorageFolder localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
            try
            {
                StorageFile otherEventsFile = await localFolder.GetFileAsync("otherEventsFile.txt");

                String dataString = await FileIO.ReadTextAsync(otherEventsFile);

                EventsManager.otherEvents = ObjectSerializer.FromXml(dataString);
            }
            catch (Exception)
            {
            }
        }