public FileErrorViewModelItem(string fileName, ErrorConvertingType errorConvertingType, string errorDescription) { if (String.IsNullOrWhiteSpace(fileName)) { throw new ArgumentNullException(nameof(fileName)); } FileName = fileName; ErrorConvertingType = errorConvertingType; ErrorDescription = errorDescription ?? throw new ArgumentNullException(nameof(errorDescription)); }
public ErrorComponent(ErrorConvertingType errorConvertingType, string description) { ErrorConvertingType = errorConvertingType; Description = description; }
public ErrorCommonResponse(ErrorConvertingType errorConvertingType, string description) { ErrorConvertingType = errorConvertingType; Description = description; }
/// <summary> /// Преобразовать тип ошибки в строковое значение /// </summary> public static string ErrorTypeToString(ErrorConvertingType errorConvertingType) { ErrorTypeString.TryGetValue(errorConvertingType, out string fileConvertErrorTypeString); return(fileConvertErrorTypeString); }
public string ToString(string format, IFormatProvider formatProvider) => ErrorConvertingType.ToString();
public ErrorCommon(ErrorConvertingType errorConvertingType, string errorDescription, Exception exception) { ErrorConvertingType = errorConvertingType; Description = errorDescription ?? String.Empty; Exception = exception; }
public ErrorCommon(ErrorConvertingType errorConvertingType, string errorDescription) : this(errorConvertingType, errorDescription, null) { }
/// <summary> /// Преобразовать внутренний тип ошибок библиотеки из основного типа /// </summary> public static ErrorApplicationType ToErrorApplicationType(ErrorConvertingType errorConvertingType) => Enum.TryParse(errorConvertingType.ToString(), true, out ErrorApplicationType errorApplicationType) ? errorApplicationType : throw new FormatException(nameof(ErrorConvertingType));