Ejemplo n.º 1
0
        private static void CreateListViewItem(UploadTask task)
        {
            if (ListViewControl != null)
            {
                TaskInfo info = task.Info;

                DebugHelper.WriteLine("Task in queue. Job: {0}, Type: {1}, Host: {2}", info.Job, info.UploadDestination, info.UploaderHost);

                ListViewItem lvi = new ListViewItem();
                lvi.Tag  = task;
                lvi.Text = 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(string.Empty);
                lvi.ImageIndex = 3;
                if (Program.Settings.ShowMostRecentTaskFirst)
                {
                    ListViewControl.Items.Insert(0, lvi);
                }
                else
                {
                    ListViewControl.Items.Add(lvi);
                }
                lvi.EnsureVisible();
                ListViewControl.FillLastColumn();
            }
        }
Ejemplo n.º 2
0
        private static void CreateListViewItem(WorkerTask task)
        {
            if (ListViewControl != null)
            {
                TaskInfo info = task.Info;

                if (task.Status != TaskStatus.History)
                {
                    DebugHelper.WriteLine("Task in queue. Job: {0}, Type: {1}, Host: {2}", info.Job, info.UploadDestination, info.UploaderHost);
                }

                ListViewItem lvi = new ListViewItem();
                lvi.Tag  = task;
                lvi.Text = info.FileName;

                if (task.Status == TaskStatus.History)
                {
                    // TODO: Translate
                    lvi.SubItems.Add("History");
                    lvi.SubItems.Add(task.Info.UploadTime.ToString());
                }
                else
                {
                    lvi.SubItems.Add(Resources.TaskManager_CreateListViewItem_In_queue);
                    lvi.SubItems.Add(string.Empty);
                }

                lvi.SubItems.Add(string.Empty);
                lvi.SubItems.Add(string.Empty);
                lvi.SubItems.Add(string.Empty);

                if (task.Status == TaskStatus.History)
                {
                    lvi.SubItems.Add(task.Info.ToString());
                    lvi.ImageIndex = 4;
                }
                else
                {
                    lvi.SubItems.Add(string.Empty);
                    lvi.ImageIndex = 3;
                }

                if (Program.Settings.ShowMostRecentTaskFirst)
                {
                    ListViewControl.Items.Insert(0, lvi);
                }
                else
                {
                    ListViewControl.Items.Add(lvi);
                }

                lvi.EnsureVisible();
                ListViewControl.FillLastColumn();
            }
        }
        private static void CreateListViewItem(UploadInfo info)
        {
            if (ListViewControl != null)
            {
                Program.MyLogger.WriteLine("Upload in queue. ID: {0}, Job: {1}, Type: {2}, Host: {3}", info.ID, info.Job, info.UploadDestination, info.UploaderHost);

                ListViewItem lvi = new ListViewItem();
                lvi.Text = 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(info.DataType.ToString());
                lvi.SubItems.Add(info.UploaderHost);
                lvi.SubItems.Add(string.Empty);
                lvi.BackColor  = info.ID % 2 == 0 ? Color.White : Color.WhiteSmoke;
                lvi.ImageIndex = 3;
                ListViewControl.Items.Add(lvi);
                lvi.EnsureVisible();
                ListViewControl.FillLastColumn();
            }
        }
Ejemplo n.º 4
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();
            }
        }