public void Register(Type key, T value) { if (key == null) { throw ExceptionBuilder.ArgumentNull("key"); } if (value == null) { throw ExceptionBuilder.ArgumentNull("value"); } if (_typeDictionary.ContainsKey(key)) { throw ExceptionBuilder.TypeAlreadyRegistered("key", key); } _typeDictionary.Add(key, value); OnChanged(); }