Skip to content

Instantly share code, notes, and snippets.

@RobertMischke
Created November 5, 2010 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save RobertMischke/664005 to your computer and use it in GitHub Desktop.
Save RobertMischke/664005 to your computer and use it in GitHub Desktop.
Action<T> usw.
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