public virtual void Init() { long files = 0; long directories = 0; foreach (var item in m_SourceBackupPathList) { if (item.IsFolder) { try { files += m_IStorage.GetNumberOfFiles(item.Path); directories += m_IStorage.GetNumberOfDirectories(item.Path); } catch (DirectoryNotFoundException) { } } else { files++; } } NumberOfFiles = files; ProgressBar?.SetRange(NumberOfFiles); ProgressBar?.UpdateProgressBar("Runnin...", 0); ProgressBar?.ShowTimeEllapsed(true); }