private static void Main(string[] args)
        {
            ILoger consoleLoger = new ConsoleLoger();

            XPathExtractor xPathExtractor = new XPathExtractor(PathToXml, "artist");
            consoleLoger.Log(xPathExtractor.ExtractItems(xPathQuery));
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Console.SetWindowSize(Console.LargestWindowWidth, Console.LargestWindowHeight);
            ServicePointManager.Expect100Continue = true;
            ServicePointManager.SecurityProtocol  = SecurityProtocolType.Tls12;
            ILogger     logger           = new ConsoleLoger();
            TelegramBot bot              = new TelegramBot();
            string      connectionString = ConfigurationManager.ConnectionStrings["TelegramApp"].ConnectionString;
            IStorage    storage          = new DapStorageDB(logger, connectionString);
            EventViews  viewer           = new EventViews();

            try
            {
                TelegramChecker telegramBot     = new TelegramChecker(ref storage, ref bot, ref viewer, ref logger);
                Thread          telegramChecker = new Thread(telegramBot.Run);
                telegramChecker.Start();
            }
            catch (AggregateException ex)
            {
                foreach (var x in ex.InnerExceptions)
                {
                    logger.WriteLog(x.Message);
                    bot.SendMessageMe(x.Message);
                }
                Console.ReadKey();
            }
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            var loger = new ConsoleLoger();
            var db    = new NotePadDB();
            var noter = new Noter(db, loger, "C:/Users/PC/Desktop/DataBase/");

            noter.Start();
        }
        private static void Main()
        {
            //2. Write program that extracts all different artists which are found in the catalog.xml.
            //For each author you should print the number of albums in the catalogue.
            //Use the DOM parser and a hash-table.

            DOMExtractor domExtractor = new DOMExtractor(PathToXml, ItemToExtract);
            ILoger consoleLoger = new ConsoleLoger();
            consoleLoger.Log(domExtractor.ExtractItems());
        }
        private static void Main()
        {
            // 4. Using the DOM parser write a program to delete from catalog.xml all albums having price > 20.

            ILoger consoleLoger = new ConsoleLoger();

            DOMRemover remover = new DOMRemover(PathToXml, ItemToRemove);
            Console.WriteLine("Before removing:");
            consoleLoger.Log(remover.ExtractItemsByArtist());
            Console.WriteLine("----------------------------");
            Console.WriteLine("After removing:");
            remover.RemoveAlbumByPrice(Price);
            consoleLoger.Log(remover.ExtractItemsByArtist());
        }
Beispiel #6
0
        static void Main(string[] args)
        {
            //List of .NetLab Tasks
            var tasks = new IRunnable[]
            {
                //C# basic exercices
                new TaskLibrary.Tasks.Lesson1.BasicExercices.Task1(),
                new TaskLibrary.Tasks.Lesson1.BasicExercices.Task2(),
                new TaskLibrary.Tasks.Lesson1.BasicExercices.Task3(),
                new TaskLibrary.Tasks.Lesson1.BasicExercices.Task4(),
                new TaskLibrary.Tasks.Lesson1.BasicExercices.Task5(),
                new TaskLibrary.Tasks.Lesson1.BasicExercices.Task6(),
                new TaskLibrary.Tasks.Lesson1.BasicExercices.Task7(),
                new TaskLibrary.Tasks.Lesson1.BasicExercices.Task8(),
                //Data types exercices
                new TaskLibrary.Tasks.Lesson1.DataTypes.Task1(),
                new TaskLibrary.Tasks.Lesson1.DataTypes.Task2(),
                new TaskLibrary.Tasks.Lesson1.DataTypes.Task3(),
                new TaskLibrary.Tasks.Lesson1.DataTypes.Task4(),
                //Conditional statements exercices
                new TaskLibrary.Tasks.Lesson1.ConditionalStatements.Task1(),
                new TaskLibrary.Tasks.Lesson1.ConditionalStatements.Task2(),
                new TaskLibrary.Tasks.Lesson1.ConditionalStatements.Task3(),
                new TaskLibrary.Tasks.Lesson1.ConditionalStatements.Task4(),
                new TaskLibrary.Tasks.Lesson1.ConditionalStatements.Task5(),
                //For loop exercices
                new TaskLibrary.Tasks.Lesson1.ForLoop.Task1(),
                new TaskLibrary.Tasks.Lesson1.ForLoop.Task2(),
                new TaskLibrary.Tasks.Lesson1.ForLoop.Task3(),
                new TaskLibrary.Tasks.Lesson1.ForLoop.Task4(),
                new TaskLibrary.Tasks.Lesson1.ForLoop.Task5(),
                new TaskLibrary.Tasks.Lesson1.ForLoop.Task6(),
                //Arrays exercices
                new TaskLibrary.Tasks.Lesson1.Arrays.Task1(),
                new TaskLibrary.Tasks.Lesson1.Arrays.Task2(),
                new TaskLibrary.Tasks.Lesson1.Arrays.Task3(),
                new TaskLibrary.Tasks.Lesson1.Arrays.Task4(),
                new TaskLibrary.Tasks.Lesson1.Arrays.Task5()
            };

            ConsoleLoger consoleLoger = new ConsoleLoger();

            foreach (var task in tasks)
            {
                task.Run(consoleLoger);
            }

            consoleLoger.ReadKey();
        }
Beispiel #7
0
        private static ILogger SetupLogger(InputArguments inputArgs)
        {
            ILogger logger;

            if (inputArgs.FileLogging)
            {
                logger = new FileLogger();
            }
            else
            {
                logger = new ConsoleLoger();
            }

            return(logger);
        }