Example #1
0
        public MainWindow()
        {
            InitializeComponent();

            const int n = 4;

            string[] url =
            {
                "https://en.wikipedia.org/wiki/Saint_Petersburg",
                "https://en.wikipedia.org/wiki/Moscow",
                "https://en.wikipedia.org/wiki/Perm",
                "https://en.wikipedia.org/wiki/Omsk"
            };

            TextBlock[] var =
            {
                var_0, var_1, var_2, var_3
            };

            Parser parser_img   = new Parser(new ParserImg());
            Parser parser_title = new Parser(new ParserTitle());

            WikiData[] data = new WikiData[4];

            for (int i = 0; i < n; i++)
            {
                data[i] = new WikiData(
                    parser_title.Parse(url[i]),
                    parser_img.Parse(url[i])
                    );
            }

            UiInit ui = new UiInit(var, image, data);
        }
Example #2
0
        public MainWindow()
        {
            InitializeComponent();
            try
            {
                TextBox[] var =
                {
                    var_0, var_1, var_2, var_3
                };

                UiInit ui = new UiInit(
                    var, image,
                    new ParserUrlList()
                    .GetData(categories[(int)Categories.EthnicGroups]));
            }
            catch (FormatException e)
            {
                MessageBox.Show(e.Message);
                Close();
            }
        }