SystemWrapper/SystemInterface/IVersion.cs

128 строки
5.7 KiB
C#
Исходник Постоянная ссылка Обычный вид История

2011-10-31 23:52:25 +04:00
using System;
2011-11-01 00:29:22 +04:00
namespace SystemInterface
2011-10-31 23:52:25 +04:00
{
/// <summary>
/// Wrapper for <see cref="System.Version"/> class.
/// </summary>
2014-11-01 23:47:00 +03:00
public interface IVersion : ICloneable, IComparable, IComparable<IVersion>, IEquatable<IVersion>
2011-10-31 23:52:25 +04:00
{
2014-11-01 22:18:06 +03:00
/// <summary>
/// Initializes a new instance of the <see cref="T:SystemInterface.VersionWrap"/> class.
2014-11-01 22:18:06 +03:00
/// </summary>
void Initialize(Version version);
2011-10-31 23:52:25 +04:00
2014-11-01 22:18:06 +03:00
/// <summary>
/// Initializes a new instance of the <see cref="T:SystemInterface.VersionWrap"/> class.
2014-11-01 22:18:06 +03:00
/// </summary>
void Initialize();
2011-10-31 23:52:25 +04:00
2014-11-01 22:18:06 +03:00
/// <summary>
/// Initializes a new instance of the Version class using the specified string.
/// </summary>
/// <param name="version">A string containing the major, minor, build, and revision numbers, where each number is delimited with a period character ('.').</param>
void Initialize(string version);
2011-10-31 23:52:25 +04:00
2014-11-01 22:18:06 +03:00
/// <summary>
/// Initializes a new instance of the Version class using the specified major and minor values.
2014-11-01 22:18:06 +03:00
/// </summary>
/// <param name="major">The major version number.</param>
/// <param name="minor">The minor version number.</param>
void Initialize(int major, int minor);
2011-10-31 23:52:25 +04:00
2014-11-01 22:18:06 +03:00
/// <summary>
/// Initializes a new instance of the Version class using the specified major and minor values.
2014-11-01 22:18:06 +03:00
/// </summary>
/// <param name="major">The major version number.</param>
/// <param name="minor">The minor version number.</param>
/// <param name="build">The build number.</param>
void Initialize(int major, int minor, int build);
2011-10-31 23:52:25 +04:00
2014-11-01 22:18:06 +03:00
/// <summary>
/// Initializes a new instance of the Version class using the specified major and minor values.
2014-11-01 22:18:06 +03:00
/// </summary>
/// <param name="major">The major version number.</param>
/// <param name="minor">The minor version number.</param>
/// <param name="build">The build number.</param>
/// <param name="revision">The revision number.</param>
void Initialize(int major, int minor, int build, int revision);
2011-10-31 23:52:25 +04:00
// Properties
2014-11-01 23:47:00 +03:00
2011-10-31 23:52:25 +04:00
/// <summary>
/// Gets <see cref="T:System.Version"/> object.
/// </summary>
Version VersionInstance { get; }
2014-11-01 23:47:00 +03:00
2011-10-31 23:52:25 +04:00
/// <summary>
/// Gets the value of the build component of the version number for the current Version object.
/// </summary>
int Build { get; }
2014-11-01 23:47:00 +03:00
2011-10-31 23:52:25 +04:00
/// <summary>
/// Gets the value of the major component of the version number for the current Version object.
2011-10-31 23:52:25 +04:00
/// </summary>
int Major { get; }
2014-11-01 23:47:00 +03:00
2011-10-31 23:52:25 +04:00
/// <summary>
/// Gets the high 16 bits of the revision number.
2011-10-31 23:52:25 +04:00
/// </summary>
short MajorRevision { get; }
2014-11-01 23:47:00 +03:00
2011-10-31 23:52:25 +04:00
/// <summary>
/// Gets the value of the minor component of the version number for the current Version object.
2011-10-31 23:52:25 +04:00
/// </summary>
int Minor { get; }
2014-11-01 23:47:00 +03:00
2011-10-31 23:52:25 +04:00
/// <summary>
/// Gets the low 16 bits of the revision number.
2011-10-31 23:52:25 +04:00
/// </summary>
short MinorRevision { get; }
2014-11-01 23:47:00 +03:00
2011-10-31 23:52:25 +04:00
/// <summary>
/// Gets the value of the revision component of the version number for the current Version object.
/// </summary>
int Revision { get; }
// Methods
/// <summary>
/// Returns a value indicating whether the current Version object is equal to a specified object.
/// </summary>
/// <param name="obj">An object to compare with the current Version object, or nullNothingnullptra null reference (Nothing in Visual Basic).</param>
2014-11-01 23:47:00 +03:00
/// <returns> <c>true</c> if the current Version object and obj are both Version objects, and every component of the current Version object matches the corresponding component of obj; otherwise, <c>false</c>.</returns>
2011-10-31 23:52:25 +04:00
bool Equals(object obj);
2014-11-01 23:47:00 +03:00
2011-10-31 23:52:25 +04:00
/// <summary>
/// Returns a hash code for the current Version object.
2011-10-31 23:52:25 +04:00
/// </summary>
/// <returns>A 32-bit signed integer hash code.</returns>
int GetHashCode();
2014-11-01 23:47:00 +03:00
2011-10-31 23:52:25 +04:00
/// <summary>
/// Converts the value of the current IVersionWrap object to its equivalent String representation.
/// </summary>
/// <returns>
/// The String representation of the values of the major, minor, build, and revision components of the current Version object, as depicted in the following format. Each component is separated by a period character ('.'). Square brackets ('[' and ']') indicate a component that will not appear in the return value if the component is not defined:
2014-11-01 23:47:00 +03:00
/// major.minor[.build[.revision]].
2011-10-31 23:52:25 +04:00
/// </returns>
string ToString();
2014-11-01 23:47:00 +03:00
2011-10-31 23:52:25 +04:00
/// <summary>
/// Converts the value of the current Version object to its equivalent String representation. A specified count indicates the number of components to return.
2011-10-31 23:52:25 +04:00
/// </summary>
/// <param name="fieldCount">The number of components to return. The fieldCount ranges from 0 to 4.</param>
/// <returns>The String representation of the values of the major, minor, build, and revision components of the current Version object, each separated by a period character ('.'). The fieldCount parameter determines how many components are returned.</returns>
string ToString(int fieldCount);
2014-11-01 23:47:00 +03:00
/*
public static bool operator ==(Version v1, Version v2);
public static bool operator >(Version v1, Version v2);
public static bool operator >=(Version v1, Version v2);
public static bool operator !=(Version v1, Version v2);
public static bool operator <(Version v1, Version v2);
public static bool operator <=(Version v1, Version v2);
*/
2011-10-31 23:52:25 +04:00
}
2014-11-01 23:47:00 +03:00
}