private static string TranslateErrorCode(Enums.ErrorCode errorCode) { var resourceValue = ResourceManagerHelper.FindValueInResources(errorCode); if (!string.IsNullOrEmpty(resourceValue)) { return(resourceValue); } return(errorCode.GetDescription()); }
public static void ReportCode(Enums.ErrorCode code, string desc = null) { string result = string.Format("[ErrorCode]:{0}", code); if (desc != null) { result += string.Format(" {0}", desc); } ConsoleText(result); }
public static ApplicationResult <T> Fail <T>(Enums.ErrorCode errorCode, params object[] args) { var newArs = args.Select(x => (object)ResourceManagerHelper.FindValueInResources(x.ToString())).ToArray(); return(new ApplicationResult <T>(default(T), errorCode, string.Format(TranslateErrorCode(errorCode), newArs))); }
public static ApplicationResult Fail(Enums.ErrorCode errorCode) { return(new ApplicationResult(errorCode)); }
protected ApplicationResult(Enums.ErrorCode errorCode, string errorMessage) { IsSuccess = false; Message = errorMessage; ErrorCode = errorCode; }
protected ApplicationResult(Enums.ErrorCode errorCode) { IsSuccess = false; Message = TranslateErrorCode(errorCode); ErrorCode = errorCode; }
public DownloaderException(string message, Enums.ErrorCode errorCode) : base(String.Format("Devhus.DownloadService Exception: {0}\nErro Code: {1}", message, errorCode.ToString())) { Code = errorCode; }