예제 #1
0
        private void Open()
        {
            IFileWorker worker = DependencyService.Get <IFileWorker>();

            if (worker.ExistAsync(basename).Result)
            {
                SessionBase = worker.OpenBase(basename).Result;
            }
        }
예제 #2
0
        private List <QuestCase> LoadBase(string xml)
        {
            IFileWorker worker = DependencyService.Get <IFileWorker>();
            // List<QuestCase> myBase = new List<QuestCase>();
            List <QuestCase> myBase;

            if (!worker.ExistAsync(basename).Result)
            {
                myBase = Parse(xml);
            }
            else
            {
                try
                {
                    myBase = worker.OpenBase(basename).Result;
                }
                catch (Exception)
                {
                    worker.DeleteAsync(basename);
                    myBase = Parse(xml);
                }
            }
            return(myBase);
        }