Exemplo n.º 1
0
        void SABnzbd_StatusUpdated(SABnzbdStatus status)
        {
            if (FormText == null)
                FormText = this.Text;

            string DisplayFormText = FormText + " - " + ActiveControl.ToolTip;

            lblSpeed.Text = "Cur: " + status.Speed;
            lblSpace.Text = "Space: " + status.DiskSpace;
            lblLimit.Text = "Speed Limit: " + (status.SpeedLimit > 0 ? (status.SpeedLimit + " KB/sec") : "None");

            if (status.IsPaused)
                this.Text = "Paused - " + DisplayFormText;
            else if (status.QueuedItems.Count > 0)
                this.Text = status.TimeLeft + " / " + status.SizeLeft + " left - " + DisplayFormText;
            else
                this.Text = DisplayFormText;
        }
Exemplo n.º 2
0
        void SABnzbd_StatusUpdated(SABnzbdStatus status)
        {
            _Icon = status.HistoryItems.HasErrors ? Properties.Resources.SABnzbd_red : Properties.Resources.SABnzbd;

            //do blinking if needed
            if (status.QueuedItems.Count > 0)
            {
                _BlinkState = !_BlinkState;
                if (_BlinkState)
                    Button.Image = Properties.Resources.SABnzbd_green;
                else
                    Button.Image = this.Icon;
            }
            else
            {
                Button.Image = this.Icon;
                _BlinkState = false;
            }

            //using (new LockWindowUpdate(DownloadList.Handle))
            {
                DownloadList.VirtualListSize = status.QueuedItems.Count;
                DownloadList.Refresh();
            }

            if (status.HistoryItems.HasChanged || HistoryList.VirtualListSize != status.HistoryItems.Count)
            {
                //using (new LockWindowUpdate(HistoryList.Handle))
                {
                    HistoryList.VirtualListSize = status.HistoryItems.Count;
                    HistoryList.Refresh();
                }
            }

            UpdateControls();
        }