title: Reflection.TargetInvocationException
body: <p>I have a class named <em>carroms</em>. When I create its object, there is no error. But when I create an array of <em>carroms</em> then, this exception is thrown:</p>
  
  <blockquote>
    <p>An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in PresentationFramework.dll</p>
    
    <p>Additional information: Exception has been thrown by the target of an invocation.</p>
  </blockquote>
  
  <p>My code for the <em>carroms</em> class:</p>
  
  <pre><code>class carroms
  {
  
      private bool player;
  
      public bool checkPlayer
      {
          get { return player; }
          set { player = value; }
      }
  
      private Point center;
  
      public Point carromCenter
      {
          get { return center; }
          set { center = value; }
      }
  
      private Point[] points;
  
      public Point[] carromPoints
      {
          get { return points; }
          set { points = value; }
      }
  
      private double width;
  
      public double carromWidth
      {
          get { return width; }
          set { width = value;
          }
      }
  
      private double height;
  
      public double carromHeight
      {
          get { return height; }
          set { height = value; }
      }
  
      public carroms()
      {
          points = new Point[370];
      }
  
      public Ellipse draw()
      {
          Ellipse myellipse = new Ellipse();
          myellipse.Height = carromHeight;
          myellipse.Width = carromWidth;
          if (checkPlayer == true)
          {
              myellipse.Fill = Brushes.Black;
          }
          else
          {
              myellipse.Fill = Brushes.Beige;
          }
          return myellipse;
      }
  }
  </code></pre>
  
  <p>And my code for creating the object:</p>
  
  <pre><code>Random randi = new Random();
  carroms[] mycarroms = new carroms[5];
  mycarroms[0].carromHeight = 100;
  mycarroms[0].carromWidth = 100;
  mycanvas.Children.Add(mycarroms[0].draw());
  </code></pre>