public static void ThrowQcdmEfsErrorsIfNeed(QcdmEfsErrors error) { var message = EfsErrorString(error); if (message != null) { throw new QcdmEfsException(message); } }
public static string EfsErrorString(QcdmEfsErrors error) { string message = null; switch (error) { case QcdmEfsErrors.None: break; case QcdmEfsErrors.InconsistentState: message = Strings.QcdmEfsErrorsInconsistentState; break; case QcdmEfsErrors.InvalidSequence: message = Strings.QcdmEfsErrorsInvalidSequence; break; case QcdmEfsErrors.DirNotOpen: message = Strings.QcdmEfsErrorsDirNotOpen; break; case QcdmEfsErrors.DirEntNotFound: message = Strings.QcdmEfsErrorsDirEntNotFound; break; case QcdmEfsErrors.InvalidPath: message = Strings.QcdmEfsErrorsInvalidPath; break; case QcdmEfsErrors.PathTooLong: message = Strings.QcdmEfsErrorsPathTooLong; break; case QcdmEfsErrors.TooManyOpenDirs: message = Strings.QcdmEfsErrorsTooManyOpenDirs; break; case QcdmEfsErrors.InvalidDirEntry: message = Strings.QcdmEfsErrorsInvalidDirEntry; break; case QcdmEfsErrors.TooManyOpenFiles: message = Strings.QcdmEfsErrorsTooManyOpenFiles; break; case QcdmEfsErrors.UnknownFileType: message = Strings.QcdmEfsErrorsUnknownFileType; break; case QcdmEfsErrors.NotNandFlash: message = Strings.QcdmEfsErrorsNotNandFlash; break; case QcdmEfsErrors.UnavailableInfo: message = Strings.QcdmEfsErrorsUnavailableInfo; break; case QcdmEfsErrors.NotPermited: message = Strings.QcdmEfsErrorsNotPermited; break; case QcdmEfsErrors.NoEntry: message = Strings.QcdmEfsErrorsNotEntry; break; case QcdmEfsErrors.IoError: message = Strings.QcdmEfsErrorsIoError; break; case QcdmEfsErrors.BadFileNumber: message = Strings.QcdmEfsErrorsBadFileNumber; break; case QcdmEfsErrors.OutOfMemory: message = Strings.QcdmEfsErrorsOutOfMemory; break; case QcdmEfsErrors.PermissionDenided: message = Strings.QcdmEfsErrorsPermissionDenided; break; case QcdmEfsErrors.FileExist: message = Strings.QcdmEfsErrorsFileExist; break; case QcdmEfsErrors.NotDirectory: message = Strings.QcdmEfsErrorsNotDirectory; break; case QcdmEfsErrors.DirectoryNotEmpty: message = Strings.QcdmEfsErrorsDirectoryNotEmpty; break; default: message = string.Format(Strings.QcdmEfsErrorsDefaultFormat, error); break; } return(message); }