Beispiel #1
0
        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();
        }
        public FormNotificationTweet(FormBrowser owner, ITweetDeckInterface tweetDeckInterface, PluginManager pluginManager) : base(owner, (form, browserComponent) => CreateBrowserImpl(browserComponent, new NotificationInterfaceImpl(form), tweetDeckInterface, pluginManager))
        {
            InitializeComponent();

            Config.MuteToggled += Config_MuteToggled;
            WindowsSessionManager.LockStateChanged += WindowsSessionManager_LockStateChanged;

            Disposed += (sender, args) => {
                Config.MuteToggled -= Config_MuteToggled;
                WindowsSessionManager.LockStateChanged -= WindowsSessionManager_LockStateChanged;
            };

            if (Config.MuteNotifications)
            {
                PauseNotification(NotificationPauseReason.UserConfiguration);
            }
        }
 public TweetDeckBridgeObject(ITweetDeckInterface tweetDeckInterface, TweetDeckBrowser browser, TweetDeckExtraContext extraContext) : base(tweetDeckInterface)
 {
     this.i            = tweetDeckInterface;
     this.browser      = browser;
     this.extraContext = extraContext;
 }
Beispiel #4
0
 private static NotificationBrowser CreateBrowserImpl(IBrowserComponent browserComponent, INotificationInterface notificationInterface, ITweetDeckInterface tweetDeckInterface, PluginManager pluginManager)
 {
     return(new NotificationBrowser.Example(browserComponent, notificationInterface, tweetDeckInterface, pluginManager));
 }