public static IFeature Create(ICommandParser commandParser, Configuration configuration) { return(new BasicFeature("rollbuildnumbers", "increment the Compare teamcity build numbers after a release", "use `roll build numbers` to increment the current Compare minor version (eg `11.1.20` -> `11.2.1`)", new HandlesCommands(commandParser, new RollBuildNumbers(configuration.Get("teamcity-auth"))))); }
public CommandProcessor(IApplicationFactoriesProvider applicationFactoriesProvider, EnvironmentVariables environmentVariables) { _commandParser = new SimpleCommandParser(); _applicationFactoriesProvider = applicationFactoriesProvider; _environmentVariables = environmentVariables; EnvironmentVariables.Set(_environmentVariables); }
private Engine() { this.parser = CommandParser.Instance; this.commandProcessor = CommandProcessor.Instance; this.factory = OlympicsFactory.Instance; this.commitee = OlympicCommittee.Instance; }
public Engine(ICommandParser commandParser, IRenderer renderer, ICommandProcessor commandProcessor, CommandConstants commandConstants) { this.commandParser = commandParser; this.renderer = renderer; this.commandProcessor = commandProcessor; this.commandConstants = commandConstants; }
internal TeamcityWebhooksMessageProcessor(IHashPersistenceApi <Tracked <Build> > buildPersistence, IHashPersistenceApi <Tracked <Branch> > branchPersistence, ICommandParser commandParser) { m_BuildPersistence = buildPersistence; m_BranchPersistence = branchPersistence; m_CommandParser = commandParser; m_TeamcityEventHandler = new TeamcityEventHandler(); }
public Engine(IReader reader, IWriter writer, ICommandParser commandParser, ICommandProcessor commandProcessor) { this.reader = reader ?? throw new ArgumentNullException("Reader can't be null!"); this.writer = writer ?? throw new ArgumentNullException("Writer can't be null!"); this.commandParser = commandParser ?? throw new ArgumentNullException("Command Parser can't be null!"); this.commandProcessor = commandProcessor ?? throw new ArgumentNullException("Command Processor can't be null!"); }
public Engine(IInputProvider inputProvider, IOutputWriter outputWriter, ICommandParser commandParser) { this.commandParser = commandParser; this.inputProvider = inputProvider; this.outputWriter = outputWriter; }
/// <summary> /// Initialize command line args parser /// </summary> /// <param name="args"></param> private static bool SetupCLI(string[] args) { ICommandParser cli = null; try { cli = CLI.Parser().Title("xsltator").Version("1.0.0").HelpText("Utility for applying an xslt to an xml"); var xslt = cli.Parameter <string>("xslt").Required(true).HelpText("Xslt file path"); var xml = cli.Parameter <string>("xml").Required(true).HelpText("Xml file path"); var html = cli.Parameter <string>("html").Required(false).HelpText("Optional output html file path"); cli.Parse(args); xsltPath = xslt.Value; xmlPath = xml.Value; htmlPath = html.IsSet ? html.Value : Path.ChangeExtension(xmlPath, "html"); } catch (Exception exception) { using (CLI.WithColors(ConsoleColor.White, ConsoleColor.Red)) { Console.WriteLine($"\nError while reading command line:\t{exception.Message}\n"); using (CLI.WithForeground(ConsoleColor.Black)) { Console.WriteLine("Press any..."); Console.ReadKey(); return(false); } } } return(true); }
public CategoryWatcherHelperService( ILinkerService linkerService, IUrlShorteningService urlShorteningService, ISession session, ILogger logger, ICommandParser commandParser, IMediaWikiApiHelper apiHelper, IResponder responder) { this.linkerService = linkerService; this.urlShorteningService = urlShorteningService; this.session = session; this.logger = logger; this.apiHelper = apiHelper; this.responder = responder; lock (this.session) { this.watchedCategories = this.session.CreateCriteria <WatchedCategory>().List <WatchedCategory>(); this.ignoredPages = this.session.CreateCriteria <IgnoredPage>() .List <IgnoredPage>() .Select(x => x.Title) .ToList(); } logger.DebugFormat("Registering CategoryWatcher keys in CommandParser"); foreach (var category in this.watchedCategories) { commandParser.RegisterCommand(category.Keyword, typeof(ForceUpdateCommand)); } }
public Engine(IReader reader, IWriter writer, ICommandParser commandParser) { this.reader = reader; this.writer = writer; this.commandParser = commandParser; this.isRunning = true; }
public static IFeature Create(ICommandParser commandParser, Configuration configuration) { return(new BasicFeature("webcams", "get links to webcams in the building", "use `cafcam` or `fooscam` to get the relevant webcam", new HandlesCommands(commandParser, new Webcams(configuration.Get("webcam-auth"))))); }
public InputHandler(ICommandParser commandParser_, IInputParser inputParser_, ICommandExecuter[] commandExecuters_, ILogger logger_) { commandParser = commandParser_; inputParser = inputParser_; commandExecuters = commandExecuters_; logger = logger_; }
public static IFeature Create(ICommandParser parser) { return(new BasicFeature("polls", "run a poll to enact the tyranny of the majority", "use `start poll` to start a poll", new HandlesCommands(parser, new Polls()))); }
public PluginManager(ILoggingService logger, IMtgStore store, ICommandParser commandParser, IReporter reporter, TinyIoCContainer container) { if (logger == null) { throw new ArgumentNullException("logger"); } if (store == null) { throw new ArgumentNullException("store"); } if (commandParser == null) { throw new ArgumentNullException("commandParser"); } if (reporter == null) { throw new ArgumentNullException("reporter"); } if (container == null) { throw new ArgumentNullException("container"); } this.mLogger = logger; this.mStore = store; this.mCommandParser = commandParser; this.mReporter = reporter; this.mContainer = container; }
public TerminatorCommandReader(IAppServer appServer, Encoding encoding, byte[] terminator, ICommandParser commandParser) : this(appServer) { Encoding = encoding; m_SearchState = new SearchMarkState <byte>(terminator); m_CommandParser = commandParser; }
public Engine(ICommandParser commandParser, ICommandProcessor commandProcessor, IConsoleRenderer consoleRenderer, IFileManager fileManager) { this.commandParser = commandParser; this.commandProcessor = commandProcessor; this.consoleRenderer = consoleRenderer; this.fileManager = fileManager; }
public Engine(IReader reader, IWriter writer, ICommandParser commandParser, ICommandProcessor commandProcessor) { this.reader = reader; this.writer = writer; this.commandParser = commandParser; this.commandProcessor = commandProcessor; }
public Desk(string deskId, string groupName = "DefaultGroupName") { DeskId = deskId; GroupName = groupName; _currentParser = new WaitingParser(); _standardParser = new StandardParser(); }
public static IFeature Create(ICommandParser commandParser, IWebClient webClient) { return(new BasicFeature("silly", "get a random quote, class name, gif, etc", "use `quote`, `class name`, or `giphy <search>` to find something interesting", new HandlesCommands(commandParser, new Silly(webClient)))); }
/// <summary> /// This method is called by the command parser when running the command. You won't need to call this directly. /// </summary> /// <param name="parser">Parser instance that called this command.</param> /// <param name="args">Command arguments passed in from the command line.</param> /// <returns></returns> public IEnumerable <string> Process(ICommandParser parser, string[] args) { Parser = parser; ProcessCommand(args); foreach (var sd in _switchData) { var found = false; foreach (var sw in Switches) { if (sw.Names.Contains(sd.Key.ToLower())) { found = true; } if (sw.ShortNames.Contains(sd.Key)) { found = true; } } if (found) { continue; } throw new CommandParserException($"The switch {sd.Key} is not a valid switch for this command!"); } return(_returnText); }
public static IFeature Create(ICommandParser commandParser, IWebClient webClient) { return(new BasicFeature("installers", "get a compare/data compare installer", "use `installer for <compare|data compare> <version>` to get a link to download the teamcity artifact for that build", new HandlesCommands(commandParser, new Installers(webClient)))); }
public void Initialise() { try { Ticker.Tick(); BusG.Init(); alreadyRunning = Bus.Session.RequestName(BusName) != RequestNameReply.PrimaryOwner; if (alreadyRunning) { commandParser = Bus.Session.GetObject <ICommandParser>(BusName, new ObjectPath(CommandParserPath)); } else { Bus.Session.Register(BusName, new ObjectPath(CommandParserPath), commandParser); } } catch (Exception) { Console.WriteLine("**************************************"); Console.WriteLine("* DBus support could not be started. *"); Console.WriteLine("* Some functionality will be missing *"); Console.WriteLine("**************************************"); } finally { Initialised = true; Ticker.Tock("DBus"); } }
public StackOperationTranslator( ICommandParser commandParser, IStackOperationTranslatorProvider translatorProvider) { this.commandParser = commandParser; this.translatorProvider = translatorProvider; }
public CommandClient(string ipAddress, int port, string host, string protocol, IWebSocketClientSessionFactory sessionFactory, ICommandParser commandParser) { logger = LoggerManager.GetLogger(String.Format("CommandClient_{0}_{1}", ipAddress, port)); SessionCommandParser = commandParser; IsConnecting = false; IP = ipAddress; Port = port; RequestTimeout = TimeSpan.FromMinutes(2); MaxRetryCount = 3; IsAync = true; Session = new CommandSession(); Session.CommandParser = commandParser; IsConnected = false; CommandAliveTime = TimeSpan.FromMinutes(2); CommandList = new List <ICommand>(); CommandList.Add(new SetCommandParserResponse()); CommandParser = new List <ICommandParser>() { new WSCommandType(), new WSBinaryCommandType() }; client = new WebSocketClient(host, "", protocol, sessionFactory); client.Connected += new EventHandler <WebSocketConnectedEventArgs>(ClientConnected); client.Closed += new EventHandler(ClientClosed); client.MessageReceived += new EventHandler <MessageReceivedEventArgs>(MessageReceived); }
public RobotController(IRobot robot, IUserInput input, IUserOutput output, ICommandParser commandParser) { _robot = robot; _input = input; _output = output; _commandParser = commandParser; }
public TradingApiClientEngine( IInputDevice inputDevice, ICommandParser commandParser) { this.inputDevice = inputDevice; this.commandParser = commandParser; }
public ScriptHandler(ICommandParser parser, Script script, Command command, EngineState state) { _parser = parser; _script = script; _command = command; _state = state; }
public GithubReviewMessageProcessor(ICommandParser commandParser, IReviewApi review, string defaultUser = null, string defaultRepo = null) { m_CommandParser = commandParser; m_ReviewApi = review; m_DefaultUser = defaultUser; m_DefaultRepo = defaultRepo; }
public Engine(IReader reader, IWriter writer, IDatabase database, ICommandParser parser) { this.reader = reader; this.writer = writer; this.database = database; this.commandParser = parser; }
/// <summary> /// Create a new instance of the given /// </summary> /// <param name="type"></param> /// <returns></returns> protected static ICommandParser GetInstance(Type type) { ICommandParser commandParser = (ICommandParser)Activator.CreateInstance(type); ((AbstractCommandParser)commandParser).logger = LogManager.GetLogger(type); return(commandParser); }
public CommandCenter(ICommandParser commandParser, IRobot robot, ISurface surface, CommandFactory commandFactory) { _robot = robot; _commandParser = commandParser; Surface = surface; _commandFactory = commandFactory; _executedCommands = new List<ICommand>(); }
public Engine(byte rowsAmmount, byte colsAmmount) { field = new PlayField(rowsAmmount, colsAmmount); scoreBoard = new ScoreBoard(); player = new Player(); communicator = new ConsoleCommunicator(); parser = new CommandParser(); }
public GameEngine( ICommandParser commandParser, ICommandExecutor commandExecutor, IConsoleOperator consoleOperator) { this.CommandParser = commandParser; this.ConsoleOperator = consoleOperator; this.CommandExecutor = commandExecutor; }
public ConsoleApplication(ICommandParser commandParser, IResultHandler resultHandler, IInput input, IExceptionHandler exceptionHandler) { _commandParser = commandParser; _resultHandler = resultHandler; _input = input; _exceptionHandler = exceptionHandler; }
public CommandCenter(ILandingSurface aLandingSurface, ICommandParser aCommandParser, ICommandInvoker aCommandInvoker, IReportComposer aReportComposer) { rovers = new List<IRover>(); landingSurface = aLandingSurface; commandParser = aCommandParser; commandInvoker = aCommandInvoker; reportComposer = aReportComposer; commandInvoker.SetLandingSurface(landingSurface); commandInvoker.SetRovers(rovers); }
public CosmeticsEngine( ICosmeticsFactory factory, IShoppingCart shoppingCart, ICommandParser commandParser) { this.factory = factory; this.shoppingCart = shoppingCart; this.commandParser = commandParser; this.categories = new Dictionary<string, ICategory>(); this.products = new Dictionary<string, IProduct>(); }
/// <summary> /// Gets the command instance from the command parser /// </summary> /// <param name="commandParser">The command parser.</param> /// <param name="commandName">Name of the command.</param> /// <returns></returns> public ILiveBlogCommand GetCommand(ICommandParser commandParser, string commandName) { if (commandParser.Name != LiveBlogConfigurationManager.Configuration.DefaultCommandParserProvider.Name) { throw new ArgumentException("You must use the default command parser provider"); } var command = LiveBlogConfigurationManager.Configuration.DefaultCommandParserProvider.Commands.FirstOrDefault( c => c.Name.Equals(commandName, StringComparison.InvariantCultureIgnoreCase)); return command?.GetInstance<ILiveBlogCommand>(); }
public MainPage() { var goPiGo = DeviceFactory.BuildGoPiGo(); goPiGo.MotorController().EnableServo(); var leftLed = DeviceFactory.BuildLed(Pin.LedLeft); var rightLed = DeviceFactory.BuildLed(Pin.LedRight); _commandParser = new CommandParser(goPiGo,leftLed,rightLed); SocketConnection.StartListener(); SocketConnection.NewMessageReady += SendCommand; InitializeComponent(); }
public ImageModule(IRootPathProvider rootPathProvider, ICommandParser commandParser, IBlobStore store, IImageGenerator imageGenerator) { Post["/image/"] = _ => { Command c = null; if (!commandParser.TryParse(Request.Form.text.HasValue ? (string)Request.Form.text : string.Empty, out c)) { // Invalid input. Early return. return Response.AsJson(UnknownResponse); } if (string.Compare(c.Preamble, Command.HelpConstant, StringComparison.OrdinalIgnoreCase) == 0) { // Help request. Early return. return Response.AsJson(HelpResponse); } var imageId = string.Format("{0}-{1}-{2}.jpg", c.Preamble, Nancy.Helpers.HttpUtility.UrlEncode(c.TopLine ?? string.Empty), Nancy.Helpers.HttpUtility.UrlEncode(c.BottomLine ?? string.Empty)); if (!store.Exists(imageId)) { var img = imageGenerator.GenerateImage(c.Preamble, c.TopLine, c.BottomLine); if (img != null) { using (var ms = new MemoryStream()) { img.Save(ms, ImageFormat.Jpeg); ms.Seek(0, SeekOrigin.Begin); store.Store(imageId, ms); } } else { // We failed to generate an image; send unknown response return Response.AsJson(new Models.UnknownResponse()); } } return Response.AsJson( new Models.ImageResponse(store.GetUri(imageId).ToString(), string.Format("{0} {1}", c.TopLine, c.BottomLine))); }; }
public CommandManager(ICommandParser parser) { _parser = parser; // Add default converters Add(CommandBuilder.CreateConverter<String, Boolean>(s => Boolean.Parse(s))); Add(CommandBuilder.CreateConverter<String, Char>(s => Char.Parse(s))); Add(CommandBuilder.CreateConverter<String, UInt16>(s => UInt16.Parse(s))); Add(CommandBuilder.CreateConverter<String, UInt32>(s => UInt32.Parse(s))); Add(CommandBuilder.CreateConverter<String, UInt64>(s => UInt64.Parse(s))); Add(CommandBuilder.CreateConverter<String, Int16>(s => Int16.Parse(s))); Add(CommandBuilder.CreateConverter<String, Int32>(s => Int32.Parse(s))); Add(CommandBuilder.CreateConverter<String, Int64>(s => Int64.Parse(s))); Add(CommandBuilder.CreateConverter<String, Single>(s => Single.Parse(s))); Add(CommandBuilder.CreateConverter<String, Double>(s => Double.Parse(s))); }
public static void Start(IReader reader, IWriter writer, ICommandParser parser) { Setup(reader, writer, parser); var command = reader.ReadLine(); while (command != GlobalConstants.EndExecutionCommand) { try { var result = commandParser.ParseCommand(command); writer.WriteLine(result); } catch (Exception e) { writer.WriteLine(e.Message); } command = reader.ReadLine(); } }
public CommandExecutor(ICommandParser commandParser) { mCommandParser = commandParser; }
public CommandManager(ICommandParser parser, IConsoleRenderer renderer) { this.parser = parser; this.renderer = renderer; scoreManager = ScoreManager.Instance; }
public void ExecuteCommand(ICatalog catalog, ICommandParser commandParser, StringBuilder stringBuilder) { switch (commandParser.Type) { case Command.AddBook: { catalog.Add(new Content(CatalogType.Book, commandParser.Parameters)); stringBuilder.AppendLine("Book added"); } break; case Command.AddMovie: { catalog.Add(new Content(CatalogType.Movie, commandParser.Parameters)); stringBuilder.AppendLine("Movie added"); } break; case Command.AddSong: { catalog.Add(new Content(CatalogType.Song, commandParser.Parameters)); stringBuilder.AppendLine("Song added"); } break; case Command.AddApplication: { catalog.Add(new Content(CatalogType.Application, commandParser.Parameters)); stringBuilder.AppendLine("Application added"); } break; case Command.Update: { if (commandParser.Parameters.Length != 2) { throw new FormatException("Invalid Parameters!"); } stringBuilder.AppendLine( string.Format( "{0} items updated", catalog.UpdateContent(commandParser.Parameters[0], commandParser.Parameters[1]))); } break; case Command.Find: { if (commandParser.Parameters.Length != 2) { Console.WriteLine("Invalid params!"); throw new Exception("Invalid number of parameters!"); } var numberOfElementsToList = int.Parse(commandParser.Parameters[1]); var foundContent = catalog.GetListContent(commandParser.Parameters[0], numberOfElementsToList); var enumerable = foundContent as IContent[] ?? foundContent.ToArray(); if (!enumerable.Any()) { stringBuilder.AppendLine("No items found"); } else { foreach (var content in enumerable) { stringBuilder.AppendLine(content.ToString()); } } } break; default: { throw new InvalidCastException("Unknown command!"); } } }
private static void Setup(IReader newReader, IWriter newWriter, ICommandParser parser) { reader = newReader; writer = newWriter; commandParser = parser; Teachers = new Dictionary<int, Teacher>(); Students = new Dictionary<int, Student>(); }
public CommandDecoder() { this.commandParser = new DefaultCommandParser(); }
public DevelopLooper() { this._loop = true; this._cmdParser = new CommandParser (); }
public CommandManager(ICommandFactory commandFactory, ICommandParser commandParser) { this.commandFactory = commandFactory; this.commandParser = commandParser; }
/// <summary> /// Initializes a new instance of the <see cref="CommandRunner"/> class. /// </summary> /// <param name="parser">The parser.</param> /// <param name="lookup">The lookup.</param> public CommandRunner(ICommandParser parser, ICommandLookup lookup) { _parser = parser; _lookup = lookup; }
public MockedCosmeticsEngine(ICosmeticsFactory factory, IShoppingCart shoppingCart, ICommandParser commandParser) : base(factory, shoppingCart, commandParser) { }
public CommandManager() { this.commandFactory = new CommandFactory(); this.commandParser = new CommandParser(); }
void SetParser(ICommandParser commandParser) { _commandParser = commandParser; }
public void Initialise() { try { Ticker.Tick (); BusG.Init (); alreadyRunning = Bus.Session.RequestName (BusName) != RequestNameReply.PrimaryOwner; if (alreadyRunning) commandParser = Bus.Session.GetObject<ICommandParser>(BusName, new ObjectPath (CommandParserPath)); else Bus.Session.Register(BusName, new ObjectPath(CommandParserPath), commandParser); } catch (Exception) { Console.WriteLine ("**************************************"); Console.WriteLine ("* DBus support could not be started. *"); Console.WriteLine ("* Some functionality will be missing *"); Console.WriteLine ("**************************************"); } finally { Initialised = true; Ticker.Tock ("DBus"); } }
public CmdFactory(ICommandParser commandParser, ICcTray ccTray) { _commandParser = commandParser; _ccTray = ccTray; }
public CmdFactory(ICommandParser commandParser) { _commandParser = commandParser; }
public CommandProcessorFacade(ICommandParser commandParser, ICommandFactory commandFactory) { this.CommandParser = commandParser; this.CommandFactory = commandFactory; }
public CommandExecutor(ICommandParser commandParser, ICommandProcessor commandProcessor, ILogger logger) { this.commandParser = commandParser; this.commandProcessor = commandProcessor; this.logger = logger; }
public CommandParserTests() { _commandParser = new CommandParser(_commandParserConfigurationRegistryMock.Object, _commandFactoryMock.Object, _commandArgumentParserMock.Object); }
public DBusInstance() { commandParser = new CommandParser (); }