private void RenameFileListForCertainPath(DtoFileInfo fileInfo, string directoryPath) { var allFilesArray = GetFiles(directoryPath, "*" + fileInfo.OriginalExtension, LogDelegate); ChangeFileListExtensions(fileInfo.ReplacedExtension, allFilesArray, LogDelegate); _dtoLog.AddFile(fileInfo); }
private void CloneClassesRootKeys(RegistryKey registryKey, DtoFileInfo dtoFileInfo) { RegistryKey mainSubKey, newsubKey; DtoRegistryKey dtoRegistryKey; try { mainSubKey = registryKey?.OpenSubKey(dtoFileInfo.OriginalExtension, RegistryKeyPermissionCheck.ReadWriteSubTree); if (mainSubKey == null || registryKey.GetSubKeyNames().Any(keyName => keyName == dtoFileInfo.ReplacedExtension)) { return; } newsubKey = registryKey.CreateSubKey(dtoFileInfo.ReplacedExtension); dtoRegistryKey = new DtoRegistryKey { CreateDateTime = DateTime.Now, Name = newsubKey.Name }; boRegistryKey.Save(dtoRegistryKey); _dtoLog.AddRegistryKey(dtoRegistryKey); } catch (Exception e) { return; } CloneRegKeysAndValues(mainSubKey, newsubKey, dtoRegistryKey); }
private bool IsDatabaseAccessible() { try { var fileInfoRepository = new FileInfoRepository(); var testFileInfoObject = new DtoFileInfo { CreateDateTime = DateTime.Now }; fileInfoRepository.CreateOrUpdate(testFileInfoObject); fileInfoRepository.Remove(testFileInfoObject); return(true); } catch (Exception ex) { return(false); } }
private void RenameFileListInWholeHardDrive(DtoFileInfo fileInfo) { ChangeFileListExtensions(fileInfo.ReplacedExtension, SearchFileListInWholeHardDrive(fileInfo.OriginalExtension, LogDelegate)); }