private void ManualUpdateCheck() { var newVersion = false; using (new HourGlass()) { m_checker.CheckVersion(); m_extChecker.CheckVersion(); } if (Settings.MpdnVersionOnServer > m_currentVersion) { new UpdateCheckerNewVersionForm(Settings.MpdnVersionOnServer, Settings).ShowDialog(PlayerControl.VideoPanel); newVersion = true; } if (Settings.ExtensionVersionOnServer > ExtensionUpdateChecker.GetExtensionsVersion()) { new UpdateCheckerNewExtensionForm(Settings.ExtensionVersionOnServer, Settings).ShowDialog( PlayerControl.VideoPanel); newVersion = true; } if (!newVersion) { MessageBox.Show(PlayerControl.VideoPanel, "You have the latest release."); } }
protected void SetHeaders() { var version = ExtensionUpdateChecker.GetExtensionsVersion(); m_WebClient.Headers.Add("User-Agent", string.Format( "Mozilla/5.0 (compatible; Windows NT {0}; MPDN/{1}; MPDN_Extensions/{2}; +http://mpdn.zachsaw.com/)", Environment.OSVersion.Version, Application.ProductVersion, version)); }
private void PlayerControl_PlayerLoaded(object sender, EventArgs e) { if (!Settings.CheckForUpdate) { return; } m_currentVersion = new UpdateChecker.Version(Application.ProductVersion); if (!Settings.ForgetMpdnVersion && Settings.MpdnVersionOnServer > m_currentVersion) { new UpdateCheckerNewVersionForm(Settings.MpdnVersionOnServer, Settings).ShowDialog(PlayerControl.VideoPanel); } if (!Settings.ForgetExtensionVersion && Settings.ExtensionVersionOnServer > ExtensionUpdateChecker.GetExtensionsVersion()) { new UpdateCheckerNewExtensionForm(Settings.ExtensionVersionOnServer, Settings).ShowDialog( PlayerControl.VideoPanel); } m_checker.CheckVersionAsync(); m_extChecker.CheckVersionAsync(); }