Shadowsocks.View.MenuViewController.controller_TrafficChanged C# (CSharp) Метод

controller_TrafficChanged() приватный Метод

private controller_TrafficChanged ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Результат void
        private void controller_TrafficChanged(object sender, EventArgs e)
        {
            if (icon_baseBitmap == null)
                return;

            Icon newIcon;

            bool hasInbound = controller.traffic.Last.inboundIncreasement > 0;
            bool hasOutbound = controller.traffic.Last.outboundIncreasement > 0;

            if (hasInbound && hasOutbound)
                newIcon = icon_both;
            else if (hasInbound)
                newIcon = icon_in;
            else if (hasOutbound)
                newIcon = icon_out;
            else
                newIcon = icon_base;

            if (newIcon != this.targetIcon)
            {
                this.targetIcon = newIcon;
                _notifyIcon.Icon = newIcon;
            }
        }
MenuViewController