예제 #1
0
        private void CheckSuccessfulUpload(FileUploadResponse rspObject)
        {
            if (!rspObject.success)
            {
                if (rspObject.validators == null)
                    throw new Exception("An error has been encountered on the server. \n" + rspObject.error);

                var validationErrorMessage = string.Join(Environment.NewLine, rspObject.validators);
                throw new Exception(validationErrorMessage);
            }

            if (string.IsNullOrWhiteSpace(rspObject.redirectTo))
                throw new Exception("Something's wrong. Response is empty!");
        }
예제 #2
0
        public ResponseForm(FileUploadResponse response)
        {
            InitializeComponent();

            txtUrl.Text = response.redirectTo;

            btnSaveQrCode.Enabled = false;
            btnSaveQrCode.Click += btnSaveQrCode_Click;
            imgQr.LoadCompleted += imgQr_LoadCompleted;

            imgQr.LoadAsync(response.qrUrl);

            Response = response;
        }
예제 #3
0
        private void CheckSuccessfulUpload(FileUploadResponse rspObject)
        {
            if (!rspObject.success)
            {
                if (rspObject.validators == null)
                {
                    throw new Exception("An error has been encountered on the server. \n" + rspObject.error);
                }

                var validationErrorMessage = string.Join(Environment.NewLine, rspObject.validators);
                throw new Exception(validationErrorMessage);
            }

            if (string.IsNullOrWhiteSpace(rspObject.redirectTo))
            {
                throw new Exception("Something's wrong. Response is empty!");
            }
        }