Пример #1
0
        public MessageHistoryTableTag(MessageLog log)
        {
            AddClass("table");

            Style("width", "inherit");
            Style("margin-top", "50px");

            AddHeaderRow(tr => {
                tr.Header(log.Description).Attr("colspan", "5").Style("text-align", "left");
            });

            AddHeaderRow(tr => {
                tr.Header("Node").Style("text-align", "left");
                tr.Header("Timestamp").Style("text-align", "left");
                tr.Header("Message").Style("text-align", "left").Style("width", "200px");
                tr.Header("Header = ").Style("text-align", "right");
                tr.Header("Value").Style("text-align", "left");
            });



            log.Records().Each(rec => {
                var headers = rec.Headers.IsNotEmpty()  ? rec.Headers.Split(';').ToArray() : new string[0];


                AddBodyRow(tr => {
                    tr.Cell(rec.Node).Attr("valign", "top").Style("padding-right", "30px");
                    tr.Cell(rec.Timestamp.ToLongTimeString()).Style("padding-right", "30px").Attr("valign", "top").Attr("nowrap", "true");
                    tr.Cell(rec.Message).Attr("valign", "top").Style("padding-right", "30px");

                    if (headers.Any())
                    {
                        var count = headers.Count().ToString();
                        tr.Children.Each(x => x.Attr("rowspan", count));

                        string headerValue = headers.First();
                        writeHeaderValue(headerValue, tr);
                    }
                });

                for (int i = 1; i < headers.Count(); i++)
                {
                    AddBodyRow(tr => writeHeaderValue(headers[i], tr));
                }

                if (rec.ExceptionText.IsNotEmpty())
                {
                    AddBodyRow(tr => {
                        var cell = tr.Cell();
                        cell.Attr("colspan", "5");


                        cell.Add("pre").Text(rec.ExceptionText).Style("background-color", "#FFFFAA");
                    });
                }
            });
        }
Пример #2
0
        public MessageHistoryTableTag(MessageLog log)
        {
            AddClass("table");

            Style("width", "inherit");
            Style("margin-top", "50px");

            AddHeaderRow(tr => {
                tr.Header(log.Description).Attr("colspan", "5").Style("text-align", "left");
            });

            AddHeaderRow(tr => {
                tr.Header("Node").Style("text-align", "left");
                tr.Header("Timestamp").Style("text-align", "left");
                tr.Header("Message").Style("text-align", "left").Style("width", "200px");
                tr.Header("Header = ").Style("text-align", "right");
                tr.Header("Value").Style("text-align", "left");
            });

            log.Records().Each(rec => {
                var headers = rec.Headers.IsNotEmpty()  ? rec.Headers.Split(';').ToArray() : new string[0];

                AddBodyRow(tr => {
                    tr.Cell(rec.Node).Attr("valign", "top").Style("padding-right", "30px");
                    tr.Cell(rec.Timestamp.ToLongTimeString()).Style("padding-right", "30px").Attr("valign", "top").Attr("nowrap", "true");
                    tr.Cell(rec.Message).Attr("valign", "top").Style("padding-right", "30px");

                    if (headers.Any())
                    {
                        var count = headers.Count().ToString();
                        tr.Children.Each(x => x.Attr("rowspan", count));

                        string headerValue = headers.First();
                        writeHeaderValue(headerValue, tr);
                    }
                });

                for (int i = 1; i < headers.Count(); i++)
                {
                    AddBodyRow(tr => writeHeaderValue(headers[i], tr));
                }

                if (rec.ExceptionText.IsNotEmpty())
                {
                    AddBodyRow(tr => {
                        var cell = tr.Cell();
                        cell.Attr("colspan", "5");

                        cell.Add("pre").Text(rec.ExceptionText).Style("background-color", "#FFFFAA");
                    });
                }
            });
        }
Пример #3
0
 protected bool Equals(MessageLog other)
 {
     return Id.Equals(other.Id);
 }
Пример #4
0
 public void AddChild(MessageLog child)
 {
     _children.Fill(child);
     child.Parent = this;
 }
Пример #5
0
 protected bool Equals(MessageLog other)
 {
     return(Id.Equals(other.Id));
 }
Пример #6
0
 public void AddChild(MessageLog child)
 {
     _children.Fill(child);
     child.Parent = this;
 }