Example #1
0
        /// <summary>
        /// See interface docs.
        /// </summary>
        /// <returns></returns>
        public bool CheckForNewVersion()
        {
            var result = false;

            var content = Provider.DownloadFileContent("http://www.virtualradarserver.co.uk/LatestVersion.txt");

            if (!String.IsNullOrEmpty(content))
            {
                var applicationInfo = Factory.Resolve <IApplicationInformation>();
                var thisVersion     = applicationInfo.Version;
                if (applicationInfo.IsBeta)
                {
                    thisVersion = new Version(applicationInfo.BetaBasedOnFullVersion);
                }

                result = VersionComparer.Compare(content, thisVersion) > 0;

                IsNewVersionAvailable = result;
                if (result)
                {
                    OnNewVersionAvailable(EventArgs.Empty);
                }
            }

            return(result);
        }
Example #2
0
        private bool CompareManifestVersions(string manifestVersion, Version applicationVersion, string dllFileName, bool isMinimum)
        {
            var result = false;

            try {
                var comparison = VersionComparer.Compare(manifestVersion, applicationVersion);
                result = isMinimum ? comparison <= 0 : comparison >= 0;
                if (!result)
                {
                    IgnoredPlugins.Add(
                        dllFileName,
                        isMinimum
                            ? String.Format(Strings.PluginMinimumVersionNotMet, manifestVersion)
                            : String.Format(Strings.PluginMaximumVersionNotMet, manifestVersion)
                        );
                }
            } catch {
                IgnoredPlugins.Add(
                    dllFileName,
                    isMinimum
                        ? Strings.PluginMinumumVersionUnparseable
                        : Strings.PluginMaximumVersionUnparseable
                    );
            }

            return(result);
        }
Example #3
0
        /// <summary>
        /// See interface docs.
        /// </summary>
        /// <returns></returns>
        public bool CheckForNewVersion()
        {
            bool result = false;

            string content = Provider.DownloadFileContent("http://www.virtualradarserver.co.uk/LatestVersion.txt");

            if (!String.IsNullOrEmpty(content))
            {
                Version thisVersion = Factory.Singleton.Resolve <IApplicationInformation>().Version;
                result = VersionComparer.Compare(content, thisVersion) > 0;

                IsNewVersionAvailable = result;
                if (result)
                {
                    OnNewVersionAvailable(EventArgs.Empty);
                }
            }

            return(result);
        }