public void SaveAndClose() { var dataContext = this.DataContext; if (dataContext != null) { dataContext.Save(); this.DataContext = null; } }
private EasyBankContext DoLoadDataContext() { var context = new EasyBankContext( new CsvAgent(new CsvGateway(new FileAccess(), pathProvider)), new YnabAgent(new YnabGateway(new FileAccess(), pathProvider, cultureSettings)), new XmlAgent(new XmlGateway(new FileAccess(), pathProvider)), new FileAccess(), pathProvider); if (System.IO.File.Exists(pathProvider.PathToXmlFile)) { context.Load(); } return context; }
public void LoadDataContext() { SaveAndClose(); this.DataContext = DoLoadDataContext(); }
internal static void InitializeEasyBankContext(EasyBankContext value) { ScenarioContext.Current["EasyBankContext"] = value; }