示例#1
0
        public void DownloadTest()
        {
            var remoteDB = new PostgreSQLDBHelper();
            var localDB  = new DatabaseHelper(DatabaseHelper.DatabaseNameEachPC);

            var synchronizer = new DBSynchronizer(remoteDB, localDB);

            synchronizer.Download();
        }
示例#2
0
        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();
        }
示例#3
0
        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));
        }