예제 #1
0
        public string ToHtmlString()
        {
            IHtmlWriter htmlWriter = new HtmlWriter();
            this.SetupDataBind(htmlWriter);

            if (null != this.field.Widget && !String.IsNullOrEmpty(this.field.Widget.Width))
                htmlWriter.Prop("style", "width:" + this.field.Widget.Width);

            //ReadOnly jQuery 1.6+
            if (this.field.ReadOnly)
                htmlWriter.Prop("disabled", true);

            //setUpValidation
            htmlWriter
                .Prop("data-val", "true");
            if (!this.field.IsNullable)
            {
                htmlWriter
                    .Prop("required", "true")
                    .Prop("data-val-required", "Bu Alan Boş Geçilemez.")
                    .Prop("data-required-required", "Bu Alan Boş Geçilemez.");
            }
            //

            htmlWriter.AppendExtendedHtml(this.field);//tag lenmeden önce

            this.WriteHtml(htmlWriter, this.field);

            string html = htmlWriter.ToString();

            string script = "";
            IHtmlWriter scriptWriter = new HtmlWriter();
            this.WriteScript(scriptWriter, this.field);
            if (scriptWriter.Length > 0)
            {
                IHtmlWriter scriptWriterFinal = new HtmlWriter();
                scriptWriterFinal
                    .Append("jQuery(function(){")
                    .Append(scriptWriter)
                    .Append("});")
                    .Tag("script", TagTypes.Paired);

                script = scriptWriterFinal.ToString();
            }

            return html + script;

        }
예제 #2
0
        public void Execute()
        {
            List <FileInfo> files = new List <FileInfo>();

            foreach (String fileFilter in _howToGenerate.FileFilter)
            {
                files.AddRange(GetFiles(fileFilter));
            }

            // TODO: ReferenceTable

            var writer = new HtmlWriter("out.html", _howToGenerate.ColumnWidth);

            writer.AddCssIncludes(
                new CssInclude("screen.css"),
                new CssInclude("print.css")
            {
                Media = "print"
            },
                new CssInclude("ie.css")
            {
                Conditional = "if lt IE 8"
            },
                new CssInclude("custom.css"),
                new CssInclude("fancy-type-screen.css")
                );

            foreach (FileInfo file in files)
            {
                Console.WriteLine("Processing file " + file.FullName);

                var content  = File.ReadAllText(file.FullName);
                var markdown = new Markdown();
                var html     = markdown.Transform(content);

                writer.Append(html);
            }

            writer.Write();
        }
예제 #3
0
        public IActionResult Index(int maxCount = 200)
        {
            var html = new HtmlWriter();

            html.Append("<pre>");

            html.Append(QueryToHtml("TaskQueueError", maxCount));
            html.Append(QueryToHtml("TaskQueue", maxCount));
            html.Append(QueryToHtml("TaskLog", maxCount));

            html.Tag("h3", "SysLog Verbose");
            html.Append(SysLogToHtml("Verbose", maxCount));

            html.Append("</pre>");
            var contentResult = new NinHtmlResult(html.ToString());

            Log.v("DIAG", "Index: " + contentResult.Content.Length);
            return(contentResult);
        }