Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public string GenerateMessage(IResourceProvider resourceProvider)
- {
- string pattern;
- switch (Reason)
- {
- case NotificationReason.SavingError:
- pattern = resourceProvider.GetResource("ID_NOTIFICATION_SAVING_ERROR");
- break;
- case NotificationReason.ConfigurationOutOfReach:
- pattern = resourceProvider.GetResource("ID_NOTIFICATION_CONFIGURATIONFROZEN");
- break;
- case NotificationReason.ConfigurationResumed:
- pattern = resourceProvider.GetResource("ID_NOTIFICATION_CONFIGURATIONRESUMED");
- break;
- case NotificationReason.DataSourceConnectionResumed:
- pattern = resourceProvider.GetResource("ID_NOTIFICATION_DATA_SOURCE_CONNECTION_RESUMED");
- break;
- case NotificationReason.DataSourceConnectionLost:
- pattern = resourceProvider.GetResource("ID_NOTIFICATION_DATA_SOURCE_CONNECTION_LOST");
- break;
- default:
- throw new NotSupportedException();
- }
- string notificationTimestamp;
- notificationTimestamp = NotificationTimeStamp.ToString(Interfaces.Utility.AuditTrailDateTimeFormat);
- pattern = Regex.Replace(pattern, Regex.Escape(configName), ConfigName, RegexOptions.IgnoreCase);
- pattern = Regex.Replace(pattern, Regex.Escape(timestamp), notificationTimestamp, RegexOptions.IgnoreCase);
- return pattern;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement