private ResultMessage(OperationSection source, MessageType type, string publicMessage, string internalMessage = null) { Type = type; Source = source; InternalMessage = internalMessage; PublicMessage = publicMessage; }
private static string SaveConfiguration(OperationSectionService service, DirectoryInfo directoryInfo, Type type) { var operationSection = new OperationSection(); operationSection.Type = type; operationSection.Name = type.Name; operationSection.Enabled = false; var operation = ObjectFactory.CreateOperation(operationSection.Type); operationSection.AddMissingConfigurationOptions(operation); var path = Path.Combine(directoryInfo.FullName, operationSection.Type.Name + ".config"); service.SaveSection(new FileInfo(path), operationSection); return(path); }
/// <summary> /// Provides visible feedback to the caller. This may be information that you would display on a web page. /// This should not be used to record unexpected errors /// </summary> public static ResultMessage Feedback(OperationSection source, string internalMessage, string publicMessageTemplate, params object[] replacements) { return(new ResultMessage(source, MessageType.Feedback, string.Format(publicMessageTemplate, replacements), internalMessage)); }
public static ResultMessage ToResultMessage(this Exception ex, OperationSection area, string templateString, params object[] replacements) { return(ResultMessage.Exception(area, ex, templateString, replacements)); }
/// <summary> /// Used to indicate the execution was halted due to an unforseen problem /// </summary> public static ResultMessage Exception(OperationSection source, Exception ex, string publicMessageTemplate, params object[] replacements) { return(Exception(source, ex.ToString(), publicMessageTemplate, replacements)); }