public void DownloadTest() { var remoteDB = new PostgreSQLDBHelper(); var localDB = new DatabaseHelper(DatabaseHelper.DatabaseNameEachPC); var synchronizer = new DBSynchronizer(remoteDB, localDB); synchronizer.Download(); }
public void UploadTest() { var remoteDB = new PostgreSQLDBHelper(); var localDB = new DatabaseHelper(DatabaseHelper.DatabaseNameEachPC); var testComment = new Comment(); testComment.CreationDateTime = DateTime.Now; testComment.TextContent = "test用コメント"; var synchronizer = new DBSynchronizer(remoteDB, localDB); synchronizer.Upload(); }
public MainWindowViewModel() { DBHelper = new PostgreSQLDBHelper(); // PostgreSQL の方がつながっていなければオフラインの sqlite に切り替え。 if (!DBHelper.Connected) { DBHelper = new DatabaseHelper("Diarydb"); SwitchDBCommand.Execute(DBType.Local); } LoadCommand.Execute(); UIColors.ChangeTheme((ColorTheme)Enum.ToObject(typeof(ColorTheme), Properties.Settings.Default.ColorTheme)); }