Created
January 9, 2012 22:30
-
-
Save cyberzed/1585339 to your computer and use it in GitHub Desktop.
Message abstraction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public abstract class BaseMessage | |
| { | |
| protected string Source; | |
| protected string Destination; | |
| protected string Content; | |
| protected BaseMessage(string source, string destination, string content) | |
| { | |
| Source = source; | |
| Destination = destination; | |
| Content = content; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class PrivateMessage : BaseMessage | |
| { | |
| public string Sender { get { return source; } } | |
| public string Receiver { get { return destination; } } | |
| public string Message { get { return content; } } | |
| public PrivateMessage(string sender, string receiver, string message) | |
| : base(sender, receiver, message) | |
| { | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment