Beispiel #1
0
        /// <summary>
        /// Returns <see cref="IFieldObject"/> as an HTML string with or without HTML headers.
        /// </summary>
        /// <param name="fieldObject"></param>
        /// <param name="includeHtmlHeaders"></param>
        /// <returns></returns>
        public static string TransformToHtmlString(IFieldObject fieldObject, bool includeHtmlHeaders)
        {
            if (fieldObject == null)
            {
                throw new ArgumentNullException(nameof(fieldObject), ScriptLinkHelpers.GetLocalizedString("parameterCannotBeNull", CultureInfo.CurrentCulture));
            }
            StringBuilder sb = new StringBuilder();

            sb.Append(GetHeader(fieldObject.GetType().ToString(), includeHtmlHeaders));
            sb.Append(GetHtmlForObject(fieldObject, HtmlOutputType.Table));
            sb.Append(GetFooter(includeHtmlHeaders));
            return(sb.ToString());
        }
Beispiel #2
0
        /// <summary>
        /// Returns <see cref="IFieldObject"/> as an HTML string with or without HTML headers.
        /// </summary>
        /// <param name="fieldObject"></param>
        /// <param name="includeHtmlHeaders"></param>
        /// <returns></returns>
        public static string TransformToHtmlString(IFieldObject fieldObject, bool includeHtmlHeaders)
        {
            if (fieldObject == null)
            {
                throw new ArgumentException("Parameter cannot be null.", "fieldObject");
            }
            string html = "";

            html += includeHtmlHeaders ? GetHtmlHeader() : "";
            html += GetPageHeader(fieldObject.GetType().ToString());
            html += GetHtmlForObject(fieldObject, HtmlOutputType.Table);
            html += includeHtmlHeaders ? GetHtmlFooter() : "";
            return(html);
        }