Esempio n. 1
0
        private void UploadFinish(object obj, FileSyncRequestResultEventArgs arg)
        {
            switch (arg.Result)
            {
                case FileSyncAPIRequestResult.Success:

                    FileManagerResponse response = new FileManagerResponse();

                    if (!string.IsNullOrEmpty(arg.Response))
                    {
                        response = JsonHelper.DeserializeObject<FileManagerResponse>(arg.Response);

                        response.RawResponse = arg.Response;

                        BaseResponse resp = JsonConvert.DeserializeObject<BaseResponse>(arg.Response);

                        if (resp.Status == 1)
                        {
                            SyncFileViewState();

                            UiLog.Log("上传文件成功");
                        }
                        else
                        {
                            UiLog.Log("上传文件失败");
                        }
                    }

                    break;
                case FileSyncAPIRequestResult.Fail:
                    MessageBox.Show("调用API时发生错误, 错误消息:" + arg.Error.error_msg);
                    break;
                default:
                    break;
            }
        }