public virtual string GetSubmissionDataFieldValueCustom(HttpRequestBase requestBase, Submission submissionData, FriendlyNameInfo friendlyName, bool performHtmlEncode) { string empty = string.Empty; if (submissionData == null || submissionData.Data == null) { return(empty); } string rawData = submissionData.Data.FirstOrDefault( x => x.Key.Equals(friendlyName.ElementId, StringComparison.OrdinalIgnoreCase)).Value as string; if (!string.IsNullOrEmpty(rawData) && friendlyName.FormatType.Equals((object)FormatType.Link)) { IDictionary <string, string> postedFiles = this.GetPostedFilesCustom(rawData); if (postedFiles != null && postedFiles.Count > 0) { return(performHtmlEncode ? this.GetPostedFilesInHtmlFormat(requestBase, postedFiles) : this.GetPostedFilesInPlainTextFormat(requestBase, postedFiles)); } } if (string.IsNullOrEmpty(rawData)) { return(rawData); } return(performHtmlEncode ? WebUtility.HtmlEncode(rawData) : rawData); }
public virtual IEnumerable <PlaceHolder> GetFriendlyNamePlaceHoldersCustom(HttpRequestBase requestBase, Submission submissionData, IEnumerable <FriendlyNameInfo> friendlyNames, bool performHtmlEncode) { if (friendlyNames != null && friendlyNames.Count <FriendlyNameInfo>() != 0) { foreach (FriendlyNameInfo friendlyName in friendlyNames) { FriendlyNameInfo fname = friendlyName; yield return (new PlaceHolder(fname.FriendlyName, this.GetSubmissionDataFieldValueCustom(requestBase, submissionData, fname, performHtmlEncode)) ); } } }