private void GetStatistic(ZipFileStatisticsModel statObj) { zipFileStatisticsModel = statObj; lblTotalFilesCount.Text = zipFileStatisticsModel.EstimatedFilesCount.ToString(); lblTotalFoldersCount.Text = zipFileStatisticsModel.EstimatedFoldersCount.ToString(); lblEstimatedSize.Text = ConverterUtils.HumanReadableFileSize(zipFileStatisticsModel.EstimatedFileSizeCount, 2); }
private void DisplayProcessedFile(ZipArchivingEventArgs e) { Application.DoEvents(); if (e.ProcessingStage == ZipProcessingStages.ADDING_FOLDER) { txtBoxCurrentAction.Text = "Creating Folder => " + e.FileName; AddLogItems("Adding Folder", e.FileName); lblFoldersCreated.Text = String.Format("{0}% > {1}", ConverterUtils.GetPercentageFloored(e.FolderProcessedCount, zipFileStatisticsModel.EstimatedFoldersCount), zipFileStatisticsModel.EstimatedFoldersCount); } else if (e.ProcessingStage == ZipProcessingStages.ADDING_FILE || e.ProcessingStage == ZipProcessingStages.ADDING_FILE_FAILED) { String addingStatus = (e.ProcessingStage == ZipProcessingStages.ADDING_FILE) ? "" : "Failed"; txtBoxCurrentAction.Text = String.Format("Adding File {0} => {1}", addingStatus, e.ZipFileToCreateFullPath); AddLogItems(String.Format("Adding File {0}", addingStatus), e.ZipFileToCreateFullPath); lblFilesAdded.Text = String.Format("{0}% > {1}", ConverterUtils.GetPercentageFloored(e.FilesProcessedCount, zipFileStatisticsModel.EstimatedFilesCount), zipFileStatisticsModel.EstimatedFilesCount); lblArchivedSize.Text = ConverterUtils.HumanReadableFileSize(e.ArchiveSize, 2); } else if (e.ProcessingStage == ZipProcessingStages.GENERATE_SERIALIZED_TREE_NODE_BASE_FILTER_RULE) { txtBoxCurrentAction.Text = String.Format("Constructing dynamic filter folder => {0}", e.ZipFileToCreateFullPath); } else if (e.ProcessingStage == ZipProcessingStages.POST_PROCESSING) { txtBoxCurrentAction.Text = "Writing the Zip file into the target folder..."; } }
private String[] GetFileObjectDetails(CustomFileItem fileObj) { return(new string[] { fileObj.GetCustomFileName, //file name fileObj.LastWriteTime.ToString(), //date modified (fileObj.IsFolder) ? "" : ConverterUtils.HumanReadableFileSize(fileObj.FileLength, 2), //file size fileObj.CreationTime.ToString(), // created date time fileObj.TypeName //file type }); }
private void ZipArchiving_StopProcess(object sender, ZipArchivingEventArgs e) { timerElapseTime.Stop(); progressBarStatus.Value = progressBarStatus.Maximum; txtBoxCurrentAction.Text = "Zip Archiving Stopped..."; lblArchivedSize.Text = ConverterUtils.HumanReadableFileSize(e.ArchiveSize, 2); AddLogItems("Archiving Ended", "Successfully stop further zip archiving"); AddLogItems("Project File", @"Project file that has been processed is "); AddLogItems("Project File", (String.IsNullOrWhiteSpace(e.ZipFileToCreateFullPath) ? "(Project is not yet save...)" : e.ZipFileToCreateFullPath)); AddLogItems("Zip Archive Location", @"Partial zip file has been save into...."); AddLogItems("Zip Archive Location", zipArchiving.NewArchiveName); linkSaveLogs.Enabled = true; btnStop.Enabled = false; isWindowCanBeClose = true; isStopProcessing = false; listViewLogs.EndUpdate(); }
private void ZipArchiving_FinishedArchiving(object sender, ZipArchivingEventArgs e) { timerElapseTime.Stop(); lblArchivedSize.Text = ConverterUtils.HumanReadableFileSize(e.ArchiveSize, 2); AddLogItems("Wrapping up", txtBoxCurrentAction.Text); AddLogItems("Project File", @"Project file that has been processed is "); AddLogItems("Project File", (String.IsNullOrWhiteSpace(e.ZipFileToCreateFullPath) ? "(Project is not yet save...)" : e.ZipFileToCreateFullPath)); AddLogItems("Zip Archive Location", @"Zip file has been save into...."); AddLogItems("Zip Archive Location", zipArchiving.NewArchiveName); listViewLogs.EndUpdate(); CopyOutputToOtherTargetFolders(e); txtBoxCurrentAction.Text = "Finished Zip Archiving..."; isStopProcessing = false; linkSaveLogs.Enabled = true; btnStop.Enabled = false; isWindowCanBeClose = true; SystemSounds.Exclamation.Play(); }
private void GenerateListViewCommonProcedureForExplorer(ListViewInterpretorViewingParamModel lvParamModel) { ArrayList dirList = lvParamModel.DirList; ArrayList fileList = lvParamModel.FileList; ListviewExtended targetListView = lvParamModel.TargetListView; try { if ((dirList.Count + fileList.Count) > 0) { dirList.Sort(); fileList.Sort(); ArrayList combinationList = new ArrayList(); combinationList.AddRange(dirList); combinationList.AddRange(fileList); foreach (CShItem fileObj in combinationList) { if (!FileSystemUtilities.IsSpecialFolder(fileObj.Path, fileObj.DisplayName)) { ListViewItemExtended lvItem = new ListViewItemExtended(fileObj, new string[] { fileObj.DisplayName, //file name fileObj.LastWriteTime.ToString(), //date modified (fileObj.IsFolder) ? "" : ConverterUtils.HumanReadableFileSize(fileObj.Length, 2), //file size fileObj.CreationTime.ToString(), // created date time fileObj.TypeName //file type }); lvItem.ImageIndex = fileObj.IconIndexNormal; targetListView.Items.Add(lvItem); } } } } catch (Exception ex) { throw ex; } finally { dirList.Clear(); fileList.Clear(); } }
private void SetMaxFileSizeHumanReadable() { lblFileMaxSizeReadable.Text = ConverterUtils.HumanReadableFileSize(long.Parse(numericUpDownMaxFileSize.Value.ToString()), 2); }