/// <summary>
        /// Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes,
        /// follows, or occurs in the same position in the sort order as the other object.
        /// </summary>
        /// <param name="other">An object to compare with this instance.</param>
        /// <returns>A value that indicates the relative order of the objects being compared.</returns>
        public int CompareTo(LatestVersion other)
        {
            int result = AssemblyVersion.CompareTo(other.AssemblyVersion);

            if (result == 0)
            {
                result = FileVersion.CompareTo(other.FileVersion);
            }

            return(result);
        }
Exemplo n.º 2
0
        public bool IsValid()
        {
            if (PacketDataLength != DataBufLen)
            {
                return(false);
            }

            if (FileVersion.CompareTo("1.0.0.1") != 0)    // 当前版本
            {
                return(false);
            }

            if (ActionCode < 1 || ActionCode > ACTIONCODE_MAXVALUE)
            {
                return(false);
            }

            return(true);
        }