예제 #1
0
        public static void OnVersionUpdate(string version)
        {
            // update version
            if (OnlineVersion != version)
            {
                OnlineVersion = version;
            }
            if (OnlineVersion == null)
            {
                return;
            }

            // check if the online version is greater than current
            var programVersion = new Version(Application.ProductVersion);
            var onlineVersion  = new Version(OnlineVersion);
            var ret            = programVersion.CompareTo(onlineVersion);

            // not sure why BetaAlphaPostfixString is being checked
            if (ret < 0 || (ret == 0 && BetaAlphaPostfixString != ""))
            {
                var displayNewVer = string.Format(Translations.Tr("IMPORTANT! New version v{0} has\r\nbeen released. Click here to download it."), version);
                // display new version
                // notify all components
                DisplayVersion?.Invoke(null, displayNewVer);
            }
        }
예제 #2
0
 public override int GetHashCode()
 {
     return(DisplayName.GetHashCode()
            & DisplayVersion.GetHashCode()
            & UninstallString.to_string().GetHashCode()
            & KeyPath.GetHashCode());
 }
예제 #3
0
 public override int GetHashCode()
 {
     unchecked             // Overflow is fine, just wrap
     {
         int hash = 17;
         // Suitable nullity checks etc, of course :)
         hash = hash * 23 + DisplayName.GetHashCode();
         hash = hash * 23 + Publisher.GetHashCode();
         hash = hash * 23 + DisplayVersion.GetHashCode();
         return(hash);
     }
 }
예제 #4
0
        bool IEquatable <RegistryApplicationKey> .Equals(RegistryApplicationKey other)
        {
            if (ReferenceEquals(other, null))
            {
                return(false);
            }

            return(DisplayName.to_string().is_equal_to(other.DisplayName) &&
                   DisplayVersion.is_equal_to(other.DisplayVersion) &&
                   UninstallString.to_string().is_equal_to(other.UninstallString.to_string()) &&
                   KeyPath.is_equal_to(other.KeyPath)
                   );
        }