public MenuViewController(ShadowsocksController controller) { this.controller = controller; LoadMenu(); controller.EnableStatusChanged += controller_EnableStatusChanged; controller.ConfigChanged += controller_ConfigChanged; controller.PACFileReadyToOpen += controller_FileReadyToOpen; controller.UserRuleFileReadyToOpen += controller_FileReadyToOpen; controller.ShareOverLANStatusChanged += controller_ShareOverLANStatusChanged; controller.EnableGlobalChanged += controller_EnableGlobalChanged; controller.Errored += controller_Errored; controller.UpdatePACFromGFWListCompleted += controller_UpdatePACFromGFWListCompleted; controller.UpdatePACFromGFWListError += controller_UpdatePACFromGFWListError; _notifyIcon = new NotifyIcon(); UpdateTrayIcon(); _notifyIcon.Visible = true; _notifyIcon.ContextMenu = contextMenu1; _notifyIcon.MouseDoubleClick += notifyIcon1_DoubleClick; this.updateChecker = new UpdateChecker(); updateChecker.NewVersionFound += updateChecker_NewVersionFound; LoadCurrentConfiguration(); updateChecker.CheckUpdate(controller.GetConfigurationCopy()); if (controller.GetConfigurationCopy().isDefault) { _isFirstRun = true; ShowConfigForm(); } }
public LogForm(ShadowsocksController controller, string filename) { this.controller = controller; this.filename = filename; InitializeComponent(); Icon = Icon.FromHandle(Resources.ssw128.GetHicon()); LogViewerConfig config = controller.GetConfigurationCopy().logViewer; if (config == null) { config = new LogViewerConfig(); } else { topMostTrigger = config.topMost; wrapTextTrigger = config.wrapText; toolbarTrigger = config.toolbarShown; LogMessageTextBox.BackColor = config.GetBackgroundColor(); LogMessageTextBox.ForeColor = config.GetTextColor(); LogMessageTextBox.Font = config.GetFont(); } controller.TrafficChanged += controller_TrafficChanged; UpdateTexts(); }
public MenuViewController(ShadowsocksController controller) { this.controller = controller; LoadMenu(); controller.ConfigChanged += controller_ConfigChanged; controller.ShareOverLANStatusChanged += controller_ShareOverLANStatusChanged; controller.Errored += controller_Errored; _notifyIcon = new NotifyIcon(); UpdateTrayIcon(); _notifyIcon.Visible = true; _notifyIcon.ContextMenu = contextMenu1; _notifyIcon.MouseDoubleClick += notifyIcon1_DoubleClick; //this.updateChecker = new UpdateChecker(); //updateChecker.NewVersionFound += updateChecker_NewVersionFound; LoadCurrentConfiguration(); //updateChecker.CheckUpdate(controller.GetConfigurationCopy()); if (controller.GetConfigurationCopy().isDefault) { _isFirstRun = true; ShowConfigForm(); } }
public ServerCrawler(ShadowsocksController controller) { this.controller = controller; configuration = controller.GetConfigurationCopy(); this.serverList = new List<Server>(); foreach (var server in configuration.configs) { if (server.remarks == CRAWLER_REMARKS) { this.serverList.Add(server); } } }
public MenuViewController(ShadowsocksController controller) { this.controller = controller; LoadMenu(); controller.EnableStatusChanged += controller_EnableStatusChanged; controller.ConfigChanged += controller_ConfigChanged; controller.PACFileReadyToOpen += controller_FileReadyToOpen; controller.UserRuleFileReadyToOpen += controller_FileReadyToOpen; controller.ShareOverLANStatusChanged += controller_ShareOverLANStatusChanged; controller.EnableGlobalChanged += controller_EnableGlobalChanged; controller.Errored += controller_Errored; controller.UpdatePACFromGFWListCompleted += controller_UpdatePACFromGFWListCompleted; controller.UpdatePACFromGFWListError += controller_UpdatePACFromGFWListError; _notifyIcon = new NotifyIcon(); UpdateTrayIcon(); _notifyIcon.Visible = true; _notifyIcon.ContextMenu = contextMenu1; _notifyIcon.BalloonTipClicked += notifyIcon1_BalloonTipClicked; _notifyIcon.MouseClick += notifyIcon1_Click; _notifyIcon.MouseDoubleClick += notifyIcon1_DoubleClick; _notifyIcon.BalloonTipClosed += _notifyIcon_BalloonTipClosed; this.updateChecker = new UpdateChecker(); updateChecker.CheckUpdateCompleted += updateChecker_CheckUpdateCompleted; LoadCurrentConfiguration(); Configuration config = controller.GetConfigurationCopy(); if (config.autoCheckUpdate) { _isStartupChecking = true; updateChecker.CheckUpdate(config, 3000); } if (config.isDefault) { _isFirstRun = true; ShowConfigForm(); } }