title: How to get finger positions in Leap Motion using C#
body: <p>I want to get finger positions in Leap motion using c#.I'm new to leap motion controller. So i Couldn't find any example code for detecting finger positions, but i tried to come up with some code. I think it has lot of errors.
  So, how to get finger positions in Leap Motion using C#?</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Windows.Forms;
  using Leap;
  
  namespace WindowsFormsApplication1
  {
  public partial class Form1 : Form, ILeapEventDelegate
  {
  
  
      private Controller controller;
      private LeapEventListener listener;
      public Form1()
      {
          InitializeComponent();
  
          this.controller = new Controller();
          this.listener = new LeapEventListener(this);
          controller.AddListener(listener);
      }
  
  
      delegate void LeapEventDelegate(string EventName);
      public void LeapEventNotification(string EventName)
      {
          if (!this.InvokeRequired)
          {
              switch (EventName)
              {
                  case "onInit":
                      MessageBox.Show("onInit");
                      break;
                  case "onConnect":
                      MessageBox.Show("onConnect");
                      break;
                  case "onFrame":
                      MessageBox.Show("onFrame");
                      break;
              }
          }
          else
          {
    BeginInvoke(new LeapEventDelegate(LeapEventNotification), new object[] {
    EventName });   
           }
      }
      private void Form1_Load(object sender, EventArgs e)
      {
  
      }
      }
  
  
     public interface ILeapEventDelegate
     {
      void LeapEventNotification(string EventName);
      }
  
      public class LeapEventListener : Listener
     {
      ILeapEventDelegate eventDelegate;
  
      public LeapEventListener(ILeapEventDelegate delegateObject)
      {
          this.eventDelegate = delegateObject;
      }
      public override void OnInit(Controller controller)
      {
          this.eventDelegate.LeapEventNotification("onInit");
      }
      public override void OnConnect(Controller controller)
      {
          this.eventDelegate.LeapEventNotification("onConnect");
      }
      public override void OnFrame(Controller controller)
      {
          this.eventDelegate.LeapEventNotification("onFrame");
      }
      public override void OnExit(Controller controller)
      {
          this.eventDelegate.LeapEventNotification("onExit");
      }
      public override void OnDisconnect(Controller controller)
      {
          this.eventDelegate.LeapEventNotification("onDisconnect");
      }
       } 
      }
  </code></pre>