예제 #1
0
        private void LoadLinks()
        {
            RssLinkXML rsssLinkXml = new RssLinkXML();
            linkSet = rsssLinkXml.GetLinkSet();

            this.rssbindingSource.DataSource = linkSet;
            this.rssbindingSource.DataMember = linkSet.Tables[0].TableName;
            this.linksGridView.DataSource = rssbindingSource;

            linksGridView.AllowUserToAddRows = false;
            linksGridView.Columns["title"].HeaderText = "标题";
            linksGridView.Columns["title"].Width = 220;
            linksGridView.Columns["uri"].HeaderText = "URI";
            linksGridView.Columns["uri"].Width = 280;
            linksGridView.Columns["defaultshow"].HeaderText = "缺省显示";
            linksGridView.Columns["defaultshow"].Width = 80;
        }
예제 #2
0
        private void 新增频道ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AddFeed addFeed = new AddFeed();
            addFeed.ShowDialog();
            string url = addFeed.Url;

            if (url != string.Empty)
            {
                RssFeed newFeed = new RssFeed(url);
                RssLinkXML rssLinkXML = new RssLinkXML();
                rssLinkXML.AddLink(newFeed.MainChannel.Title, url);
                ShowDefaultItems();
            }
        }
예제 #3
0
 private void btnOk_Click(object sender, EventArgs e)
 {
     RssLinkXML rssLinkXml = new RssLinkXML();
     rssLinkXml.SaveLinkSet(linkSet);
     this.Close();
 }
예제 #4
0
        private void ShowDefaultItems()
        {
            RssTreeView.Nodes.Clear();

            RssLinkXML rssLinkXml = new RssLinkXML();
            rssLinks = rssLinkXml.GetLinkList();

            foreach (RssLink link in rssLinks)
            {
                if (link.Defaultshow)
                {
                    AddNode(link.Title, link.Uri);
                }
            }
        }