不要声明public的event,而应使用事件访问器.

public class Source

{

    private EventHandler _NumberChangeEvent;    

    public event EventHandler NumberChangeEvent

    {

        add

        {

            _NumberChangeEvent += value;

        }

        remove

        {

            _NumberChangeEvent -= value;

        }

    }

}

 

你可能感兴趣的:(public)