我需要做類似下面的,但得到上述錯誤不能鍵入「DelegateType」轉換爲「System.Delegate」
class PrioritizedEvent<DelegateType>
{
private ArrayList delegates;
public PrioritizedEvent()
{
this.delegates = new ArrayList();
}
public void AddDelegate(DelegateType d, int priority)
{
this.delegates.Add(new PrioritizedDelegate<DelegateType>((Delegate)d, priority));
this.delegates.Sort();
}
protected class PrioritizedDelegate<DelegateType> : IComparable
{
public Delegate d;
public int priority;
public PrioritizedDelegate(Delegate d, int priority)
{
this.d = d;
this.priority = priority;
}
}
}
我不能種姓DelegateType d要委派