Modernization Fixes & Updates to Default Values (#3)

This commit is contained in:
Kamron Batman 2018-10-28 00:33:16 -07:00 • committed by GitHub
parent 445eddff68
commit dcf64091b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
768 changed files with 10507 additions and 14196 deletions

View file

@ -1,5 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
namespace Server.Engines.Reports
{
@ -154,14 +154,14 @@ namespace Server.Engines.Reports
DateTime startPeriod = history.Snapshots[0].TimeStamp.Date + TimeSpan.FromDays(1.0);
DateTime endPeriod = history.Snapshots[history.Snapshots.Count - 1].TimeStamp.Date;
ArrayList regions = new ArrayList();
List<BarRegion> regions = new List<BarRegion>();
DateTime curDate = DateTime.MinValue;
int curPeak = -1;
int curLow = 1000;
int curTotl = 0;
int curCont = 0;
int curValu = 0;
int curValu;
for (int i = 0; i < history.Snapshots.Count; ++i)
{
@ -195,7 +195,7 @@ namespace Server.Engines.Reports
}
else
{
BarRegion region = (BarRegion)regions[regions.Count - 1];
BarRegion region = regions[regions.Count - 1];
if (region.m_Name == mnthName)
region.m_RangeTo = barGraph.Items.Count;
@ -220,7 +220,7 @@ namespace Server.Engines.Reports
curDate = thisDate;
}
barGraph.Regions = (BarRegion[])regions.ToArray(typeof(BarRegion));
barGraph.Regions = regions.ToArray();
return barGraph;
}
@ -239,7 +239,7 @@ namespace Server.Engines.Reports
barGraph.FontSize = 6;
barGraph.Interval = ival;
ArrayList regions = new ArrayList();
List<BarRegion> regions = new List<BarRegion>();
for (int i = 0; i < history.Snapshots.Count; ++i)
{
@ -275,7 +275,7 @@ namespace Server.Engines.Reports
}
else
{
BarRegion region = (BarRegion)regions[regions.Count - 1];
BarRegion region = regions[regions.Count - 1];
if (region.m_Name == dayName)
region.m_RangeTo = barGraph.Items.Count;
@ -286,7 +286,7 @@ namespace Server.Engines.Reports
barGraph.Items.Add(hours + (realHours >= 12 ? " PM" : " AM"), val);
}
barGraph.Regions = (BarRegion[])regions.ToArray(typeof(BarRegion));
barGraph.Regions = regions.ToArray();
return barGraph;
}

View file

@ -127,9 +127,7 @@ namespace Server.Engines.Reports
public void UpdateResolver()
{
string resolvedBy;
DateTime timeResolved;
PageResolution res = GetResolution(out resolvedBy, out timeResolved);
PageResolution res = GetResolution(out string resolvedBy, out DateTime timeResolved);
if (m_History != null && IsStaffResolution(res))
Resolver = m_History.GetStaffInfo(resolvedBy);

View file

@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
namespace Server.Engines.Reports
@ -15,17 +16,17 @@ namespace Server.Engines.Reports
Pages = new PageInfoCollection();
QueueStats = new QueueStatusCollection();
UserInfo = new Hashtable(StringComparer.OrdinalIgnoreCase);
StaffInfo = new Hashtable(StringComparer.OrdinalIgnoreCase);
UserInfo = new Dictionary<string, UserInfo>(StringComparer.OrdinalIgnoreCase);
StaffInfo = new Dictionary<string, StaffInfo>(StringComparer.OrdinalIgnoreCase);
}
public PageInfoCollection Pages{ get; set; }
public QueueStatusCollection QueueStats{ get; set; }
public Hashtable UserInfo{ get; set; }
public Dictionary<string, UserInfo> UserInfo{ get; set; }
public Hashtable StaffInfo{ get; set; }
public Dictionary<string, StaffInfo> StaffInfo{ get; set; }
public void AddPage(PageInfo info)
{
@ -221,7 +222,6 @@ namespace Server.Engines.Reports
if (ts >= min && ts < max)
{
DateTime date = ts.Date;
TimeSpan time = ts.TimeOfDay;
int hour = time.Hours;
@ -232,9 +232,8 @@ namespace Server.Engines.Reports
}
BarGraph barGraph = new BarGraph("Average pages in queue", "graph_pagequeue_avg", 10, "Time", "Pages",
BarGraphRenderMode.Lines);
BarGraphRenderMode.Lines) { FontSize = 6 };
barGraph.FontSize = 6;
for (int i = 7; i <= totals.Length + 7; ++i)
{
@ -303,9 +302,8 @@ namespace Server.Engines.Reports
}
}
BarGraph barGraph = new BarGraph(title, fname, 10, "Time", "Pages", BarGraphRenderMode.Lines);
BarGraph barGraph = new BarGraph(title, fname, 10, "Time", "Pages", BarGraphRenderMode.Lines) { FontSize = 6 };
barGraph.FontSize = 6;
for (int i = 7; i <= totals.Length + 7; ++i)
{
@ -348,7 +346,7 @@ namespace Server.Engines.Reports
return report;
}
private PieChart[] ChartTotalPages(StaffInfo[] staff, TimeSpan ts, string title, string fname)
private PersistableObject[] ChartTotalPages(StaffInfo[] staff, TimeSpan ts, string title, string fname)
{
DateTime max = DateTime.UtcNow;
DateTime min = max - ts;
@ -385,7 +383,7 @@ namespace Server.Engines.Reports
resChart.Items.Add("Logged Out", countLogged);
resChart.Items.Add("Unresolved", countUnres);
return new[] { staffChart, resChart };
return new PersistableObject[] { staffChart, resChart };
}
#region Type Identification
@ -399,4 +397,4 @@ namespace Server.Engines.Reports
#endregion
}
}
}