示例#1
0
        private void RestoreTask(string saveID)
        {
            var restoreResp = Common.APISimpleRequest("restoreSave", null, null, saveID,
                                                      Common.ConvertToSQLDateTime(DateTime.Now));

            if (restoreResp.status == "success")
            {
                initiatorBaseForm.ExternalSync("restoreSync");
            }
        }
示例#2
0
        private void GetHistoryTask()
        {
            var rawHistory     = Common.APISimpleRequest("getHistory");
            var decodedHistory = Encoding.UTF8.GetString(Convert.FromBase64String(rawHistory.response));
            var history        = JsonConvert.DeserializeObject <List <Common.APIHistoryData> >(decodedHistory);

            BeginInvoke((Action) delegate
            {
                historyGrid.AutoGenerateColumns = true;
                historyGrid.DataSource          = history;
                SetColSizes();
            });
        }
示例#3
0
        private void DeleteTask(string saveID)
        {
            var deleteResp = Common.APISimpleRequest("deleteSave", null, null, saveID);

            if (deleteResp.status == "success")
            {
                MessageBox.Show($"Deletion of save with saveID: {saveID} was successful.");
                var historyTask = new Task(() => GetHistoryTask());
                historyTask.Start();
                // todo toast notification
            }
            else
            {
                MessageBox.Show(
                    $"An error occured while trying to delete save with saveID: {saveID}. ErrCode: {deleteResp.response}");
                // todo toast notification
            }
        }