Пример #1
0
        private static void CreateListViewItem(WorkerTask wt)
        {
            if (ListViewControl != null)
            {
                DebugHelper.WriteLine("Upload in queue. ID: {0}, Job: {1}, Type: {2}, Host: {3}",
                                      wt.Id, wt.Job1, wt.Job2, wt.GetDestinationName());

                ListViewItem lvi = new ListViewItem();
                lvi.Text = wt.Info.FileName;
                lvi.SubItems.Add("In queue");
                lvi.SubItems.Add(string.Empty);
                lvi.SubItems.Add(string.Empty);
                lvi.SubItems.Add(string.Empty);
                lvi.SubItems.Add(string.Empty);
                lvi.SubItems.Add(wt.GetDescription());
                lvi.SubItems.Add(wt.GetDestinationName());
                lvi.SubItems.Add(string.Empty);
                lvi.BackColor  = wt.Id % 2 == 0 ? Color.White : Color.WhiteSmoke;
                lvi.ImageIndex = 3;
                ListViewControl.Items.Add(lvi);
                lvi.EnsureVisible();
                ListViewControl.FillLastColumn();
            }
        }