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); }
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; } }
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)); }
public async void SaveTagsToXml() { await XmlIo.SaveObjectToXml(this.TagList, this._tagSave); this.AnalyseList(); }
private async void SaveTransactionListToXml() { await XmlIo.SaveObjectToXml(this._completeTransactionList, this._transactionSave); }