コード例 #1
0
        public void SaveAndClose()
        {
            var dataContext = this.DataContext;

              if (dataContext != null)
              {
            dataContext.Save();
            this.DataContext = null;
              }
        }
コード例 #2
0
        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;
        }
コード例 #3
0
 public void LoadDataContext()
 {
     SaveAndClose();
       this.DataContext = DoLoadDataContext();
 }
コード例 #4
0
 internal static void InitializeEasyBankContext(EasyBankContext value)
 {
     ScenarioContext.Current["EasyBankContext"] = value;
 }