FormMain.cs
资源名称:MobileRss.rar [点击查看]
上传用户:xtyqhl
上传日期:2022-06-07
资源大小:212k
文件大小:4k
源码类别:
Windows Mobile
开发平台:
Windows_Unix
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- namespace _3ESoft.WindowsMobile.RSS
- {
- public partial class FormMain : Form
- {
- public FormMain()
- {
- InitializeComponent();
- }
- private void miQuit_Click(object sender, EventArgs e)
- {
- Application.Exit();
- }
- private void miAbout_Click(object sender, EventArgs e)
- {
- new FormAbout().ShowDialog();
- }
- private void miOpen_Click(object sender, EventArgs e)
- {
- if (((RssTreeNode)tvRss.SelectedNode).Opml.Type == RssType.Rss)
- {
- Application.DoEvents();
- new FormRssList(((RssTreeNode)tvRss.SelectedNode).Opml).ShowDialog();
- }
- }
- private void miAddChannel_Click(object sender, EventArgs e)
- {
- new FormChannel(RssType.Channel, true).ShowDialog();
- OpmlHelper.ReadOpmlToTreeView(tvRss);
- }
- private void tvRss_AfterSelect(object sender, TreeViewEventArgs e)
- {
- if (e.Node.Parent != null)
- return;
- tvRss.CollapseAll();
- if (e.Node.IsExpanded)
- e.Node.Collapse();
- else
- e.Node.Expand();
- }
- private void tvRss_AfterCollapse(object sender, TreeViewEventArgs e)
- {
- e.Node.ImageIndex = 0;
- }
- private void tvRss_AfterExpand(object sender, TreeViewEventArgs e)
- {
- e.Node.ImageIndex = 1;
- }
- private void miRssAdd_Click(object sender, EventArgs e)
- {
- Application.DoEvents();
- new FormChannel(RssType.Rss, true).ShowDialog();
- OpmlHelper.ReadOpmlToTreeView(tvRss);
- }
- private void miChannelDel_Click(object sender, EventArgs e)
- {
- if (OpmlHelper.ChannelDel(tvRss.SelectedNode.Text))
- tvRss.SelectedNode.Remove();
- else
- MessageBox.Show("删除目录时出错,以后再试!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
- }
- private void miRssClear_Click(object sender, EventArgs e)
- {
- Application.DoEvents();
- if (OpmlHelper.RSSClear(tvRss.SelectedNode.Text, ((RssTreeNode)tvRss.SelectedNode).Opml))
- { }
- else
- MessageBox.Show("清除内容时出错,以后再试!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
- }
- private void miRssDel_Click(object sender, EventArgs e)
- {
- Application.DoEvents();
- if (OpmlHelper.RSSDel(tvRss.SelectedNode.Parent.Text, (((RssTreeNode)tvRss.SelectedNode).Opml)))
- tvRss.SelectedNode.Remove();
- else
- MessageBox.Show("删除RSS时出错,以后再试!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
- }
- private void FormMain_Load(object sender, EventArgs e)
- {
- if (new FormLogin().ShowDialog() != DialogResult.OK)
- {
- Application.Exit();
- }
- Cursor.Current = Cursors.WaitCursor;
- Cursor.Show();
- Application.DoEvents();
- OpmlHelper.ReadOpmlToTreeView(tvRss);
- Cursor.Current = Cursors.Default;
- }
- private void miUpdate_Click(object sender, EventArgs e)
- {
- new FormUpdateRss(((RssTreeNode)tvRss.SelectedNode).Opml).ShowDialog();
- }
- }
- }