Пример #1
0
        private void RenderTorrentDone(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            TorrentManager torrent = (TorrentManager)model.GetValue(iter, 0);

            if (torrent == null)
            {
                return;
            }
            if (torrent.State == TorrentState.Hashing)
            {
                (cell as Gtk.CellRendererProgress).Value = (int)torrentController.GetTorrentHashProgress(torrent);
            }
            else
            {
                if (torrent.Progress > int.MinValue && torrent.Progress < int.MaxValue)
                {
                    (cell as Gtk.CellRendererProgress).Value = (int)torrent.Progress;
                }
                else
                {
                    (cell as Gtk.CellRendererProgress).Value = 0;
                }
            }
        }