//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); } }
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; }
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; }
//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); } }
//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(); } }
//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(); }
private void SaveTrayIcons(XmlWriter w) { IconManager.SaveIcons(w); }
private void btnAddIcon_Click(object sender, EventArgs e) { IconManager.AddIcon("New Icon", "{iconname}", null, Color.Black, Color.White); populateIconsList(); }