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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user