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

Public Member Functions

 HostLineRender (StatusLine statusLine, PeerPageConfiguration peerPages)
 
override string Render ()
 
override string RenderFooter ()
 
override string RenderHead ()
 
- Public Member Functions inherited from Ntp.Analyzer.Render.HtmlObjectRender
void Add (IHtmlObject child)
 

Properties

string PeerName [get]
 
- Properties inherited from Ntp.Analyzer.Render.HtmlObjectRender
Uri WebPath [get]
 
- Properties inherited from Ntp.Analyzer.Render.IHtmlObject
IEnumerable< IHtmlObjectChildren [get]
 
Uri WebPath [get]
 

Private Attributes

string Country => Server != null ? Server.Country : string.Empty
 
string Location
 
int PageId => statusLine.PeerActivity.Id
 
AssociationEntry Peer => statusLine.Peer
 
readonly PeerPageConfiguration peerPages
 
TimeServer Server => statusLine.PeerActivity.Peer.Server
 
readonly StatusLine statusLine
 

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)
 

Detailed Description

Definition at line 29 of file HostLineRender.cs.

Constructor & Destructor Documentation

Ntp.Analyzer.Render.Host.HostLineRender.HostLineRender ( StatusLine  statusLine,
PeerPageConfiguration  peerPages 
)
inline

Definition at line 31 of file HostLineRender.cs.

32  : base(peerPages?.WebPath)
33  {
34  this.statusLine = statusLine;
35  this.peerPages = peerPages;
36  }
readonly PeerPageConfiguration peerPages

Member Function Documentation

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

Implements Ntp.Analyzer.Render.IHtmlObject.

Definition at line 62 of file HostLineRender.cs.

63  {
64  var builder = new StringBuilder();
65 
66  builder.Append($"<td>{Peer.TallyChar}</td>");
67  builder.Append($"<td>{PeerName}</td>");
68  builder.Append($@"<td class=""aright"">{Peer.Stratus}</td>");
69  builder.Append($@"<td class=""aright"">{Peer.LastPoll}</td>");
70  builder.Append($@"<td class=""aright2"">{Peer.Poll}</td>");
71  builder.Append($@"<td class=""aright"">{Peer.Reach}</td>");
72  builder.Append($@"<td class=""aright"">{Peer.Delay.ToString("0.000")}</td>");
73  builder.Append($@"<td class=""aright"">{Peer.Offset.ToString("0.000")}</td>");
74  builder.Append($@"<td class=""aright"">{Peer.Jitter.ToString("0.000")}</td>");
75  builder.Append($@"<td class=""aright"">{Country}</td>");
76 
77  if (peerPages != null)
78  {
79  builder.Append(@"<td><a href=""");
80  builder.Append(peerPages.GetLink(PageId).ToHtmlString());
81  builder.Append(@""">");
82  builder.Append(Location);
83  builder.AppendLine("</a></td>");
84  }
85  else
86  {
87  builder.Append(@"<td>");
88  builder.Append(Location);
89  builder.AppendLine("</td>");
90  }
91 
92  return builder.ToString();
93  }
Uri GetLink(int peerId)
Gets the link related to specified peer.
readonly PeerPageConfiguration peerPages
override string Ntp.Analyzer.Render.Host.HostLineRender.RenderFooter ( )
inlinevirtual

Implements Ntp.Analyzer.Render.HtmlObjectRender.

Definition at line 95 of file HostLineRender.cs.

96  {
97  return "</tr>";
98  }
override string Ntp.Analyzer.Render.Host.HostLineRender.RenderHead ( )
inlinevirtual

Implements Ntp.Analyzer.Render.HtmlObjectRender.

Definition at line 100 of file HostLineRender.cs.

101  {
102  return "<tr>";
103  }

Member Data Documentation

string Ntp.Analyzer.Render.Host.HostLineRender.Country => Server != null ? Server.Country : string.Empty
private

Definition at line 54 of file HostLineRender.cs.

string Ntp.Analyzer.Render.Host.HostLineRender.Location
private
Initial value:
=> string.IsNullOrEmpty(Server?.DisplayLocation)
? "Unknown"
: Server.DisplayLocation

Definition at line 56 of file HostLineRender.cs.

int Ntp.Analyzer.Render.Host.HostLineRender.PageId => statusLine.PeerActivity.Id
private

Definition at line 60 of file HostLineRender.cs.

AssociationEntry Ntp.Analyzer.Render.Host.HostLineRender.Peer => statusLine.Peer
private

Definition at line 41 of file HostLineRender.cs.

readonly PeerPageConfiguration Ntp.Analyzer.Render.Host.HostLineRender.peerPages
private

Definition at line 38 of file HostLineRender.cs.

TimeServer Ntp.Analyzer.Render.Host.HostLineRender.Server => statusLine.PeerActivity.Peer.Server
private

Definition at line 43 of file HostLineRender.cs.

readonly StatusLine Ntp.Analyzer.Render.Host.HostLineRender.statusLine
private

Definition at line 39 of file HostLineRender.cs.

Property Documentation

string Ntp.Analyzer.Render.Host.HostLineRender.PeerName
getprivate

Definition at line 46 of file HostLineRender.cs.


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