Esempio n. 1
0
        private bool DisplayUpdateForm(bool force = false)
        {
            var playerNeedUpdate    = Settings.MpdnVersionOnServer > m_CurrentVersion;
            var extensionNeedUpdate = Settings.ExtensionVersionOnServer > ExtensionUpdateChecker.GetExtensionsVersion();

            var displayForm = new Func <bool>(() => Settings.UseSimpleUpdate
                ? DisplaySimpleForm(force, playerNeedUpdate, extensionNeedUpdate)
                : DisplayAdvancedForm(force, playerNeedUpdate, extensionNeedUpdate));

            //Check API Version match when both updates available
            if (playerNeedUpdate && extensionNeedUpdate &&
                Settings.MpdnVersionOnServer.ExtensionApiVersion ==
                Settings.ExtensionVersionOnServer.ExtensionApiVersion)
            {
                return(displayForm.Invoke());
            }
            //Update player if the update is going to break the extensions.
            if (playerNeedUpdate && Settings.MpdnVersionOnServer.ExtensionApiVersion == Extension.InterfaceVersion)
            {
                return(displayForm.Invoke());
            }
            //Update the extension if the new extensions aren't going to work with the current player.
            if (extensionNeedUpdate &&
                Settings.ExtensionVersionOnServer.ExtensionApiVersion == Extension.InterfaceVersion)
            {
                return(displayForm.Invoke());
            }
            return(false);
        }
Esempio n. 2
0
        public static void SetHeaders(WebClient client)
        {
            var version = ExtensionUpdateChecker.GetExtensionsVersion();

            client.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));
        }
Esempio n. 3
0
        private bool DisplayUpdateForm(bool force = false)
        {
            var playerNeedUpdate    = Settings.MpdnVersionOnServer > m_CurrentVersion;
            var extensionNeedUpdate = Settings.ExtensionVersionOnServer > ExtensionUpdateChecker.GetExtensionsVersion();

            return(Settings.UseSimpleUpdate
                ? DisplaySimpleForm(force, playerNeedUpdate, extensionNeedUpdate)
                : DisplayAdvancedForm(force, playerNeedUpdate, extensionNeedUpdate));
        }