PageRenderTime 28ms CodeModel.GetById 18ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/CBR/CBR.Core/Helpers/MVVM/Events/Messages/NotificationMessage.cs

#
C# | 76 lines | 25 code | 5 blank | 46 comment | 0 complexity | 74449756f586aa006c8c433793c0317b MD5 | raw file
 1// ****************************************************************************
 2// <copyright file="NotificationMessage.cs" company="GalaSoft Laurent Bugnion">
 3// Copyright © GalaSoft Laurent Bugnion 2009-2011
 4// </copyright>
 5// ****************************************************************************
 6// <author>Laurent Bugnion</author>
 7// <email>laurent@galasoft.ch</email>
 8// <date>21.4.2009</date>
 9// <project>GalaSoft.MvvmLight.Messaging</project>
10// <web>http://www.galasoft.ch</web>
11// <license>
12// See license.txt in this project or http://www.galasoft.ch/license_MIT.txt
13// </license>
14// ****************************************************************************
15
16////using GalaSoft.Utilities.Attributes;
17
18namespace CBR.Core.Helpers
19{
20    /// <summary>
21    /// Passes a string message (Notification) to a recipient.
22    /// <para>Typically, notifications are defined as unique strings in a static class. To define
23    /// a unique string, you can use Guid.NewGuid().ToString() or any other unique
24    /// identifier.</para>
25    /// </summary>
26    ////[ClassInfo(typeof(Messenger))]
27    public class NotificationMessage : MessageBase
28    {
29        /// <summary>
30        /// Initializes a new instance of the NotificationMessage class.
31        /// </summary>
32        /// <param name="notification">A string containing any arbitrary message to be
33        /// passed to recipient(s)</param>
34        public NotificationMessage(string notification)
35        {
36            Notification = notification;
37        }
38
39        /// <summary>
40        /// Initializes a new instance of the NotificationMessage class.
41        /// </summary>
42        /// <param name="sender">The message's sender.</param>
43        /// <param name="notification">A string containing any arbitrary message to be
44        /// passed to recipient(s)</param>
45        public NotificationMessage(object sender, string notification)
46            : base(sender)
47        {
48            Notification = notification;
49        }
50
51        /// <summary>
52        /// Initializes a new instance of the NotificationMessage class.
53        /// </summary>
54        /// <param name="sender">The message's sender.</param>
55        /// <param name="target">The message's intended target. This parameter can be used
56        /// to give an indication as to whom the message was intended for. Of course
57        /// this is only an indication, amd may be null.</param>
58        /// <param name="notification">A string containing any arbitrary message to be
59        /// passed to recipient(s)</param>
60        public NotificationMessage(object sender, object target, string notification)
61            : base(sender, target)
62        {
63            Notification = notification;
64        }
65
66        /// <summary>
67        /// Gets a string containing any arbitrary message to be
68        /// passed to recipient(s).
69        /// </summary>
70        public string Notification
71        {
72            get;
73            private set;
74        }
75    }
76}