Is there a way to pass a method CALL in C#? (not generic-function/delegate types) -


background

i build queue of work methods need performed. add following 6 methods queue of work , perform them until queue exhausted.

// method call #1 inputconfiguration("discrete input");  // method call #2 thread.sleep(100);  // method call #3 disconnectfromground("pin 8");  // method call #4 checkforpause();  // method call #5 connectpins(7, 8);  // method call $6 disconnectpin(9); 

question

is there such structure/class can use account of different parameters , method calls?

provided don't need return value, action fit bill.

list<action> yourqueue = new list<action>(); yourqueue.add(() => inputconfiguration("discrete input")); yourqueue.add(() => thread.sleep(100)); // , on. 

perhaps instead of creating "a queue" of work, why not write new method? best performance way.


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -