Subversion Repositories SoapBoxCore

Rev

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

Rev Author Line No. Line
13 scott 1
#region "SoapBox.Core License"
2
/// <header module="SoapBox.Core"> 
16 scott 3
/// Copyright (C) 2009 SoapBox Automation Inc., All Rights Reserved.
4
/// Contact: SoapBox Automation Licencing (license@soapboxautomation.com)
5
/// 
6
/// This file is part of SoapBox Core.
7
/// 
8
/// Commercial Usage
9
/// Licensees holding valid SoapBox Automation Commercial licenses may use  
10
/// this file in accordance with the SoapBox Automation Commercial License
11
/// Agreement provided with the Software or, alternatively, in accordance 
12
/// with the terms contained in a written agreement between you and
13
/// SoapBox Automation Inc.
14
/// 
15
/// GNU Lesser General Public License Usage
16
/// SoapBox Core is free software: you can redistribute it and/or modify 
17
/// it under the terms of the GNU Lesser General Public License
18
/// as published by the Free Software Foundation, either version 3 of the
19
/// License, or (at your option) any later version.
20
/// 
21
/// SoapBox Core is distributed in the hope that it will be useful, 
22
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
23
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24
/// GNU Lesser General Public License for more details.
25
/// 
26
/// You should have received a copy of the GNU Lesser General Public License 
27
/// along with SoapBox Core. If not, see <http://www.gnu.org/licenses/>.
13 scott 28
/// </header>
29
#endregion
30
 
31
using System;
32
using System.Collections.Generic;
33
using System.ComponentModel.Composition;
34
using System.Windows.Forms;
35
 
36
namespace SoapBox.Core.Messaging
37
{
38
    [Export(Services.Messaging.MessagingService, typeof(IMessagingService))]
39
    class MessagingService : IMessagingService
40
    {
41
        [Import(Services.Logging.LoggingService, typeof(ILoggingService))]
42
        private Lazy<ILoggingService> loggingService { get; set; }
43
 
44
        #region IMessagingService Members
45
 
46
        public void ShowMessage(string message, string title)
47
        {
48
            MessageBox.Show(
49
                message, title);
50
            loggingService.Value.Info(message);
51
        }
52
 
53
        public DialogResult ShowDialog(string message, string title, MessageBoxButtons buttons)
54
        {
55
            DialogResult result = MessageBox.Show(
56
                message, title, buttons);
57
            loggingService.Value.Info(message + "; result = " + result.ToString());
58
            return result;
59
        }
60
 
61
        #endregion
62
    }
63
}