Created
November 5, 2010 11:30
-
-
Save RobertMischke/664005 to your computer and use it in GitHub Desktop.
Action<T> usw.
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
void Main() | |
{ | |
List<Action<ServerStarten>> _exectutionQueue = new List<Action<ServerStarten>>(); | |
_exectutionQueue.Add((serverStarten) => {serverStarten.GoGo("prod1");}); | |
_exectutionQueue.Add((serverStarten) => {serverStarten.GoGo("prod2"); /* Do more if needed */}); | |
ActionHandlerA(_exectutionQueue); | |
} | |
public void ActionHandlerA(List<Action<ServerStarten>> serverStartActions){ | |
foreach(var serverZuStarten in serverStartActions){ | |
serverZuStarten(new ServerStarten(){TimeOut = 10}); | |
} | |
} | |
public void ActionHandlerB(List<Action<ServerStarten>> serverStartActions){ /*Does stuff diffeent*/ } | |
public class ServerStarten{ | |
public int TimeOut; | |
public string Url; | |
/* usw. */ | |
public void GoGo(string serverName){Console.WriteLine(TimeOut);} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment