Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Range<T> XML docs #63

Open
wants to merge 54 commits into
base: main
Choose a base branch
from
Open

Update Range<T> XML docs #63

wants to merge 54 commits into from

Conversation

FreePhoenix888
Copy link
Member

No description provided.

@FreePhoenix888 FreePhoenix888 linked an issue Jul 28, 2021 that may be closed by this pull request
Copy link
Member

@Konard Konard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First part.

csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
Copy link
Member

@Konard Konard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More changes required.

csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
csharp/Platform.Ranges/Range[T].cs Outdated Show resolved Hide resolved
Copy link
Member

@Konard Konard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we also have to change code here at the same time.

/// <para>Returns maximum value of the range.</para>
/// <para>Возвращает максимальное значение диапазона.</para>
/// <para>A read-only field that represents a maximum value of the range.</para>
/// <para>оле для чтения, которое представляет максимальное значение диапазона.</para>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// <para>оле для чтения, которое представляет максимальное значение диапазона.</para>
/// <para>Поле для чтения, которое представляет максимальное значение диапазона.</para>

/// <para>Initializes a new instance of the Range class.</para>
/// <para>Инициализирует новый экземпляр класса Range.</para>
/// <para>Initializes a new instance of the <see cref="Range{T}"/> structure with a single specified value as minimum and maximum values.</para>
/// <para>Инициализирует новый экземпляр структуры <see cref="Range{T}"/> с одним указанным значением в качестве минимального и максимального значений.</para>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// <para>Инициализирует новый экземпляр структуры <see cref="Range{T}"/> с одним указанным значением в качестве минимального и максимального значений.</para>
/// <para>Инициализирует новый экземпляр структуры <see cref="Range{T}"/> с одним значением для <see cref="Minimum"/> и <see cref="Maximum"/>.</para>

/// </summary>
public readonly T Maximum;

/// <summary>
/// <para>Initializes a new instance of the Range class.</para>
/// <para>Инициализирует новый экземпляр класса Range.</para>
/// <para>Initializes a new instance of the <see cref="Range{T}"/> structure with a single specified value as minimum and maximum values.</para>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// <para>Initializes a new instance of the <see cref="Range{T}"/> structure with a single specified value as minimum and maximum values.</para>
/// <para>Initializes a new instance of the <see cref="Range{T}"/> structure with a single value for <see cref="Minimum"/> and <see cref="Maximum"/>.</para>

/// </summary>
/// <param name="minimumAndMaximum"><para>Single value for both Minimum and Maximum fields.</para><para>Одно значение для полей Minimum и Maximum.</para></param>
/// <param name="minimumAndMaximum">
/// <para>A single value for the both <see cref="Minimum"/> and <see cref="Maximum"/>.</para>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// <para>A single value for the both <see cref="Minimum"/> and <see cref="Maximum"/>.</para>
/// <para>A single value for <see cref="Minimum"/> and <see cref="Maximum"/>.</para>

@@ -43,12 +46,21 @@ public Range(T minimumAndMaximum)
}

/// <summary>
/// <para>Initializes a new instance of the Range class.</para>
/// <para>Инициализирует новый экземпляр класса Range.</para>
/// <para>Initializes a new instance of the <see cref="Range{T}"/> structure with the specified minimum and maximum values.</para>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// <para>Initializes a new instance of the <see cref="Range{T}"/> structure with the specified minimum and maximum values.</para>
/// <para>Initializes a new instance of the <see cref="Range{T}"/> structure using specified <paramref name="minimum"/> and <paramref name="maximum"/>.</para>

/// <para>Значение для проверки его присутствия в структуре <see cref="Range{T}"/>.</para>
/// </param>
/// <returns>
/// <para>A <see cref="Boolean"/> value that determines whether the <see cref="Range{T}"/> struct contains the <paramref name="value"/>.</para>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// <para>A <see cref="Boolean"/> value that determines whether the <see cref="Range{T}"/> struct contains the <paramref name="value"/>.</para>
/// <para>A <see cref="Boolean"/> value that determines whether this <see cref="Range{T}"/> instance includes the <paramref name="value"/>.</para>

/// <returns>
/// <para>A <see cref="Boolean"/> value that determines whether the <see cref="Range{T}"/> struct contains the <paramref name="value"/>.</para>
/// <para>Значение типа <see cref="Boolean"/>, определяющее, содержится ли <paramref name="value"/> в структуре <see cref="Range{T}"/>.</para>
/// </returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Contains(T value) => _comparer.Compare(Minimum, value) <= 0 && _comparer.Compare(Maximum, value) >= 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public bool Contains(T value) => _comparer.Compare(Minimum, value) <= 0 && _comparer.Compare(Maximum, value) >= 0;
public bool Includes(T value) => _comparer.Compare(Minimum, value) <= 0 && _comparer.Compare(Maximum, value) >= 0;

Note: this a breaking change. We should also ensure to use include instead of contain for Ranges everywhere. This is because word include is used with Range much more frequently.

/// </param>
/// <returns>
/// <para>A <see cref="Boolean"/> value that determines whether the <see cref="Range{T}"/> struct contains the <paramref name="value"/>.</para>
/// <para>Значение типа <see cref="Boolean"/>, определяющее, содержится ли <paramref name="value"/> в структуре <see cref="Range{T}"/>.</para>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// <para>Значение типа <see cref="Boolean"/>, определяющее, содержится ли <paramref name="value"/> в структуре <see cref="Range{T}"/>.</para>
/// <para>Значение типа <see cref="Boolean"/>, определяющее, включено ли <paramref name="value"/> в этот экземпляр <see cref="Range{T}"/>.</para>

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override string ToString() => $"[{Minimum}..{Maximum}]";

/// <summary>
/// <para>Determines if the provided value is inside the range.</para>
/// <para>Определяет, находится ли указанное значение внутри диапазона.</para>
/// <para>Determines whether the current <see cref="Range{T}"/> struct contains the <paramref name="value"/>.</para>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// <para>Determines whether the current <see cref="Range{T}"/> struct contains the <paramref name="value"/>.</para>
/// <para>Determines whether this <see cref="Range{T}"/> instance includes <paramref name="value"/>.</para>

/// <para>Determines if the provided value is inside the range.</para>
/// <para>Определяет, находится ли указанное значение внутри диапазона.</para>
/// <para>Determines whether the current <see cref="Range{T}"/> struct contains the <paramref name="value"/>.</para>
/// <para>Определяет, содержится ли <paramref name="value"/> в текущей структуре <see cref="Range{T}"/>.</para>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// <para>Определяет, содержится ли <paramref name="value"/> в текущей структуре <see cref="Range{T}"/>.</para>
/// <para>Определяет, включено ли <paramref name="value"/> в этот экземпляр <see cref="Range{T}"/>.</para>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

upgrade comments of class constructors
3 participants