コード例 #1
0
 private ResultMessage(OperationSection source, MessageType type, string publicMessage, string internalMessage = null)
 {
     Type            = type;
     Source          = source;
     InternalMessage = internalMessage;
     PublicMessage   = publicMessage;
 }
コード例 #2
0
        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);
        }
コード例 #3
0
 /// <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));
 }
コード例 #4
0
 public static ResultMessage ToResultMessage(this Exception ex, OperationSection area, string templateString, params object[] replacements)
 {
     return(ResultMessage.Exception(area, ex, templateString, replacements));
 }
コード例 #5
0
 /// <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));
 }