Esempio n. 1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            cbTarget.ItemsSource = ModulList;

            wm = ModulList.ElementAt(1);
            tbStartUrl.Text      = wm.StartURL;
            tbrIntroduction.Text = wm.RegularIntroduction;
            tbrTitel.Text        = wm.RegularTitel;
            tbrDate.Text         = wm.RegularDate;
            tbrContent.Text      = wm.RegularContent;

            path  = AppDomain.CurrentDomain.BaseDirectory;
            path += @"Info\info.xml";
        }
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     ModulList            = WebModul.GetFromXML();
     cbTarget.ItemsSource = ModulList;
     wm = ModulList.ElementAt(0);
     if (wm == null)
     {
         return;
     }
     cbTarget.SelectedItem = wm;
     SPCatagory.Children.Clear();
     foreach (WebModul.UrlModel url in wm.Urls)
     {
         CheckBox cb = new CheckBox();
         cb.Content    = url.CatName;
         cb.IsChecked  = urlList.Contains(url);
         cb.Checked   += UrlCheckBox_Checked;
         cb.Unchecked += UrlCheckBox_Unchecked;
         IAddChild container = this.SPCatagory;
         container.AddChild(cb);
     }
 }
        private void btnGetDataToTool_Click(object sender, RoutedEventArgs e)
        {
            int NewsCount = txtNewsCount.Text.Equals(string.Empty) ? 0 : int.Parse(txtNewsCount.Text);

            pbProcess.Maximum = NewsCount;
            pbProcess.Minimum = 0;

            lbNewslist.Items.Clear();

            foreach (WebModul web in ModulList)
            {
                WebModul newsModel = web.Clone() as WebModul;
                IEnumerable <WebModul.UrlModel> list = urlList.Where((u) => newsModel.Urls.Contains(u));

                newsModel.Urls = list.ToList();

                Thread oThread = new Thread(() =>
                {
                    DataFunction.GetNewsToTool(newsModel, NewsCount, this);
                });
                oThread.IsBackground = true;
                oThread.Start();
            }
        }