Created
November 25, 2014 09:39
-
-
Save huanlin/2ce78c85196ae136f62a to your computer and use it in GitHub Desktop.
Unity Example 6-2
This file contains 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 interface IMessageService | |
{ | |
void SendMessage(string to, string msg); | |
} | |
public class EmailService : IMessageService | |
{ | |
public void SendMessage(string to, string msg) | |
{ | |
Console.WriteLine(" 透過 EmailService 發送郵件給 {0}。", to); | |
} | |
} | |
public class SmsService : IMessageService | |
{ | |
public void SendMessage(string to, string msg) | |
{ | |
Console.WriteLine(" 透過 SmsService 發送簡訊給 {0}。", to); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment