D
D. Yates
How do you do this with one class instead of two?
This works:
public class UlMenu1<T> where T : UlMenuItem
{
}
// I want UlMenu2 to implement IComparable (UlBeverageItem already does,
but is not shown here).
public class UlMenu2 : UlTest1<UlBeverageItem>, IComparable
{
#region IComparable Members
public int CompareTo(object obj)
{
throw new Exception("The method or operation is not implemented.");
}
#endregion
}
This does not mean the same thing:
public class UlMenu1<T> where T : UlMenuItem, IComparable
{
}
Also, how do you have a generic input item that must be a class and still
inherit from another class?
public class UlMenu1<T> where T : UlMenuItem :
UlBaseMenuClassForUlMenu1ToInheritFrom
{
}
Thanks,
Dave
This works:
public class UlMenu1<T> where T : UlMenuItem
{
}
// I want UlMenu2 to implement IComparable (UlBeverageItem already does,
but is not shown here).
public class UlMenu2 : UlTest1<UlBeverageItem>, IComparable
{
#region IComparable Members
public int CompareTo(object obj)
{
throw new Exception("The method or operation is not implemented.");
}
#endregion
}
This does not mean the same thing:
public class UlMenu1<T> where T : UlMenuItem, IComparable
{
}
Also, how do you have a generic input item that must be a class and still
inherit from another class?
public class UlMenu1<T> where T : UlMenuItem :
UlBaseMenuClassForUlMenu1ToInheritFrom
{
}
Thanks,
Dave