Subversion Repositories SoapBoxCore

Rev

Rev 16 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#region "SoapBox.Core License"
/// <header module="SoapBox.Core">
/// </header>
#endregion
       
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Windows.Forms;

namespace SoapBox.Core.Messaging
{
    [Export(Services.Messaging.MessagingService, typeof(IMessagingService))]
    class MessagingService : IMessagingService
    {
        [Import(Services.Logging.LoggingService, typeof(ILoggingService))]
        private Lazy<ILoggingService> loggingService { get; set; }

        #region IMessagingService Members

        public void ShowMessage(string message, string title)
        {
            MessageBox.Show(
                message, title);
            loggingService.Value.Info(message);
        }

        public DialogResult ShowDialog(string message, string title, MessageBoxButtons buttons)
        {
            DialogResult result = MessageBox.Show(
                message, title, buttons);
            loggingService.Value.Info(message + "; result = " + result.ToString());
            return result;
        }

        #endregion
    }
}