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

Public Member Functions

 DefaultPeerSummaryGraphRender (int hostId, PeerSummaryPageConfiguration 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 int hostId
 
readonly PeerSummaryPageConfiguration 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 33 of file DefaultPeerSummaryGraphRender.cs.

Constructor & Destructor Documentation

Ntp.Analyzer.Render.Summary.DefaultPeerSummaryGraphRender.DefaultPeerSummaryGraphRender ( int  hostId,
PeerSummaryPageConfiguration  page,
IEnumerable< GraphSetConfiguration graphs 
)
inline

Definition at line 35 of file DefaultPeerSummaryGraphRender.cs.

39  : base(page.WebPath)
40  {
41  this.hostId = hostId;
42  this.page = page;
43  this.graphs = new List<GraphSetConfiguration>(graphs);
44  }
Uri WebPath
Gets the web path in the HostSubConfiguration.

Member Function Documentation

override string Ntp.Analyzer.Render.Summary.DefaultPeerSummaryGraphRender.Render ( )
inline

Implements Ntp.Analyzer.Render.IHtmlObject.

Definition at line 50 of file DefaultPeerSummaryGraphRender.cs.

References Ntp.Analyzer.Data.DataFace.Instance, and Ntp.Analyzer.Data.DataFace.PeerActivities.

51  {
52  var builder = new StringBuilder();
53 
54  var peers = DataFace.Instance.PeerActivities.
55  Where(p => p.Host.Id == hostId && p.IsActive);
56 
57  foreach (var entry in peers)
58  {
59  foreach (var graphSet in graphs)
60  {
61  foreach (var graph in graphSet.Graphs)
62  {
63  builder.Append(@"<a href=""");
64  builder.Append(page.GetPeerLink(entry.Id).ToHtmlString());
65  builder.Append(@""">");
66  builder.Append(@"<img src=""");
67  builder.Append(
68  graph.GetLink(graphSet, entry.Id.ToString(CultureInfo.InvariantCulture)).ToHtmlString());
69  builder.Append(@""" alt=""");
70  builder.Append(graph.GetAltName(graphSet, entry.Peer.Name));
71  builder.Append(@""">");
72  builder.AppendLine(@"</a>");
73  }
74  }
75  }
76 
77  return builder.ToString();
78  }
Uri GetPeerLink(int peerId)
Gets the link related to specified peer.
Singleton facade class used to access memory persistent data.
Definition: DataFace.cs:30
PeerActivityDatabaseMapper PeerActivities
Gets the peer activity mapper.
Definition: DataFace.cs:99
static DataFace Instance
Gets the Singleton instance.
Definition: DataFace.cs:51
override string Ntp.Analyzer.Render.Summary.DefaultPeerSummaryGraphRender.RenderFooter ( )
inlinevirtual

Implements Ntp.Analyzer.Render.HtmlObjectRender.

Definition at line 80 of file DefaultPeerSummaryGraphRender.cs.

81  {
82  return string.Empty;
83  }
override string Ntp.Analyzer.Render.Summary.DefaultPeerSummaryGraphRender.RenderHead ( )
inlinevirtual

Implements Ntp.Analyzer.Render.HtmlObjectRender.

Definition at line 85 of file DefaultPeerSummaryGraphRender.cs.

86  {
87  return string.Empty;
88  }

Member Data Documentation

readonly List<GraphSetConfiguration> Ntp.Analyzer.Render.Summary.DefaultPeerSummaryGraphRender.graphs
private

Definition at line 46 of file DefaultPeerSummaryGraphRender.cs.

readonly int Ntp.Analyzer.Render.Summary.DefaultPeerSummaryGraphRender.hostId
private

Definition at line 47 of file DefaultPeerSummaryGraphRender.cs.

readonly PeerSummaryPageConfiguration Ntp.Analyzer.Render.Summary.DefaultPeerSummaryGraphRender.page
private

Definition at line 48 of file DefaultPeerSummaryGraphRender.cs.


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