Ejemplo n.º 1
0
        public UpdateHandler(IUpdateCheckClient client, TaskScheduler scheduler)
        {
            this.client    = client;
            this.scheduler = scheduler;

            this.timer = new Timer {
                AutoReset = false,
                Enabled   = false
            };

            this.timer.Elapsed += timer_Elapsed;
        }
Ejemplo n.º 2
0
        public UpdateChecker(IUpdateCheckClient client, TaskScheduler scheduler)
        {
            this.client    = client;
            this.scheduler = scheduler;

            this.timer = new Timer {
                AutoReset = false,
                Enabled   = false
            };

            this.timer.Elapsed += timer_Elapsed;

            this.InteractionManager = new UpdateInteractionManager(this);
        }
Ejemplo n.º 3
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();
        }