Search Results for

    Show / Hide Table of Contents

    Class AlmostVersion

    A type that wraps Hive.Versioning.Version so that the string of the version is stored when the string is not a valid Hive.Versioning.Version.

    Inheritance
    System.Object
    AlmostVersion
    Implements
    System.IComparable<AlmostVersion>
    System.IComparable<Hive.Versioning.Version>
    System.IComparable<Version>
    Inherited Members
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: IPA.Utilities
    Assembly: IPA.Loader.dll
    Syntax
    public class AlmostVersion : IComparable<AlmostVersion>, IComparable<Version>, IComparable<Version>

    Constructors

    | Improve this Doc View Source

    AlmostVersion(Version)

    Creates an AlmostVersion from the Hive.Versioning.Version provided in ver.

    Declaration
    public AlmostVersion(Version ver)
    Parameters
    Type Name Description
    Hive.Versioning.Version ver

    the Hive.Versioning.Version to store

    | Improve this Doc View Source

    AlmostVersion(Version)

    Creates an AlmostVersion from the Version provided in ver.

    Declaration
    [Obsolete("Use Hive.Versioning.Version constructor instead.")]
    public AlmostVersion(Version ver)
    Parameters
    Type Name Description
    Version ver

    the Version to store

    | Improve this Doc View Source

    AlmostVersion(String)

    Creates a new AlmostVersion with the version string provided in vertext.

    Declaration
    public AlmostVersion(string vertext)
    Parameters
    Type Name Description
    System.String vertext

    the version string to store

    | Improve this Doc View Source

    AlmostVersion(String, AlmostVersion)

    Creates a new AlmostVersion from the version string in vertext stored the same way as the AlmostVersion passed in copyMode.

    Declaration
    public AlmostVersion(string vertext, AlmostVersion copyMode)
    Parameters
    Type Name Description
    System.String vertext

    the text to parse as an AlmostVersion

    AlmostVersion copyMode

    an AlmostVersion to copy the storage mode of

    | Improve this Doc View Source

    AlmostVersion(String, AlmostVersion.StoredAs)

    Creates an AlmostVersion from the version string in vertext stored using the storage mode specified in mode.

    Declaration
    public AlmostVersion(string vertext, AlmostVersion.StoredAs mode)
    Parameters
    Type Name Description
    System.String vertext

    the text to parse as an AlmostVersion

    AlmostVersion.StoredAs mode

    the storage mode to store the version in

    Properties

    | Improve this Doc View Source

    SemverValue

    The value of the AlmostVersion if it was stored as a Hive.Versioning.Version.

    Declaration
    public Version SemverValue { get; }
    Property Value
    Type Description
    Hive.Versioning.Version

    the stored value as a Hive.Versioning.Version, or null if not stored as a version.

    | Improve this Doc View Source

    StorageMode

    The way the value is stored, whether it be as a Hive.Versioning.Version or a System.String.

    Declaration
    public AlmostVersion.StoredAs StorageMode { get; }
    Property Value
    Type Description
    AlmostVersion.StoredAs

    the storage mode used to store this value

    | Improve this Doc View Source

    StringValue

    The value of the AlmostVersion if it was stored as a System.String.

    Declaration
    public string StringValue { get; }
    Property Value
    Type Description
    System.String

    the stored value as a System.String, or null if not stored as a string.

    Methods

    | Improve this Doc View Source

    CompareTo(Version)

    Compares langword_csharp_this to the Hive.Versioning.Version in other using Hive.Versioning.Version.CompareTo(Hive.Versioning.Version).

    Declaration
    public int CompareTo(Version other)
    Parameters
    Type Name Description
    Hive.Versioning.Version other

    the Hive.Versioning.Version to compare to

    Returns
    Type Description
    System.Int32

    less than 0 if other is considered bigger than langword_csharp_this, 0 if equal, and greater than zero if smaller

    Remarks

    The storage method of langword_csharp_this must be SemVer, else an System.InvalidOperationException will be thrown.

    See Also
    CompareTo(AlmostVersion)
    | Improve this Doc View Source

    CompareTo(AlmostVersion)

    Compares langword_csharp_this to the AlmostVersion in other using Hive.Versioning.Version.CompareTo(Hive.Versioning.Version) or System.String.CompareTo(System.String), depending on the current store.

    Declaration
    public int CompareTo(AlmostVersion other)
    Parameters
    Type Name Description
    AlmostVersion other

    the AlmostVersion to compare to

    Returns
    Type Description
    System.Int32

    less than 0 if other is considered bigger than langword_csharp_this, 0 if equal, and greater than zero if smaller

    Remarks

    The storage methods of the two objects must be the same, or this will throw an System.InvalidOperationException.

    See Also
    CompareTo(Version)
    | Improve this Doc View Source

    CompareTo(Version)

    Compares langword_csharp_this to the Version in other using Hive.Versioning.Version.CompareTo(Hive.Versioning.Version).

    Declaration
    [Obsolete("Use the Hive.Versioning.Version overload instead.")]
    public int CompareTo(Version other)
    Parameters
    Type Name Description
    Version other

    the Version to compare to

    Returns
    Type Description
    System.Int32

    less than 0 if other is considered bigger than langword_csharp_this, 0 if equal, and greater than zero if smaller

    Remarks

    The storage method of langword_csharp_this must be SemVer, else an System.InvalidOperationException will be thrown.

    See Also
    CompareTo(AlmostVersion)
    | Improve this Doc View Source

    Equals(Object)

    Performs a strict equality check between langword_csharp_this and obj.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj

    the object to compare to

    Returns
    Type Description
    System.Boolean

    true if they are equal, false otherwise

    Overrides
    System.Object.Equals(System.Object)
    Remarks

    This may return false where Equality(AlmostVersion, AlmostVersion) returns true

    See Also
    System.Object.Equals(System.Object)
    | Improve this Doc View Source

    GetHashCode()

    Default generated hash code function generated by VS.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32

    a value unique to each object, except those that are considered equal by Equals(Object)

    Overrides
    System.Object.GetHashCode()
    See Also
    System.Object.GetHashCode()
    | Improve this Doc View Source

    ToString()

    Gets a string representation of the current version. If the value is stored as a string, this returns it. If it is stored as a Hive.Versioning.Version, it is equivalent to calling Hive.Versioning.Version.ToString.

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    a string representation of the current version

    Overrides
    System.Object.ToString()
    See Also
    System.Object.ToString()

    Operators

    | Improve this Doc View Source

    Equality(AlmostVersion, AlmostVersion)

    Compares two versions, only taking into account the numeric part of the version if they are stored as Hive.Versioning.Versions, or strict equality if they are stored as System.Strings.

    Declaration
    public static bool operator ==(AlmostVersion l, AlmostVersion r)
    Parameters
    Type Name Description
    AlmostVersion l

    the first value to compare

    AlmostVersion r

    the second value to compare

    Returns
    Type Description
    System.Boolean

    true if they are mostly equal, false otherwise

    Remarks

    This is a looser equality than Equals(Object), meaning that this may return true where Equals(Object) does not.

    See Also
    Equals(Object)
    | Improve this Doc View Source

    GreaterThan(AlmostVersion, AlmostVersion)

    Declaration
    public static bool operator>(AlmostVersion left, AlmostVersion right)
    Parameters
    Type Name Description
    AlmostVersion left
    AlmostVersion right
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    GreaterThanOrEqual(AlmostVersion, AlmostVersion)

    Declaration
    public static bool operator >=(AlmostVersion left, AlmostVersion right)
    Parameters
    Type Name Description
    AlmostVersion left
    AlmostVersion right
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Implicit(Version to AlmostVersion)

    Implicitly converts a Version to AlmostVersion using AlmostVersion(Version).

    Declaration
    public static implicit operator AlmostVersion(Version ver)
    Parameters
    Type Name Description
    Hive.Versioning.Version ver

    the Version to convert

    Returns
    Type Description
    AlmostVersion
    See Also
    AlmostVersion(Version)
    | Improve this Doc View Source

    Implicit(AlmostVersion to Version)

    Implicitly converts an AlmostVersion to Version, if applicable, using SemverValue. If not applicable, returns null

    Declaration
    public static implicit operator Version(AlmostVersion av)
    Parameters
    Type Name Description
    AlmostVersion av

    the AlmostVersion to convert to a Version

    Returns
    Type Description
    Hive.Versioning.Version
    See Also
    SemverValue
    | Improve this Doc View Source

    Implicit(AlmostVersion to Version)

    Implicitly converts an AlmostVersion to Version, if applicable, using SemverValue. If not applicable, returns null

    Declaration
    [Obsolete("Use Hive.Versioning.Version instead of SemVer.Version")]
    public static implicit operator Version(AlmostVersion av)
    Parameters
    Type Name Description
    AlmostVersion av

    the AlmostVersion to convert to a Version

    Returns
    Type Description
    Version
    See Also
    SemverValue
    | Improve this Doc View Source

    Implicit(Version to AlmostVersion)

    Implicitly converts a Version to AlmostVersion using AlmostVersion(Version).

    Declaration
    [Obsolete("Use Hive.Versioning.Version instead of SemVer.Version")]
    public static implicit operator AlmostVersion(Version ver)
    Parameters
    Type Name Description
    Version ver

    the Version to convert

    Returns
    Type Description
    AlmostVersion
    See Also
    AlmostVersion(Version)
    | Improve this Doc View Source

    Inequality(AlmostVersion, AlmostVersion)

    The opposite of Equality(AlmostVersion, AlmostVersion). Equivalent to !(l == r).

    Declaration
    public static bool operator !=(AlmostVersion l, AlmostVersion r)
    Parameters
    Type Name Description
    AlmostVersion l

    the first value to compare

    AlmostVersion r

    the second value to compare

    Returns
    Type Description
    System.Boolean

    true if they are not mostly equal, false otherwise

    See Also
    Equality(AlmostVersion, AlmostVersion)
    | Improve this Doc View Source

    LessThan(AlmostVersion, AlmostVersion)

    Declaration
    public static bool operator <(AlmostVersion left, AlmostVersion right)
    Parameters
    Type Name Description
    AlmostVersion left
    AlmostVersion right
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    LessThanOrEqual(AlmostVersion, AlmostVersion)

    Declaration
    public static bool operator <=(AlmostVersion left, AlmostVersion right)
    Parameters
    Type Name Description
    AlmostVersion left
    AlmostVersion right
    Returns
    Type Description
    System.Boolean

    Implements

    System.IComparable<T>
    System.IComparable<T>
    System.IComparable<T>

    Extension Methods

    ReflectionUtil.SetField<T, U>(T, String, U)
    ReflectionUtil.GetField<U, T>(T, String)
    ReflectionUtil.SetProperty<T, U>(T, String, U)
    ReflectionUtil.GetProperty<U, T>(T, String)
    ReflectionUtil.InvokeMethod<U, T>(T, String, Object[])
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX