title: How to call delegate from string in C#?
body: <p>is it possible to call a delegate stored in a variable by its variable name (as a string)? i guess i'd have to use reflection mechanism, but i'm not getting anywhere</p>
  
  <p>example code:</p>
  
  <pre><code>class Demo {
    public delegate int DemoDelegate();
  
    private static int One() {
      return 1;
    }
    private static void CallDelegate(string name) {
      // somehow get the value of the variable with the name
      // stored in "name" and call the delegate using reflection
    }
    private static void CallDelegate(string name, DemoDelegate d) {
      d();
    }
    static void main(string[] args) {
      DemoDelegate one = Demo.One;
      CallDelegate(one);
      // this works, but i want to avoid writing the name of the variable/delegate twice:
      CallDelegate("one", one);
    }
  
  }
  </code></pre>
  
  <p>is this even possible? if so how? if not, then i have to use the second form, bad luck</p>