NTP Analyzer  0.8.2
Analyze the operation of time servers
Ntp.Analyzer.Render.Host.BootstrapHostGraphRender Class Reference
Inheritance diagram for Ntp.Analyzer.Render.Host.BootstrapHostGraphRender:
Collaboration diagram for Ntp.Analyzer.Render.Host.BootstrapHostGraphRender:

Public Member Functions

 BootstrapHostGraphRender (Uri webPath, HostPageConfiguration page, IEnumerable< GraphSetConfiguration > graphs)
 
override string Render ()
 
override string RenderFooter ()
 
override string RenderHead ()
 
- Public Member Functions inherited from Ntp.Analyzer.Render.HtmlObjectRender
void Add (IHtmlObject child)
 

Private Attributes

readonly List< GraphSetConfigurationgraphs
 
readonly HostPageConfiguration page
 

Additional Inherited Members

- Public Attributes inherited from Ntp.Analyzer.Render.HtmlObjectRender
IEnumerable< IHtmlObjectChildren => children.ToArray()
 
- Protected Member Functions inherited from Ntp.Analyzer.Render.HtmlObjectRender
 HtmlObjectRender (Uri webPath)
 
- Properties inherited from Ntp.Analyzer.Render.HtmlObjectRender
Uri WebPath [get]
 
- Properties inherited from Ntp.Analyzer.Render.IHtmlObject
IEnumerable< IHtmlObjectChildren [get]
 
Uri WebPath [get]
 

Detailed Description

Definition at line 32 of file BootstrapHostGraphRender.cs.

Constructor & Destructor Documentation

Ntp.Analyzer.Render.Host.BootstrapHostGraphRender.BootstrapHostGraphRender ( Uri  webPath,
HostPageConfiguration  page,
IEnumerable< GraphSetConfiguration graphs 
)
inline

Definition at line 34 of file BootstrapHostGraphRender.cs.

38  : base(webPath)
39  {
40  this.page = page;
41  this.graphs = new List<GraphSetConfiguration>(graphs);
42  }

Member Function Documentation

override string Ntp.Analyzer.Render.Host.BootstrapHostGraphRender.Render ( )
inline

Implements Ntp.Analyzer.Render.IHtmlObject.

Definition at line 47 of file BootstrapHostGraphRender.cs.

48  {
49  var builder = new StringBuilder();
50  int count = 1;
51 
52  foreach (var graphSet in graphs)
53  {
54  //string open = (count == 1) ? " in" : String.Empty;
55  string open = string.Empty;
56 
57  builder.AppendLine(@" <div class=""panel panel-default"">");
58  builder.AppendLine(@" <div class=""panel-heading"">");
59  builder.AppendLine(@" <h4 class=""panel-title"">");
60 
61  // Include panel counter
62  builder.Append(@" <a class=""accordion-toggle"" data-toggle=""collapse"" ");
63  builder.Append(@"data-parent=""#accordion"" href=""#collapse");
64  builder.Append(count);
65  builder.AppendLine(@""">");
66 
67  builder.AppendLine($@" {graphSet.Title}");
68  builder.AppendLine(@" </a>");
69  builder.AppendLine(@" </h4>");
70  builder.AppendLine(@" </div>");
71 
72  builder.Append(@" <div id=""collapse");
73  builder.Append(count);
74  builder.Append($@""" class=""panel-collapse collapse{open}"">");
75  builder.AppendLine();
76  builder.AppendLine(@" <div class=""panel-body"">");
77 
78  foreach (var graph in graphSet.Graphs)
79  {
80  builder.Append(@" <div class=""container theme-graph2"">");
81 
82  if (page.GraphPages.Count() != 0)
83  {
84  builder.Append(@"<a href=""");
85  builder.Append(page.GraphPages.First().GetLink(graphSet, graph).ToHtmlString());
86  builder.Append(@""">");
87  }
88 
89  builder.Append(@"<img class=""img-responsive"" src=""");
90  builder.Append(graph.GetLink(graphSet).ToHtmlString());
91  builder.Append(@""" alt=""");
92  builder.Append(graph.GetAltName(graphSet));
93  builder.Append(@""">");
94 
95  if (page.GraphPages.Count() != 0)
96  {
97  builder.Append(@"</a>");
98  }
99 
100  builder.AppendLine(@"</div>");
101  }
102 
103  builder.AppendLine(@" </div>");
104  builder.AppendLine(@" </div>");
105  builder.AppendLine(@" </div>");
106 
107  count++;
108  }
109 
110  return builder.ToString();
111  }
IEnumerable< HostGraphPageConfiguration > GraphPages
Gets the host graph pages to be linked from this page.
override string Ntp.Analyzer.Render.Host.BootstrapHostGraphRender.RenderFooter ( )
inlinevirtual

Implements Ntp.Analyzer.Render.HtmlObjectRender.

Definition at line 113 of file BootstrapHostGraphRender.cs.

114  {
115  var builder = new StringBuilder();
116 
117  builder.AppendLine(@" </div>");
118  builder.AppendLine(@" </div>");
119 
120  return builder.ToString();
121  }
override string Ntp.Analyzer.Render.Host.BootstrapHostGraphRender.RenderHead ( )
inlinevirtual

Implements Ntp.Analyzer.Render.HtmlObjectRender.

Definition at line 123 of file BootstrapHostGraphRender.cs.

124  {
125  var builder = new StringBuilder();
126 
127  builder.AppendLine(@" <div class=""container theme-graph"">");
128  builder.AppendLine(@" <div class=""panel-group"" id=""accordion"">");
129 
130  return builder.ToString();
131  }

Member Data Documentation

readonly List<GraphSetConfiguration> Ntp.Analyzer.Render.Host.BootstrapHostGraphRender.graphs
private

Definition at line 44 of file BootstrapHostGraphRender.cs.

readonly HostPageConfiguration Ntp.Analyzer.Render.Host.BootstrapHostGraphRender.page
private

Definition at line 45 of file BootstrapHostGraphRender.cs.


The documentation for this class was generated from the following file: