private static string GetItemTextImp(AsyncOperationType type, AsyncOperationStatus status, object displayNameObj, object percentComplete, Func <string, string, LocalizedString> asyncProcessQueued, Func <string, string, string, LocalizedString> asyncProcessInProgressWithPercentage, Func <string, string, LocalizedString> asyncProcessInProgress, Func <string, string, LocalizedString> asyncProcessSuspended, Func <string, string, LocalizedString> asyncProcessCompleted, Func <string, string, LocalizedString> asyncProcessFailed, Func <string, string, LocalizedString> asyncProcessWaitingFinalization, Func <string, string, LocalizedString> asyncProcessCreated = null, Func <string, string, LocalizedString> asyncProcessCompleting = null, Func <string, string, LocalizedString> asyncProcessRemoving = null) { string arg = (displayNameObj as string) ?? string.Empty; string result = string.Empty; string arg2 = DDIUtil.EnumToLocalizedString(type); switch (status) { case AsyncOperationStatus.Queued: result = asyncProcessQueued(arg2, arg); break; case AsyncOperationStatus.InProgress: result = ((percentComplete != DBNull.Value) ? asyncProcessInProgressWithPercentage(arg2, arg, percentComplete.ToString()) : asyncProcessInProgress(arg2, arg)); break; case AsyncOperationStatus.Suspended: result = asyncProcessSuspended(arg2, arg); break; case AsyncOperationStatus.Completed: result = asyncProcessCompleted(arg2, arg); break; case AsyncOperationStatus.Failed: result = asyncProcessFailed(arg2, arg); break; case AsyncOperationStatus.WaitingForFinalization: result = asyncProcessWaitingFinalization(arg2, arg); break; case AsyncOperationStatus.Created: if (asyncProcessCreated != null) { result = asyncProcessCreated(arg2, arg); } break; case AsyncOperationStatus.Completing: if (asyncProcessCompleting != null) { result = asyncProcessCompleting(arg2, arg); } break; case AsyncOperationStatus.Removing: if (asyncProcessRemoving != null) { result = asyncProcessRemoving(arg2, arg); } break; } return(result); }
public static string ConvertEnumToLocalizedString(object value) { return(DDIUtil.EnumToLocalizedString(((QuarantineMessageType)value).Value)); }