Пример #1
0
        public void Execute(Arguments args)
        {
            if (args == null)
            {
                throw new ArgumentNullException(nameof(args));
            }

            var config = configRepository.ReadConfiguration(args.ConfigFile);

            string line;
            var    inputData  = inputFactory.GetInput(args);
            var    lineNumber = 0;

            while ((line = inputData.ReadLine()) != null)
            {
                progress.ReportProgress(++lineNumber);
                if (!IsNdJson(line.Trim()))
                {
                    throw new InvalidOperationException($"Received incompatible data in input stream.\nLine {lineNumber} isn't in NDJSON format\n`{line}`");
                }

                var jsonObject = (JObject)serialiser.Deserialize(new JsonTextReader(new StringReader(line)));
                processor.ProcessData(config, jsonObject);
            }

            progress.ReportEnd(lineNumber);
        }
Пример #2
0
        public void Execute()
        {
            Console.Write("Please Input some words:");
            string input = Console.ReadLine();

            input = _dataProcessor.ProcessData(input);
            Console.WriteLine(input);
        }
Пример #3
0
 public void Logging(string username, string password)
 {
     homeSys.DisplayHomeScreen();
     users.ConnectToUserDB();
     users.VerifyUserCredentials(username, password);
     data.ConnectToDB();
     Console.WriteLine(data.ProcessData());
 }