예제 #1
0
        public object create(Type type)
        {
            ICanCreate creator = this.creators[type];

            return(creator.create());
        }
 public void registerCreator(Type type, ICanCreate creator, bool replace)
 {
     registerCreator(type, creator, replace);
 }
 public static IServiceBus Create(this ICanCreate <IMessage, ICommand, IEvent, IRequest, IResponse> creator)
 {
     return(new ServiceBus(creator.CreateServiceBus()));
 }
 public void registerCreator(Type type, ICanCreate creator)
 {
     this.factory.registerCreator(type, creator);
 }
예제 #5
0
 public void RegisterCreator <T>(ICanCreate <T> creator) where T : class
 {
     mappings[typeof(T)] = creator;
 }
예제 #6
0
    public T Create <T>()
    {
        ICanCreate <object> creator = mappings[typeof(T)];

        return((T)creator.NewObject());   // I do not think you can get rid of this cast
    }
 public void registerCreator(Type type, ICanCreate creator, bool replace)
 {
     registerCreator(type, creator, replace);
 }
 public void registerCreator(Type type, ICanCreate creator)
 {
     this.factory.registerCreator(type, creator);
 }