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); //----------------------------------------------------------------- }
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)) { //Normaly return if already if *Agregated*, but if, but we use data from Maps Tab, therfor update DataGridViewDate with new data from DataGridViewMap for (int columnIndex = 0; columnIndex < DataGridViewHandler.GetColumnCount(dataGridView); columnIndex++) { PopulateTimeZone(dataGridView, columnIndex, null); } 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 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 //AddRowHeader(dataGridView, -1, new DataGridViewGenericRow(headerPeople), false); //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, 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); //----------------------------------------------------------------- List <FileEntryAttribute> allFileEntryAttributeDateVersions = new List <FileEntryAttribute>(); foreach (FileEntry imageListViewItem in imageListViewSelectItems) { List <FileEntryAttribute> fileEntryAttributeDateVersions = DatabaseExiftoolData.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, bool showFullPath) { //----------------------------------------------------------------- //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 DataGridViewHandler.AddColumnOrUpdateNew(dataGridView, new FileEntryAttribute(headerNewFilename, DateTime.Now, FileEntryVersion.CurrentVersionInDatabase), null, null, ReadWriteAccess.AllowCellReadAndWrite, showWhatColumns, new DataGridViewGenericCellStatus(MetadataBrokerType.Empty, SwitchStates.Off, true), out FileEntryVersionCompare fileEntryVersionCompareReason); //Tell data default columns and rows are agregated DataGridViewHandler.SetIsAgregated(dataGridView, true); //----------------------------------------------------------------- foreach (FileEntry imageListViewItem in imageListViewSelectItems) { PopulateFile(dataGridView, new FileEntryAttribute(imageListViewItem.FileFullPath, imageListViewItem.LastWriteDateTime, FileEntryVersion.CurrentVersionInDatabase), showFullPath, null, false); } //----------------------------------------------------------------- //Unlock DataGridViewHandler.SetIsAgregated(dataGridView, true); //Tell that work is done DataGridViewHandler.SetIsPopulating(dataGridView, false); //----------------------------------------------------------------- }