C# Generic List of Generic List of Multiple Types
Here is an abstraction and simplification of my issue:

I have a set of toys and a corresponding box for these toys. I want the user to be able to specify the largest type of toy that the box can hold:

    public class Box<T> {}

then within the Box class I want to have a generic list of toys, but each toy contained within the box will have a generic type:

    public class Box<T>
    {
        public List<Toys> = new List<Toys>();
        public bool Whatever;
    
        [member functions, constructors...]
        [The member functions will depend on T]
    }

The Toys class will look like this:

    public class Toy<T> where T : struct //T is any type
    {
        public List<T> = new List<T>();
        public string Name;
        public string Color;
    
        [member functions, constructors...]
    }

I want to be able to create Toys with many different types and then insert them into a Box with another specified type. Then I'd like to be able to add boxes together returning a Box with the largest type.

I really don't know how to begin. The list of a generic class with multiple types is really throwing me for a loop. I read various articles about using an abstract class or an interface, but haven't found an example or anything that accomplishes something similar to what I'm trying to do.

Any assistance anybody could provide would be very appreciated.

The solution can be in C# 4.0.

Possible Future Clarification:

I want Toy to be generic and accept a <T> argument at instantiation because Toy<T> must also have a List<T> as a member.

The nested List within Toy<T> is my main problem. I then want a list within Box that holds Toys, but each toy has as different <T> type constructor.


C# Generic List of Generic List of Multiple Types
===

Here is an abstraction and simplification of my issue:

I have a set of toys and a corresponding box for these toys. I want the user to be able to specify the largest type of toy that the box can hold:

    public class Box<T> {}

then within the Box class I want to have a generic list of toys, but each toy contained within the box will have a generic type:

    public class Box<T>
    {
        public List<Toys> = new List<Toys>();
        public bool Whatever;
    
        [member functions, constructors...]
        [The member functions will depend on T]
    }

The Toys class will look like this:

    public class Toy<T> where T : struct //T is any type
    {
        public List<T> = new List<T>();
        public string Name;
        public string Color;
    
        [member functions, constructors...]
    }

I want to be able to create Toys with many different types and then insert them into a Box with another specified type. Then I'd like to be able to add boxes together returning a Box with the largest type.

I really don't know how to begin. The list of a generic class with multiple types is really throwing me for a loop. I read various articles about using an abstract class or an interface, but haven't found an example or anything that accomplishes something similar to what I'm trying to do.

Any assistance anybody could provide would be very appreciated.

The solution can be in C# 4.0.

Possible Future Clarification:

I want Toy to be generic and accept a <T> argument at instantiation because Toy<T> must also have a List<T> as a member.

The nested List within Toy<T> is my main problem. I then want a list within Box that holds Toys, but each toy has as different <T> type constructor.

