public FormBrowser(PluginSchemeFactory pluginScheme) { InitializeComponent(); Text = Program.BrandName; this.plugins = new PluginManager(Program.Config.Plugins, Program.PluginPath, Program.PluginDataPath); this.plugins.Reloaded += plugins_Reloaded; this.plugins.Executed += plugins_Executed; this.plugins.Reload(); pluginScheme.Setup(plugins); this.notification = new FormNotificationTweet(this, plugins); this.notification.Show(); this.updates = new UpdateHandler(new UpdateCheckClient(Program.InstallerPath), TaskScheduler.FromCurrentSynchronizationContext()); this.updates.CheckFinished += updates_CheckFinished; this.updateBridge = new UpdateBridge(updates, this); this.updateBridge.UpdateAccepted += updateBridge_UpdateAccepted; this.updateBridge.UpdateDismissed += updateBridge_UpdateDismissed; this.browser = new TweetDeckBrowser(this, plugins, new TweetDeckBridge.Browser(this, notification), updateBridge); this.contextMenu = ContextMenuBrowser.CreateMenu(this); Controls.Add(new MenuStrip { Visible = false }); // fixes Alt freezing the program in Win 10 Anniversary Update Disposed += (sender, args) => { Config.MuteToggled -= Config_MuteToggled; Config.TrayBehaviorChanged -= Config_TrayBehaviorChanged; browser.Dispose(); }; Config.MuteToggled += Config_MuteToggled; this.trayIcon.ClickRestore += trayIcon_ClickRestore; this.trayIcon.ClickClose += trayIcon_ClickClose; Config.TrayBehaviorChanged += Config_TrayBehaviorChanged; UpdateTray(); if (Config.MuteNotifications) { UpdateFormIcon(); } if (Config.AllowDataCollection) { analytics = new AnalyticsManager(this, plugins, Program.AnalyticsFilePath); } RestoreWindow(); }
public FormBrowser(ResourceCache resourceCache, PluginManager pluginManager, IUpdateCheckClient updateCheckClient, uint windowRestoreMessage) { InitializeComponent(); Text = Program.BrandName; this.resourceCache = resourceCache; this.plugins = pluginManager; this.tweetDeckInterface = new TweetDeckInterfaceImpl(this); this.notification = new FormNotificationTweet(this, tweetDeckInterface, plugins); this.notification.Show(); this.updates = new UpdateChecker(updateCheckClient, TaskScheduler.FromCurrentSynchronizationContext()); this.updates.InteractionManager.UpdateAccepted += updateInteractionManager_UpdateAccepted; this.updates.InteractionManager.UpdateDismissed += updateInteractionManager_UpdateDismissed; this.browser = new TweetDeckBrowser(this, plugins, tweetDeckInterface, updates); this.contextMenu = ContextMenuBrowser.CreateMenu(this); this.windowRestoreMessage = windowRestoreMessage; Controls.Add(new MenuStrip { Visible = false }); // fixes Alt freezing the program in Win 10 Anniversary Update Config.MuteToggled += Config_MuteToggled; Config.TrayBehaviorChanged += Config_TrayBehaviorChanged; Disposed += (sender, args) => { Config.MuteToggled -= Config_MuteToggled; Config.TrayBehaviorChanged -= Config_TrayBehaviorChanged; browser.Dispose(); }; this.trayIcon.ClickRestore += trayIcon_ClickRestore; this.trayIcon.ClickClose += trayIcon_ClickClose; UpdateTray(); if (Config.MuteNotifications) { UpdateFormIcon(); } RestoreWindow(); }