public delegate void NotifyEventHandler(NotifyQuery sender);    public abstract class NotifyQuery
    {
        public event NotifyEventHandler NotifyVerifyFaild
        {
            [MethodImpl(MethodImplOptions.Synchronized)]
            add
            {
                this.NotifyVerifyFaild = (NotifyEventHandler)Delegate.Combine(this.NotifyVerifyFaild, value);
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            remove
            {
                this.NotifyVerifyFaild -= (NotifyEventHandler)Delegate.Remove(this.NotifyVerifyFaild, value);
            }
        }
        public event NotifyEventHandler PaidToIntermediary
        {
            [MethodImpl(MethodImplOptions.Synchronized)]
            add
            {
                this.PaidToIntermediary = (NotifyEventHandler)Delegate.Combine(this.PaidToIntermediary, value);
            }
            [MethodImpl(MethodImplOptions.Synchronized)]
            remove
            {
                this.PaidToIntermediary = (NotifyEventHandler)Delegate.Remove(this.PaidToIntermediary, value);
            }
        }
}提示错误 9 事件“NotifyQuery.NotifyVerifyFaild”只能出现在 += 或 -= 的左边

解决方案 »

  1.   

    this.NotifyVerifyFaild = (NotifyEventHandler)Delegate.Combine(this.NotifyVerifyFaild, value);
    不能直接 = ,要 +=
      

  2.   

    Delegate.Combine(this.NotifyVerifyFaild, value);是这部份提示的
      

  3.   

    this.NotifyVerifyFaild += (NotifyEventHandler)Delegate.Combine(this.NotifyVerifyFaild, value);
    即便这样写了,也无法通过编译,还是一样的错误,原因在Delegate.Combine(this.NotifyVerifyFaild, value);不知道是为什么?