界面代码: internal void Cancel()
{
this.Invoke(new MethodInvoker(this.Close), null);
}
类里面的代码: public void Cancel()
{
this._GUI.Invoke(new MethodInvoker<????>(this._GUI.Cancel),null);//这里面的类型怎么写?
//看了一下说明:类型必须与参数的返回类型一样,它返回void 应该怎么写呢?
}
声明:
internal delegate void MethodInvoker<T>(T parameter1);
{
this.Invoke(new MethodInvoker(this.Close), null);
}
类里面的代码: public void Cancel()
{
this._GUI.Invoke(new MethodInvoker<????>(this._GUI.Cancel),null);//这里面的类型怎么写?
//看了一下说明:类型必须与参数的返回类型一样,它返回void 应该怎么写呢?
}
声明:
internal delegate void MethodInvoker<T>(T parameter1);
我用的VS05 打不开`就看了看代码`编绎的时候有一个错`我知道不那样写也行但是我想知道 如果要传参数的话对于 null 或者空类型<???>这里面应该怎么写
你把这个当构造方法使了?这个委托的用法跟Action<T>是一样的
也就是实例化时,T是目标方法this._GUI.Cancel的参数类型,你直接用MethodInvoker()不就好了
是我整错了this._GUI.Invoke(new MethodInvoker(this._GUI.Cancel), null);