/// <summary>
    /// Logs message to for asynchronous displaying.
    /// </summary>
    /// <param name="line">Message to be displayed</param>
    /// <param name="type">Type of a message</param>
    /// <param name="logToEventLog">Log to event log</param>
    public void LogMessage(string line, MessageTypeEnum type, bool logToEventLog)
    {
        if (!line.EndsWithCSafe("<br />", StringComparison.InvariantCultureIgnoreCase))
        {
            line = line + "<br />";
        }
        ProgressMessagesHelper progressMessages = new ProgressMessagesHelper();

        switch (type)
        {
        case MessageTypeEnum.Info:
            progressMessages.LogInfo(line, SourceText, EventCodeText, logToEventLog);
            break;

        case MessageTypeEnum.Warning:
            progressMessages.LogWarning(line, SourceText, EventCodeText, logToEventLog);
            break;

        case MessageTypeEnum.Error:
            progressMessages.LogError(line, SourceText, EventCodeText, logToEventLog);
            break;

        case MessageTypeEnum.Finished:
            progressMessages.LogQuit(line, SourceText, EventCodeText, logToEventLog);
            break;
        }
    }
Ejemplo n.º 2
0
    /// <summary>
    /// Logs message to install log.
    /// </summary>
    /// <param name="message">Message</param>
    /// <param name="type">Type of message ("E" - error, "I" - info)</param>
    private void Log(string message, MessageTypeEnum type)
    {
        AddResult(message);
        switch (type)
        {
        case MessageTypeEnum.Error:
            LogProgressState(LogStatusEnum.Error, message);
            break;

        case MessageTypeEnum.Info:
            LogProgressState(LogStatusEnum.Info, message);
            break;
        }
    }
    /// <summary>
    /// Logs message to install log.
    /// </summary>
    /// <param name="message">Message</param>
    /// <param name="type">Type of message ("E" - error, "I" - info)</param>
    public void Log(string message, MessageTypeEnum type)
    {
        AddResult(message);
        switch (type)
        {
            case MessageTypeEnum.Error:
                LogProgressState(LogStatusEnum.Error, message);
                break;

            case MessageTypeEnum.Info:
                LogProgressState(LogStatusEnum.Info, message);
                break;
        }
    }