public static IExecutable CreateCommmand(string[] lineTokens, IFootballTeamCollection footballTeamCollection)
        {
            string commandName = lineTokens[0];

            string[] toProcess = lineTokens.Skip(1).ToArray();

            object[] parametersForConstructin = new object[]
            {
                footballTeamCollection, toProcess
            };

            Type commandType = Assembly.GetExecutingAssembly()
                               .GetTypes()
                               .First(t => t.Name == commandName);

            IExecutable cmd = (IExecutable)Activator.CreateInstance(commandType, parametersForConstructin);

            return(cmd);
        }
 public Engine(IReader reader, IWriter writer, IOutputStoreManager outputStoreManager, ICommandSplit lineSplit, IFootballTeamCollection footballTeamCollection)
 {
     this.Reader                 = reader;
     this.Writer                 = writer;
     this.OutputStoremanager     = outputStoreManager;
     this.LineSplitter           = lineSplit;
     this.FootballTeamCollection = footballTeamCollection;
 }
示例#3
0
 public Remove(IFootballTeamCollection footballTeamCollection, string[] commandTokens) : base(footballTeamCollection, commandTokens)
 {
 }
示例#4
0
 public Command(IFootballTeamCollection footballTeamCollection, string[] commandTokens)
 {
     this.FootballTeamCollection = footballTeamCollection;
     this.CommandTokens          = commandTokens;
 }