Here is my solution, though it is not perfect, it works. :)
namespace Test
{
public interface ITransitionTool
{
}
public class Plane : ITransitionTool
{
}
public class Car : ITransitionTool
{
}
public interface IStyleCollection
{
}
public class Style
{
private Color mColor = new Color();
}
public class StyleHandle<T>
{
private List<T> mUserObjects = new List<T>();
public void Adduser(T obj)
{
mUserObjects.Add(obj);
}
public void RemoveUser(T obj)
{
mUserObjects.Remove(obj);
}
}
public class StyleHandleCollection<T> : IStyleCollection
{
public Dictionary<string, StyleHandle<T>> mDict = null;
public StyleHandleCollection()
{
mDict = new Dictionary<string, StyleHandle<T>>();
}
}
public class TransitionToolManager
{
private Dictionary<Type, IStyleCollection> mCollection = null;
public TransitionToolManager()
{
mCollection = new Dictionary<Type, IStyleCollection>();
}
public void Add<T>(StyleHandleCollection<T> collection)
{
mCollection.Add(typeof(object), collection);
}
}
public class Document
{
private TransitionToolManager mMgr = null;
public Document()
{
mMgr = new TransitionToolManager();
StyleHandleCollection<Plane> planeStyles = new StyleHandleCollection<Plane>();
mMgr.Add(planeStyles);
}
}
}