示例#1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            _feeds = new Dictionary <string, Dictionary <string, DateTime> >();

            _icon = new NotifyIcon();
            using (Stream s = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("AnAppADay.RSSAlerter.WinApp.Jedi.ico"))
            {
                _icon.Icon = new Icon(s);
            }
            _icon.BalloonTipClicked += new EventHandler(_icon_BalloonTipClicked);
            _icon.Visible            = true;

            MenuItem[] items = new MenuItem[3];
            items[0]        = new MenuItem("Feeds");
            items[0].Click += new EventHandler(Feeds_Click);
            items[1]        = new MenuItem("About");
            items[1].Click += new EventHandler(About_Click);
            items[2]        = new MenuItem("Exit");
            items[2].Click += new EventHandler(Exit_Click);
            ContextMenu menu = new ContextMenu(items);

            _icon.ContextMenu = menu;

            FeedManager.Load();

            //start the balloon thread!
            _thread = new Thread(GoBizatch);
            _thread.Start();

            Application.Run();
        }
示例#2
0
 protected override void OnClosing(CancelEventArgs e)
 {
     lock (FeedManager.feeds)
     {
         FeedManager.feeds.Clear();
         foreach (string feed in listBox1.Items)
         {
             FeedManager.feeds.AddLast(feed);
         }
         FeedManager.Save();
     }
     Hide();
     e.Cancel = true;
 }