Example #1
0
        private async Task <ObservableCollection <Tag> > LoadTagsFromXml()
        {
            if (File.Exists(Path.Combine(ApplicationData.Current.LocalFolder.Path, this._tagSave)))
            {
                return(await XmlIo.ReadObjectFromXmlFileAsync <ObservableCollection <Tag> >(this._tagSave));
            }

            return(null);
        }
Example #2
0
        private async void LoadTransactionListFromXml()
        {
            if (File.Exists(Path.Combine(ApplicationData.Current.LocalFolder.Path, this._transactionSave)))
            {
                var list = await XmlIo.ReadObjectFromXmlFileAsync <ObservableCollection <TransactionEntry> >(this._transactionSave);

                this._completeTransactionList = new List <TransactionEntry>(list);
                this.TransactionList          = list;
            }
        }
Example #3
0
        public void TestXmlIoFile(double radius, double side, Color color, string fileName)
        {
            List <IShape> shapes = new List <IShape> {
                new PaperCircle(radius), new MembraneSquare(side)
            };

            (shapes[0] as IPaper).Paint(color);
            IDataIo dataIo = new XmlIo();

            dataIo.WriteFile(shapes, fileName);

            Assert.IsTrue(File.Exists(fileName));

            List <IShape> readedShapes = dataIo.ReadFile(fileName);

            File.Delete(fileName);

            Assert.IsTrue(readedShapes.SequenceEqual(shapes));
        }
Example #4
0
        public async void SaveTagsToXml()
        {
            await XmlIo.SaveObjectToXml(this.TagList, this._tagSave);

            this.AnalyseList();
        }
Example #5
0
 private async void SaveTransactionListToXml()
 {
     await XmlIo.SaveObjectToXml(this._completeTransactionList, this._transactionSave);
 }