NTP Analyzer  0.8.2
Analyze the operation of time servers
PeerSummaryPageConfiguration.cs
Go to the documentation of this file.
1 //
2 // Copyright (c) 2013-2017 Carsten Sonne Larsen <cs@innolan.net>
3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal
6 // in the Software without restriction, including without limitation the rights
7 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 // copies of the Software, and to permit persons to whom the Software is
9 // furnished to do so, subject to the following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included in
12 // all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 // THE SOFTWARE.
21 
22 using System;
23 using System.Collections.Generic;
27 using Ntp.Analyzer.Config.Table;
28 using Ntp.Common.Process;
29 
30 namespace Ntp.Analyzer.Config.Node.Page
31 {
33  {
35  string configName,
36  int? frequency,
37  bool? initialRun,
38  bool? fixedRun,
39  PageTheme? theme,
40  string title,
41  PeerPageConfiguration peerPage,
42  IEnumerable<GraphSetConfiguration> graphs,
43  DestinationCollection destinations,
44  Uri link)
45  : base(configName, destinations, link)
46  {
47  this.frequency = frequency;
48  this.initialRun = initialRun;
49  this.fixedRun = fixedRun;
50  this.theme = theme;
51  this.graphs = new List<GraphSetConfiguration>(graphs);
52  Title = title;
53  ConfigLink = link;
54  PeerPageConfiguration = peerPage;
55  }
56 
57  private readonly bool? fixedRun;
58  private readonly int? frequency;
59  private readonly List<GraphSetConfiguration> graphs;
60  private readonly bool? initialRun;
61  private readonly PageTheme? theme;
62 
63  [NtpaIndex(11)]
64  [NtpaSetting(Symbol.KeywordPageTemplate, PageTheme.Default)]
65  public override PageTheme Theme => theme ?? PageTheme.Default;
66 
67  [NtpaIndex(10)]
68  [NtpaSetting(Symbol.KeywordPageTitle, Layout = Layout.Quoted)]
69  public override string Title { get; }
70 
71  [NtpaIndex(12)]
72  [NtpaReference(Symbol.KeywordPeerPage)]
74 
79  [NtpaIndex(30)]
80  [NtpaSettingsCollection(Symbol.KeywordGraphSet)]
81  public IEnumerable<GraphSetConfiguration> Graphs => graphs;
82 
83  [NtpaIndex(20)]
84  [NtpaSetting(Symbol.KeywordLink)]
85  public Uri ConfigLink { get; }
86 
87  [NtpaIndex(1)]
88  [NtpaSetting(Symbol.KeywordFrequency, 1080)]
89  public int Frequency => frequency ?? 1080;
90 
91  [NtpaIndex(2)]
92  [NtpaSetting(Symbol.KeywordInitialRun, true)]
93  public bool InitialRun => initialRun ?? true;
94 
95  [NtpaIndex(3)]
96  [NtpaSetting(Symbol.KeywordFixedRun, false)]
97  public bool FixedRun => fixedRun ?? false;
98 
104  public Uri GetPeerLink(int peerId)
105  {
106  return PeerPageConfiguration.GetLink(peerId);
107  }
108  }
109 }
Uri GetPeerLink(int peerId)
Gets the link related to specified peer.
Uri GetLink(int peerId)
Gets the link related to specified peer.
PeerSummaryPageConfiguration(string configName, int?frequency, bool?initialRun, bool?fixedRun, PageTheme?theme, string title, PeerPageConfiguration peerPage, IEnumerable< GraphSetConfiguration > graphs, DestinationCollection destinations, Uri link)