Esempio n. 1
0
        private void TopicClicked(object sender, EventArgs e)
        {
            // Show all articles contained in the topic
            TopicTreeViewItem selectedTopic = (TopicTreeViewItem)sender;
            List <Article>    articles      = new List <Article>();

            foreach (TopicItem t in topics)
            {
                if (t.name == (string)selectedTopic.Header)
                {
                    articles = t.articleList;
                }
            }

            articleList.Items.Clear();


            foreach (Article i in articles)
            {
                ArticleListItem articleListItem = new ArticleListItem();        // Create a new ArticleListItem to be displayed
                articleListItem.Title       = i.Title;                          // Get the correct title
                articleListItem.Date        = i.Publication_Date;               // Get the correct date
                articleListItem.URL         = i.URL;
                articleListItem.Description = i.Summary;
                articleListItem.Read        = "";                               // Setting default to unread

                articleList.Items.Add(articleListItem);                         // Place in the UI
            }
        }
Esempio n. 2
0
        private void treeComp_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            articleList.Items.Clear();
            ComponentTreeViewItem senderComp = (ComponentTreeViewItem)sender;  // Typecast so we can figure out the sender
            List <Article>        articles;                                    // Create a new list of articles for the return

            articles = compView.Get_Articles_Under(senderComp.Path);           // Get the list of articles below the current selection

            foreach (Article i in articles)
            {
                ArticleListItem articleListItem = new ArticleListItem();        // Create a new ArticleListItem to be displayed
                articleListItem.Title       = i.Title;                          // Get the correct title
                articleListItem.Date        = i.Publication_Date;               // Get the correct date
                articleListItem.URL         = i.URL;
                articleListItem.Description = i.Summary;
                articleListItem.Read        = "";                               // Setting default to unread

                articleList.Items.Add(articleListItem);                         // Place in the UI
            }
        }
Esempio n. 3
0
        private void ArticleListItem_Clicked(object sender, SelectionChangedEventArgs e)
        {
            ListView        currentList    = (ListView)sender;
            ArticleListItem currentArticle = (ArticleListItem)currentList.SelectedItem;

            // Verify if the selection has articles
            if (currentArticle == null)
            {
                return;
            }

            // Need to have function return string containing information from description tag in RSS XML
            FlowDocument newContent = new FlowDocument();
            Paragraph    newP       = new Paragraph();

            Run newRun = new Run(currentArticle.Description);   // Getting the Summary attibute

            newP.Inlines.Add(newRun);
            newContent.Blocks.Add(newP);                        // Placing the summary into the newContent which will be displayed in the summaryBox
            summaryBox.Document = newContent;                   // Display summary
            currentArticle.Read = "X";                          // Reflecting that the article has been read
        }