Created
March 5, 2011 22:09
-
-
Save c1982/856761 to your computer and use it in GitHub Desktop.
DynamicOverload Pattern
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var cmd = new Executor(); | |
dynamic commandItem = RemoteServer.GetCommandItemFromRemoteServer(); //return Object; | |
cmd.ExecuteCommand(commandItem); | |
Console.ReadKey(); | |
} | |
class Executor | |
{ | |
public void ExecuteCommand(int commandItem) | |
{ | |
Console.WriteLine("This is integer method."); | |
} | |
public void ExecuteCommand(string commandItem) | |
{ | |
Console.WriteLine("This is string method "); | |
} | |
public void ExecuteCommand(List<string> commandItem) | |
{ | |
Console.WriteLine("This is List<string> method "); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment