public static void PopulateSelectedFiles(DataGridView dataGridView, HashSet <FileEntry> imageListViewSelectItems, DataGridViewSize dataGridViewSize, ShowWhatColumns showWhatColumns) { //----------------------------------------------------------------- //Chech if need to stop if (GlobalData.IsApplicationClosing) { return; } if (DataGridViewHandler.GetIsAgregated(dataGridView)) { return; } if (DataGridViewHandler.GetIsPopulating(dataGridView)) { return; } //Tell that work in progress, can start a new before done. DataGridViewHandler.SetIsPopulating(dataGridView, true); //Clear current DataGridView DataGridViewHandler.Clear(dataGridView, dataGridViewSize); DataGridViewHandler.SetDataGridViewAllowUserToAddRows(dataGridView, false); //Add Columns for all selected files, one column per select file DataGridViewHandlerCommon.AddColumnSelectedFiles(dataGridView, DatabaseAndCacheThumbnail, imageListViewSelectItems, ReadWriteAccess.ForceCellToReadOnly, showWhatColumns, new DataGridViewGenericCellStatus(MetadataBrokerType.Empty, SwitchStates.Off, true)); //ReadOnly until data is read //Add all default rows //AddRowsDefault(dataGridView); //Tell data default columns and rows are agregated DataGridViewHandler.SetIsAgregated(dataGridView, true); //----------------------------------------------------------------- //Tell that work is done DataGridViewHandler.SetIsPopulating(dataGridView, false); //----------------------------------------------------------------- }
public static List <FileEntryAttribute> PopulateSelectedFiles(DataGridView dataGridView, HashSet <FileEntry> imageListViewSelectItems, DataGridViewSize dataGridViewSize, ShowWhatColumns showWhatColumns) { //----------------------------------------------------------------- //Chech if need to stop if (GlobalData.IsApplicationClosing) { return(null); } if (DataGridViewHandler.GetIsAgregated(dataGridView)) { return(null); } if (DataGridViewHandler.GetIsPopulating(dataGridView)) { return(null); } //Tell that work in progress, can start a new before done. DataGridViewHandler.SetIsPopulating(dataGridView, true); //Clear current DataGridView DataGridViewHandler.Clear(dataGridView, dataGridViewSize); DataGridViewHandler.SetDataGridViewAllowUserToAddRows(dataGridView, false); //Add Columns for all selected files, one column per select file DataGridViewHandlerCommon.AddColumnSelectedFiles(dataGridView, null, imageListViewSelectItems, ReadWriteAccess.ForceCellToReadOnly, showWhatColumns, new DataGridViewGenericCellStatus(MetadataBrokerType.Empty, SwitchStates.Off, true)); //ReadOnly until data is read //Tell data default columns and rows are agregated DataGridViewHandler.SetIsAgregated(dataGridView, true); //----------------------------------------------------------------- DataGridViewHandlerCommon.AddColumnSelectedFiles(dataGridView, DatabaseAndCacheThumbnail, imageListViewSelectItems, ReadWriteAccess.ForceCellToReadOnly, showWhatColumns, new DataGridViewGenericCellStatus(MetadataBrokerType.Empty, SwitchStates.Off, true)); //ReadOnly until data is read //Add all default rows //Temp List <FileEntryAttribute> allFileEntryAttributeDateVersions = new List <FileEntryAttribute>(); ////Populate one and one of selected files //foreach (FileEntry imageListViewItem in imageListViewSelectItems) //{ // List<FileEntryAttribute> fileEntryAttributeDateVersions = DataGridViewHandlerExiftoolWarnings.ListFileEntryDateVersions(imageListViewItem.FileFullPath); // allFileEntryAttributeDateVersions.AddRange(fileEntryAttributeDateVersions); //} //----------------------------------------------------------------- //Unlock DataGridViewHandler.SetIsAgregated(dataGridView, true); //Tell that work is done DataGridViewHandler.SetIsPopulating(dataGridView, false); //----------------------------------------------------------------- return(allFileEntryAttributeDateVersions); }
public static void PopulateSelectedFiles(DataGridView dataGridView, HashSet <FileEntry> imageListViewSelectItems, DataGridViewSize dataGridViewSize, ShowWhatColumns showWhatColumns) { //----------------------------------------------------------------- //Chech if need to stop if (GlobalData.IsApplicationClosing) { return; } if (DataGridViewHandler.GetIsAgregated(dataGridView)) { return; } if (DataGridViewHandler.GetIsPopulating(dataGridView)) { return; } //Tell that work in progress, can start a new before done. DataGridViewHandler.SetIsPopulating(dataGridView, true); //Clear current DataGridView DataGridViewHandler.Clear(dataGridView, dataGridViewSize); DataGridViewHandler.SetDataGridViewAllowUserToAddRows(dataGridView, false); //Add Columns for all selected files, one column per select file DataGridViewHandlerCommon.AddColumnSelectedFiles(dataGridView, null, imageListViewSelectItems, ReadWriteAccess.ForceCellToReadOnly, showWhatColumns, new DataGridViewGenericCellStatus(MetadataBrokerType.Empty, SwitchStates.Off, true)); //ReadOnly until data is read //Tell data default columns and rows are agregated DataGridViewHandler.SetIsAgregated(dataGridView, true); //----------------------------------------------------------------- using (new WaitCursor()) { GlobalData.ProcessCounterReadProperties = imageListViewSelectItems.Count; foreach (FileEntry imageListViewItem in imageListViewSelectItems) { GlobalData.ProcessCounterReadProperties--; PopulateFile(dataGridView, new FileEntryAttribute(imageListViewItem.FileFullPath, imageListViewItem.LastWriteDateTime, FileEntryVersion.CurrentVersionInDatabase), showWhatColumns); } GlobalData.ProcessCounterReadProperties = 0; } //----------------------------------------------------------------- //Unlock DataGridViewHandler.SetIsAgregated(dataGridView, true); //Tell that work is done DataGridViewHandler.SetIsPopulating(dataGridView, false); //----------------------------------------------------------------- }