public override string ToString() { return(URLHelpers.GetHostName(UploadURL)); }
public bool ShouldSerializeName() => !string.IsNullOrEmpty(Name) && Name != URLHelpers.GetHostName(RequestURL);
private void CustomUploaderLoad(CustomUploaderItem uploader) { txtName.Text = uploader.Name ?? ""; txtName.SetWatermark(URLHelpers.GetHostName(uploader.RequestURL) ?? ""); CustomUploaderSetDestinationType(uploader.DestinationType); cbRequestMethod.SelectedIndex = (int)uploader.RequestMethod; rtbRequestURL.Text = uploader.RequestURL ?? ""; CustomUploaderSyntaxHighlight(rtbRequestURL); dgvParameters.Rows.Clear(); if (uploader.Parameters != null) { foreach (KeyValuePair <string, string> arg in uploader.Parameters) { dgvParameters.Rows.Add(new string[] { arg.Key, arg.Value }); } } dgvHeaders.Rows.Clear(); if (uploader.Headers != null) { foreach (KeyValuePair <string, string> arg in uploader.Headers) { dgvHeaders.Rows.Add(new string[] { arg.Key, arg.Value }); } } cbBody.SelectedIndex = (int)uploader.Body; dgvArguments.Rows.Clear(); if (uploader.Arguments != null) { foreach (KeyValuePair <string, string> arg in uploader.Arguments) { dgvArguments.Rows.Add(new string[] { arg.Key, arg.Value }); } } txtFileFormName.Text = uploader.FileFormName ?? ""; rtbData.Text = uploader.Data ?? ""; CustomUploaderSyntaxHighlight(rtbData); txtJsonPath.Text = ""; txtXPath.Text = ""; dgvRegex.Rows.Clear(); if (uploader.RegexList != null) { foreach (string regex in uploader.RegexList) { dgvRegex.Rows.Add(new string[] { regex }); } } rtbResultURL.Text = uploader.URL; CustomUploaderSyntaxHighlight(rtbResultURL); rtbResultThumbnailURL.Text = uploader.ThumbnailURL; CustomUploaderSyntaxHighlight(rtbResultThumbnailURL); rtbResultDeletionURL.Text = uploader.DeletionURL; CustomUploaderSyntaxHighlight(rtbResultDeletionURL); rtbResultErrorMessage.Text = uploader.ErrorMessage; CustomUploaderSyntaxHighlight(rtbResultErrorMessage); CustomUploaderUpdateStates(); }