guglgreatest.blogg.se

Desktop feed reader
Desktop feed reader




desktop feed reader desktop feed reader

desktop feed reader

/ Use the after select event to open the link

DESKTOP FEED READER CODE

When this event fires, the code merely examines the link text and, if it starts with 'http' the function makes an attempt to load the link into the web browser control occupying the right hand panel in the main form. This is accomplished using the After Select event from the tree view control. The next section of the code is used to load the link content into the web browser control. MessageBox.Show(ex2.ToString(), "RSS Feed Initialization MessageBox.Show(ex.Message, "RSS Feed Load Error") Navigator.Select( "//rss/channel/item/link") Navigator.Select( "//rss/channel/item/title") look for the path to the rss item titles navigate XPathNavigator navigator = doc.CreateNavigator() Private void tsRssGo_Click( object sender, EventArgs e) / Open up an RSS Feed into the treeview control This section of code in annotated and should be easy enough to follow using the comments: These two values are loaded into the tree view and make it possible for the user to read the article title and then open the link into the web browser control to read it if they are interested in getting more information on the topic. Within this click event handler, the code is placed to query for only the RSS feed item title and link. Next up is the click event handler for the RSS Go button located on the form's tool strip control. Within the constructor, the string variable used to point to the location of the RSS feed is zeroized as an empty string. A local string variable it declared and used to hold the RSS feed URL. Note that the additions of the System.Xml and libraries are the only actual departure from the default.įollowing the imports, class is defined and a constructor added. If you'd care to open the code view up in the IDE you will see that the code file begins as follows: The main form is used to open the selected RSS feed as an XML document and to display them in TreeView format form also places the story link as a child node to each title node. The left hand side of the form contains a tree view control used to display the RSS feed titles and links the right hand side contains a web browser control which is used to display the linked page. The form itself contains a tool strip control docked to the top with a text box used for entering RSS feed locations, a button control to open the RSS feed, and a combo box containing a collection of RSS feed which may be directly opened. In the solution explorer, you should note these files:Īs you can see, the project is a win forms application containing only a single form. In order to get started, unzip the included project and open the solution in the Visual Studio 2008 environment. The titles and links are recovered from the XML returned from the RSS service. The intent of the application was to provide a simple tool that may be used to organize and read RSS postings. If the user clicks on any of the link nodes, the article associated with the title will be opened into a web browser control.įigure 2: Canned RSS Feeds in drop down, current RSS feed on left side The title of the article occupies the parent node with the link node placed as the child of each title node. The RSS feed is opened and the article title and link nodes from the feed are placed into a tree view control each title becomes the parent of the related link. The application allows the user to select a canned RSS feed or to key one. This article discusses the construction of a simple application that may used to view RSS feeds from the desktop.






Desktop feed reader