public MainService(App app, ScreenService screen, ConfigService config, CacheService cache, StatisticService statistic, ThemeService theme) { this.screen = screen; this.config = config; this.cache = cache; this.statistic = statistic; this.theme = theme; app.Exit += new ExitEventHandler(app_Exit); SystemEvents.PowerModeChanged += new PowerModeChangedEventHandler(OnPowerModeChanged); }
public TrayService( App app, MainService mainService, ConfigService config, BackgroundWorkerService backgroundWorker, ThemeService theme) { this.app = app; this.mainService = mainService; this.config = config; this.backgroundWorker = backgroundWorker; this.theme = theme; this.config.Changed += new EventHandler(config_Changed); this.theme.OnChangedTheme += Theme_OnChangedTheme; app.Exit += new ExitEventHandler(app_Exit); mainService.OnLeaveEvent += MainService_OnLeaveEvent; mainService.OnStart += MainService_OnStart;; backgroundWorker.DoWork += BackgroundWorker_DoWork; backgroundWorker.OnCompleted += BackgroundWorker_OnCompleted; notifyIcon = new System.Windows.Forms.NotifyIcon(); }