示例#1
0
 //Fired when the update download is finished.
 private void DownloadUpdateReturn(Updater.DownloadUpdateResult result)
 {
     updater.DownloadUpdateFinished -= DownloadUpdateReturn;
     if (result.Success)
     {
         Program.updateRunFileList = result.RunFiles;
         Program.updateRestart     = true;
         Program.updateLoopRunning = false;
     }
     else
     {
         IconManager.ShowBalloonPopup(Application.ProductName, result.Message, ToolTipIcon.Info);
     }
 }
示例#2
0
        private void btnMoveIconDown_Click(object sender, EventArgs e)
        {
            Int32 thisIndex = listIcons.SelectedIndex;

            if (thisIndex == -1)
            {
                return;
            }
            if (thisIndex == listIcons.Items.Count - 1)
            {
                return;
            }
            IconManager.MoveIconDown(listIcons.SelectedIndex);
            populateIconsList();
            listIcons.SelectedIndex = thisIndex + 1;
        }
示例#3
0
        private void btnMoveIconUp_Click(object sender, EventArgs e)
        {
            Int32 thisIndex = listIcons.SelectedIndex;

            if (thisIndex == -1)
            {
                return;
            }
            if (thisIndex == 0)
            {
                return;
            }
            IconManager.MoveIconUp(listIcons.SelectedIndex);
            populateIconsList();
            listIcons.SelectedIndex = thisIndex - 1;
        }
示例#4
0
        //Fires when an update check has finished.
        private void UpdateCheckReturn(Updater.UpdateCheckResult result)
        {
            updater.UpdateCheckFinished -= UpdateCheckReturn;
            if (!result.UpdateAvailable)
            {
                return;
            }

            if (Globals.AutoUpdate)
            {
                IconManager.ShowBalloonPopup(Application.ProductName, "Downloading update: " + result.LatestVersion.ToString(), ToolTipIcon.Info);
                DownloadUpdate(result.UpdateFileListUrl);
            }
            else
            {
                IconManager.ShowBalloonPopup(Application.ProductName, "Update available: " + result.LatestVersion.ToString(), ToolTipIcon.Info);
            }
        }
示例#5
0
 //Checks if we need to check for updates.
 public void CheckForUpdatesIfNeeded()
 {
     if (afterUpdate)
     {
         IconManager.ShowBalloonPopup(Application.ProductName, "Successfully updated to version " + Application.ProductVersion + ".", ToolTipIcon.Info);
         afterUpdate = false;
         if (Common.GetRunningOnStartup())
         {
             Common.SetRunningOnStartup(false);
             Common.SetRunningOnStartup(true);
         }
     }
     if (Globals.UpdateCheckTime == 0)
     {
         return;
     }
     if (_lastUpdateCheckTick + Globals.UpdateCheckTime < Environment.TickCount)
     {
         UpdateCheck();
     }
 }
示例#6
0
 //Main update loop.
 private static void UpdateLoop()
 {
     while (updateLoopRunning)
     {
         Boolean sleeping = false;
         if (Globals.FullscreenSleep)
         {
             sleeping = fullScreenCheck.FullScreenProgramRunning;
         }
         DataManager.UpdateValues();
         IconManager.UpdateIcons(sleeping);
         updateHelper.CheckForUpdatesIfNeeded();
         if (sleeping)
         {
             Thread.Sleep(Globals.SleepTime);
         }
         else
         {
             Thread.Sleep(Globals.IconUpdateRate);
         }
     }
     Application.Exit();
 }
示例#7
0
 private void SaveTrayIcons(XmlWriter w)
 {
     IconManager.SaveIcons(w);
 }
示例#8
0
 private void btnAddIcon_Click(object sender, EventArgs e)
 {
     IconManager.AddIcon("New Icon", "{iconname}", null, Color.Black, Color.White);
     populateIconsList();
 }