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

@ -516,7 +516,7 @@ namespace Server.Engines.Reports
for (int i = 0; i < VerticalTickCount; i++)
{
float currentY = _topBuffer + i * _yTickValue / _scaleFactor; // Position for tick mark
float labelY = currentY - lblFont.Height / 2; // Place label in the middle of tick
float labelY = currentY - lblFont.Height / 2.0f; // Place label in the middle of tick
RectangleF lblRec = new RectangleF(_spacer + fo - 6, labelY, _maxTickValueWidth, lblFont.Height);
float currentTick = _maxValue - i * _yTickValue; // Calculate tick value from top to bottom

View file

@ -3,16 +3,6 @@ using System.Drawing;
namespace Server.Engines.Reports
{
// Modified from MS sample
//*********************************************************************
//
// ChartItem Class
//
// This class represents a data point in a chart
//
//*********************************************************************
public class DataItem
{
private DataItem()
@ -42,12 +32,6 @@ namespace Server.Engines.Reports
public float SweepSize{ get; set; }
}
//*********************************************************************
//
// Custom Collection for ChartItems
//
//*********************************************************************
public class ChartItemsCollection : CollectionBase
{
public DataItem this[int index]

View file

@ -116,10 +116,11 @@ namespace Server.Engines.Reports
{
Process p = Process.Start(psi);
p.WaitForExit();
p?.WaitForExit();
}
catch
{
// ignored
}
Console.WriteLine("Reports: {0}: Upload complete", m_Title);
@ -130,6 +131,7 @@ namespace Server.Engines.Reports
}
catch
{
// ignored
}
}
@ -192,8 +194,6 @@ namespace Server.Engines.Reports
html.RenderBeginTag(HtmlTag.Center);
TimeZone tz = TimeZone.CurrentTimeZone;
bool isDaylight = tz.IsDaylightSavingTime(m_TimeStamp);
TimeSpan utcOffset = tz.GetUtcOffset(m_TimeStamp);
html.Write("Snapshot taken at {0:d} {0:t}. All times are {1}.", m_TimeStamp, tz.StandardName);
html.RenderEndTag();
@ -258,8 +258,6 @@ namespace Server.Engines.Reports
html.Write("<br>");
TimeZone tz = TimeZone.CurrentTimeZone;
bool isDaylight = tz.IsDaylightSavingTime(m_TimeStamp);
TimeSpan utcOffset = tz.GetUtcOffset(m_TimeStamp);
html.Write("Snapshot taken at {0:d} {0:t}. All times are {1}.", m_TimeStamp, tz.StandardName);
html.RenderEndTag();

View file

@ -1,5 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
@ -20,7 +20,7 @@ namespace Server.Engines.Reports
private const int _bufferSpace = 125;
private Color _backgroundColor;
private Color _borderColor;
private ArrayList _chartItems;
private List<DataItem> _chartItems;
private int _legendFontHeight;
private float _legendFontSize;
private string _legendFontStyle;
@ -29,19 +29,13 @@ namespace Server.Engines.Reports
private int _perimeter;
private float _total;
public PieChartRenderer()
public PieChartRenderer() : this(Color.White)
{
_chartItems = new ArrayList();
_perimeter = 250;
_backgroundColor = Color.White;
_borderColor = Color.FromArgb(63, 63, 63);
_legendFontSize = 8;
_legendFontStyle = "Verdana";
}
public PieChartRenderer(Color bgColor)
{
_chartItems = new ArrayList();
_chartItems = new List<DataItem>();
_perimeter = 250;
_backgroundColor = bgColor;
_borderColor = Color.FromArgb(63, 63, 63);
@ -118,7 +112,7 @@ namespace Server.Engines.Reports
//Draw all wedges and legends
for (int i = 0; i < _chartItems.Count; i++)
{
DataItem item = (DataItem)_chartItems[i];
DataItem item = _chartItems[i];
SolidBrush brs = null;
try
{
@ -188,7 +182,7 @@ namespace Server.Engines.Reports
for (int i = 0; i < _chartItems.Count; i++)
{
DataItem item = (DataItem)_chartItems[i];
DataItem item = _chartItems[i];
try
{
grp.DrawPie(new Pen(_borderColor, 0.5f), pieRect, item.StartPos, item.SweepSize);