Chart Refactor (#1019)

* Rename variable 'traffic' to 'trafficPerSecondQueue' and 'trafficInfoQueue'

* Remove class QueueLast<T> by using linq Queue.Last()

* Slight changes, such as rename, move several variables from function domain to class domain to improve performance.
Logic remains the same.

* Update the logic of copying queue from Controller to View.

* Move the TrafficInfo declaration into LogForm class

Overwise, the VS UI designer does not work.
This commit is contained in:
Allen Zhu
2017-03-31 22:21:01 +08:00
committed by Syrone Wong
parent 805edb9809
commit 84b69d3dff
4 changed files with 84 additions and 69 deletions
@@ -13,6 +13,7 @@ using Shadowsocks.Controller;
using Shadowsocks.Model;
using Shadowsocks.Properties;
using Shadowsocks.Util;
using System.Linq;
namespace Shadowsocks.View
{
@@ -112,8 +113,8 @@ namespace Shadowsocks.View
Icon newIcon;
bool hasInbound = controller.traffic.Last.inboundIncreasement > 0;
bool hasOutbound = controller.traffic.Last.outboundIncreasement > 0;
bool hasInbound = controller.trafficPerSecondQueue.Last().inboundIncreasement > 0;
bool hasOutbound = controller.trafficPerSecondQueue.Last().outboundIncreasement > 0;
if (hasInbound && hasOutbound)
newIcon = icon_both;