title: c# public function defined and used in other functions
body: <p>Hey all i have the following code:</p>
  
  <pre><code> namespace testingLeap
   {
    class Program : Listener
    {
      GestureListener listener;
      Controller controller;
  
      static void Main(string[] args)
      {
          listener = new GestureListener(500);
          listener.onGesture += listener_onGesture;
          Controller controller = new Controller(listener);
  </code></pre>
  
  <p>I am wanting to share the <strong>listener</strong> and the <strong>controller</strong> with other static void functions within the program.. however, doing the above i get errors:</p>
  
  <p><em>An object reference is required for the non-static field, method, or property 'testingLeap.Program.listener'</em></p>
  
  <p>What would i be doing incorrect? I know in VB this works:</p>
  
  <pre><code>Dim listener As New GestureListener(500)
  Dim controller As New Controller(listener)
  
  Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
     listener.onGesture += listener_onGesture
  End Sub
  </code></pre>