public MonitorManager(MonitorConfiguration mc)
 {
     foreach (var iterate in mc.GetItems())
     {
         FolderMonitor fm = new FolderMonitor(iterate.MonitorPath, iterate.Filter);
         fm.FileEvent += fm_FileEvent;
         fm.Start();
     }
 }
Esempio n. 2
0
        private void frmConfiguration_Load(object sender, EventArgs e)
        {
            NotificationMenu = new ContextMenuStrip();
            var configureitem = NotificationMenu.Items.Add("Configure...");
            var exitItem      = NotificationMenu.Items.Add("Exit");

            configureitem.Click += configureitem_Click;
            exitItem.Click      += exitItem_Click;
            ni                  = new NotifyIcon();
            ni.Site             = this.Site;
            ni.Icon             = this.Icon;
            ni.Text             = "BASeCamp Folder Monitor";
            ni.Visible          = true;
            ni.ContextMenuStrip = NotificationMenu;

            config = MonitorConfiguration.Static;
            RestartMonitor();
            RepopulateList();
            Hide();
        }