//private bool IsCreating ( MediaCreationQueue mediaCreationQueue ) //{ // foreach ( MediaCreationManagement mediaObject in mediaCreationQueue ) // { // MediaJob mediaJob ; // mediaJob = FindMediaJob ( mediaObject ) ; // if ( null != mediaJob && mediaJob.Creating ) // { // return true ; // } // } // return false ; //} private void FillList(List <MediaJob> jobs) { MediaJobsListView.SuspendLayout( ); try { ExecutionStatus selectedStatus; MediaJobsListView.Items.Clear( ); __MediaObjectsState.SelectedMediaItems.Clear( ); __MediaObjectsState.ActiveMediaItem = null; selectedStatus = ( ExecutionStatus)StatusComboBox.SelectedValue; if (selectedStatus == ExecutionStatus.Creating || selectedStatus == ExecutionStatus.Done || selectedStatus == ExecutionStatus.Failure) { if (!MediaJobsListView.Columns.ContainsKey(Constants.ListViewColumns.MediaLocationKey)) { MediaJobsListView.Columns.Add(Constants.ListViewColumns.MediaLocationKey, Constants.ListViewColumns.MediaLocationText, _locationColumnWidth); } } else if (MediaJobsListView.Columns.ContainsKey(Constants.ListViewColumns.MediaLocationKey)) { _locationColumnWidth = MediaJobsListView.Columns [Constants.ListViewColumns.MediaLocationIndex].Width; MediaJobsListView.Columns.RemoveByKey(Constants.ListViewColumns.MediaLocationKey); } foreach (MediaJob job in jobs) { AddListViewItem(job); } SetActiveMediaItem( ); } finally { MediaJobsListView.ResumeLayout( ); } }
private void RefreshItem(ListViewItem item, MediaJob job) { MediaJobsListView.SuspendLayout( ); try { item.Text = job.MediaFileId; item.SubItems [Constants.ListViewColumns.PriorityIndex].Text = job.Priority.ToString( ); item.SubItems [Constants.ListViewColumns.NumberOfCopiesIndex].Text = job.NumberOfCopies.ToString( ); item.SubItems [Constants.ListViewColumns.CreationDateIndex].Text = job.CreationTime.ToLongDateString( ) + " " + job.CreationTime.ToLongTimeString( ); item.SubItems [Constants.ListViewColumns.CreationErrorIndex].Text = job.Comments; item.SubItems [Constants.ListViewColumns.MediaLocationIndex].Text = job.MediaLocation; } finally { MediaJobsListView.ResumeLayout(true); } }