public void Init()
        {
            var catalog = new CommandCatalog(new Collection <CommandEntry>
            {
                new CommandEntry(typeof(Command1), typeof(MockCommandHandler <Command1>))
            });

            _dispatcher = new CommandDispatcher(new CommandHandlerFactory(catalog), new CommandHandlerContextFactory(new List <IMetaFactory>()));
        }
예제 #2
0
        public void Init()
        {
            var catalog = new CommandCatalog(new Collection <CommandEntry>
            {
                new CommandEntry(typeof(Command1), typeof(MockCommandHandler <Command1>)),
                new CommandEntry(typeof(Command2), typeof(MockReusableCommandHandler <Command2>))
            });

            _factory = new CommandHandlerFactory(catalog);
        }
예제 #3
0
파일: Help.cs 프로젝트: stschake/GitSharp
 public override void Run(String[] args)
 {
     CommandCatalog catalog = new CommandCatalog();
     if (args.Length > 0)
     {
         CommandRef subcommand = catalog.Get(args[0]);
         if (subcommand != null)
         {
             TextBuiltin cmd = subcommand.Create();
             cmd.OnlineHelp();
         }
         else
         {
             OfflineHelp();
         }
     }
     else
     {
         OfflineHelp();
     }
 }
예제 #4
0
파일: Help.cs 프로젝트: zzia615/GitSharp
        override public void Run(String[] args)
        {
            CommandCatalog catalog = new CommandCatalog();

            if (args.Length > 0)
            {
                CommandRef subcommand = catalog.Get(args[0]);
                if (subcommand != null)
                {
                    TextBuiltin cmd = subcommand.Create();
                    cmd.OnlineHelp();
                }
                else
                {
                    OfflineHelp();
                }
            }
            else
            {
                OfflineHelp();
            }
        }
예제 #5
0
 protected virtual ICommandCatalog CreateCommandCatalog()
 {
     return(CommandCatalog = new CommandCatalog());
 }