找不到类型或命名空间名称“EventHandler”

时间:2013-08-07 03:19:40

标签: c# xamarin

我正在使用C#和Xamarin,当使用EventHandler时,我收到了这个错误:

The type or namespace name 'EventHandler' could not be found(are you missing a using dirrective or an assembly reference?)(CS0246)

这是我的代码:

using Emgu.CV;
using Emgu.CV.UI;
using Emgu.CV.Structure;
using System.Drawing;
using System.Windows.Forms;

namespace Emgu_Hello_World
{
    public class EmptyClass
    {
        public static void Main(string[] args)
        {
            ImageViewer viewer = new ImageViewer ();
            Capture capture = new Capture ();
            Application.Idle += new EventHandler (delegate(object sender, EventArgs e) {
                viewer.Image = capture.QueryFrame ();
            });
            viewer.ShowDialog ();
        }
    }
}

我应该参考什么?

1 个答案:

答案 0 :(得分:1)

EventHandler在System命名空间中定义:

   using System;