public MenuViewController(ShadowsocksController controller) { this.controller = controller; LoadMenu(); controller.ToggleModeChanged += controller_ToggleModeChanged; controller.ToggleRuleModeChanged += controller_ToggleRuleModeChanged; controller.ConfigChanged += controller_ConfigChanged; controller.PACFileReadyToOpen += controller_FileReadyToOpen; controller.UserRuleFileReadyToOpen += controller_FileReadyToOpen; controller.Errored += controller_Errored; controller.UpdatePACFromGFWListCompleted += controller_UpdatePACFromGFWListCompleted; controller.UpdatePACFromGFWListError += controller_UpdatePACFromGFWListError; controller.ShowConfigFormEvent += Config_Click; _notifyIcon = new NotifyIcon(); UpdateTrayIcon(); _notifyIcon.Visible = true; _notifyIcon.ContextMenu = contextMenu1; _notifyIcon.MouseClick += notifyIcon1_Click; //_notifyIcon.MouseDoubleClick += notifyIcon1_DoubleClick; updateFreeNodeChecker = new UpdateFreeNode(); updateFreeNodeChecker.NewFreeNodeFound += updateFreeNodeChecker_NewFreeNodeFound; LoadCurrentConfiguration(); Configuration cfg = controller.GetCurrentConfiguration(); if (cfg.isDefaultConfig() || cfg.nodeFeedAutoUpdate) { updateFreeNodeChecker.CheckUpdate(controller.GetCurrentConfiguration(), !cfg.isDefaultConfig()); } }
private void CheckNodeUpdate_Click(object sender, EventArgs e) { updateFreeNodeChecker.CheckUpdate(controller.GetCurrentConfiguration(), true); }