static void Main(string[] args) { var processed = false; Console.Write("Initializing ChronoSpark Time Manager..."); SparkLogic.Initialize(); Console.WriteLine("DONE!"); while (!processed)//!exit { Console.Write("ChronoSpark => "); processed = false; var cmd = "run-console"; ReminderControl defaultController = new ReminderControl(); NoActiveTaskListener noActiveTaskListener = new NoActiveTaskListener(); IntervalPassedListener intervalPassedListener = new IntervalPassedListener(); TimeToReportListener timeToReportListener = new TimeToReportListener(); noActiveTaskListener.Suscribe(defaultController); intervalPassedListener.Suscribe(defaultController); timeToReportListener.Suscribe(defaultController); ThreadPool.QueueUserWorkItem(delegate { defaultController.ActivateReminders(); }); String[] cdmArgs = cmd.Split(' '); var commands = GetCommands(); ConsoleModeCommand consoleRunner = new ConsoleModeCommand(GetCommands); commands = commands.Concat(new[] { consoleRunner }); ConsoleCommandDispatcher.DispatchCommand(commands, cdmArgs, Console.Out); processed = true; } }
private static int Main(string[] args) { Console.WriteLine("JSONList version {0} by [email protected]", GetVersion()); var commands = GetCommands(); var consoleRunner = new ConsoleModeCommand(GetCommands); commands = commands.Concat(new[] {consoleRunner}); return ConsoleCommandDispatcher.DispatchCommand(commands, args, Console.Out); }
static int Main(string[] args) { // Locate commands avaiable var commands = GetCommands(); // Allows to execute commands from an internal console ConsoleModeCommand consoleRunner = new ConsoleModeCommand(GetCommands); commands = commands.Concat(new[] { consoleRunner }); // Run the command for the console input return ConsoleCommandDispatcher.DispatchCommand(commands, args, System.Console.Out); }
static int Main(string[] args) { // locate any commands in the assembly (or use an IoC container, or whatever source) var commands = GetCommands(); // optionally, include ConsoleModeCommand if you want to allow the user to run // commands from the console. ConsoleModeCommand consoleRunner = new ConsoleModeCommand(GetCommands); commands = commands.Concat(new[] { consoleRunner }); // run the command for the console input return ConsoleCommandDispatcher.DispatchCommand(commands, args, Console.Out); }