|
54 | 54 | </Attribute>
|
55 | 55 | </Attributes>
|
56 | 56 | <Docs>
|
57 |
| - <summary>Represent a type can be used to index a collection either from the start or the end.</summary> |
| 57 | + <summary>Represents a type that can be used to index a collection either from the beginning or the end.</summary> |
58 | 58 | <remarks>
|
59 |
| - Index is used by the C# compiler to support the new index syntax |
60 |
| - <code> |
61 |
| - int[] someArray = new int[5] { 1, 2, 3, 4, 5 } ; |
62 |
| - int lastElement = someArray[^1]; // lastElement = 5 |
63 |
| - </code></remarks> |
| 59 | + <format type="text/markdown"><: |
| 64 | +
|
| 65 | +```csharp |
| 66 | +int[] someArray = new int[5] { 1, 2, 3, 4, 5 }; |
| 67 | +int lastElement = someArray[^1]; // lastElement = 5 |
| 68 | +``` |
| 69 | +
|
| 70 | + ]]></format> |
| 71 | + </remarks> |
64 | 72 | </Docs>
|
65 | 73 | <Members>
|
66 | 74 | <Member MemberName=".ctor">
|
|
97 | 105 | <Parameter Name="fromEnd" Type="System.Boolean" />
|
98 | 106 | </Parameters>
|
99 | 107 | <Docs>
|
100 |
| - <param name="value">The index value. it has to be zero or positive number.</param> |
101 |
| - <param name="fromEnd">Indicating if the index is from the start or from the end.</param> |
102 |
| - <summary>Construct an Index using a value and indicating if the index is from the start or from the end.</summary> |
| 108 | + <param name="value">The index value. It has to be greater then or equal to zero.</param> |
| 109 | + <param name="fromEnd"> |
| 110 | + <see langword="true" /> to index from the end of the collection, or <see langword="false" /> to index from the beginning of the collection.</param> |
| 111 | + <summary>Initializes a new <see cref="T:System.Index" /> with a specified index position and a value that indicates if the index is from the beginning or the end of a collection.</summary> |
103 | 112 | <remarks>
|
104 |
| - If the Index constructed from the end, index value 1 means pointing at the last element and index value 0 means pointing at beyond last element. |
105 |
| - </remarks> |
| 113 | + <format type="text/markdown"><![CDATA[ |
| 114 | +
|
| 115 | +## Remarks |
| 116 | +
|
| 117 | +If the <xref:System.Index> is constructed from the end, an index value of 1 points to the last element, and an index value of 0 points beyond the last element. |
| 118 | +
|
| 119 | + ]]></format> |
| 120 | + </remarks> |
106 | 121 | </Docs>
|
107 | 122 | </Member>
|
108 | 123 | <Member MemberName="End">
|
|
139 | 154 | <ReturnType>System.Index</ReturnType>
|
140 | 155 | </ReturnValue>
|
141 | 156 | <Docs>
|
142 |
| - <summary>Create an Index pointing at beyond last element.</summary> |
| 157 | + <summary>Gets an <see cref="T:System.Index" /> that points beyond the last element.</summary> |
143 | 158 | <value>An index that points beyond the last element.</value>
|
144 | 159 | <remarks>To be added.</remarks>
|
145 | 160 | </Docs>
|
|
184 | 199 | <Parameter Name="other" Type="System.Index" />
|
185 | 200 | </Parameters>
|
186 | 201 | <Docs>
|
187 |
| - <param name="other">An object to compare with this object</param> |
188 |
| - <summary>Indicates whether the current Index object is equal to another Index object.</summary> |
| 202 | + <param name="other">The object to compare with this instance.</param> |
| 203 | + <summary>Returns a value that indicates whether the current object is equal to another <see cref="T:System.Index" /> object.</summary> |
189 | 204 | <returns>
|
190 | 205 | <see langword="true" /> if the current Index object is equal to <paramref name="other" />; <see langword="false" /> otherwise.</returns>
|
191 | 206 | <remarks>To be added.</remarks>
|
|
236 | 251 | </Parameter>
|
237 | 252 | </Parameters>
|
238 | 253 | <Docs>
|
239 |
| - <param name="value">An object to compare with this object</param> |
240 |
| - <summary>Indicates whether the current Index object is equal to another object of the same type.</summary> |
| 254 | + <param name="value">An object to compare with this instance.</param> |
| 255 | + <summary>Indicates whether the current Index object is equal to a specified object.</summary> |
241 | 256 | <returns>
|
242 | 257 | <see langword="true" /> if <paramref name="value" /> is of type <see cref="T:System.Index" /> and is equal to the current instance; <see langword="false" /> otherwise.</returns>
|
243 | 258 | <remarks>To be added.</remarks>
|
|
280 | 295 | <Parameter Name="value" Type="System.Int32" />
|
281 | 296 | </Parameters>
|
282 | 297 | <Docs>
|
283 |
| - <param name="value">The index value from the end.</param> |
284 |
| - <summary>Create an Index from the end at the position indicated by the value.</summary> |
| 298 | + <param name="value">The index value from the end of a collection.</param> |
| 299 | + <summary>Creates an <see cref="T:System.Index" /> from the end of a collection at a specified index position.</summary> |
285 | 300 | <returns>The index value.</returns>
|
286 | 301 | <remarks>To be added.</remarks>
|
287 | 302 | </Docs>
|
|
323 | 338 | <Parameter Name="value" Type="System.Int32" />
|
324 | 339 | </Parameters>
|
325 | 340 | <Docs>
|
326 |
| - <param name="value">The index value from the start.</param> |
327 |
| - <summary>Create an Index from the start at the position indicated by the value.</summary> |
| 341 | + <param name="value">The index position from the start of a collection.</param> |
| 342 | + <summary>Creates an <see cref="T:System.Index" /> from the specified index at the start of a collection.</summary> |
328 | 343 | <returns>The index value.</returns>
|
329 | 344 | <remarks>To be added.</remarks>
|
330 | 345 | </Docs>
|
|
406 | 421 | <Parameter Name="length" Type="System.Int32" />
|
407 | 422 | </Parameters>
|
408 | 423 | <Docs>
|
409 |
| - <param name="length">The length of the collection that the Index will be used with. length has to be a positive value</param> |
410 |
| - <summary>Calculate the offset from the start using the giving collection length.</summary> |
| 424 | + <param name="length">The length of the collection that the Index will be used with. Must be a positive value.</param> |
| 425 | + <summary>Calculates the offset from the start of the collection using the specified collection length.</summary> |
411 | 426 | <returns>The offset.</returns>
|
412 | 427 | <remarks>
|
413 |
| - For performance reason, we don't validate the input length parameter and the returned offset value against negative values. |
414 |
| - we don't validate either the returned offset is greater than the input length. |
415 |
| - It is expected Index will be used with collections which always have non negative length/count. If the returned offset is negative and |
416 |
| - then used to index a collection will get out of range exception which will be same affect as the validation. |
417 |
| - </remarks> |
| 428 | + <format type="text/markdown"><![CDATA[ |
| 429 | +
|
| 430 | +## Remarks |
| 431 | +
|
| 432 | +For performance reasons, this method does not validate if `length` or the returned value are negative. It also doesn't validate if the returned value is greater than `length`. |
| 433 | +
|
| 434 | +Collections are not expected to have a negative length/count. If this method's returned offset is negative and is then used to index a collection, the runtime will throw <xref:System.ArgumentOutOfRangeException>, which will have the same effect as validation. |
| 435 | +
|
| 436 | + ]]></format> |
| 437 | + </remarks> |
418 | 438 | </Docs>
|
419 | 439 | </Member>
|
420 | 440 | <Member MemberName="IsFromEnd">
|
|
451 | 471 | <ReturnType>System.Boolean</ReturnType>
|
452 | 472 | </ReturnValue>
|
453 | 473 | <Docs>
|
454 |
| - <summary>Indicates whether the index is from the start or the end.</summary> |
| 474 | + <summary>Gets a value that indicates whether the index is from the start or the end.</summary> |
455 | 475 | <value>
|
456 | 476 | <see langword="true" /> if the Index is from the end; otherwise, <see langword="false" />.</value>
|
457 | 477 | <remarks>To be added.</remarks>
|
|
495 | 515 | </Parameters>
|
496 | 516 | <Docs>
|
497 | 517 | <param name="value">The integer to convert.</param>
|
498 |
| - <summary>Converts integer number to an Index.</summary> |
| 518 | + <summary>Converts an integer number to an <see cref="T:System.Index" />.</summary> |
499 | 519 | <returns>An index representing the integer.</returns>
|
500 | 520 | <remarks>To be added.</remarks>
|
501 | 521 | </Docs>
|
|
534 | 554 | <ReturnType>System.Index</ReturnType>
|
535 | 555 | </ReturnValue>
|
536 | 556 | <Docs>
|
537 |
| - <summary>Create an Index pointing at first element.</summary> |
| 557 | + <summary>Gets an <see cref="T:System.Index" /> that points to the first element of a collection.</summary> |
538 | 558 | <value>An instance that points to the first element of a collection.</value>
|
539 | 559 | <remarks>To be added.</remarks>
|
540 | 560 | </Docs>
|
|
574 | 594 | </ReturnValue>
|
575 | 595 | <Parameters />
|
576 | 596 | <Docs>
|
577 |
| - <summary>Converts the value of the current Index object to its equivalent string representation.</summary> |
| 597 | + <summary>Returns the string representation of the current <see cref="T:System.Index" /> instance.</summary> |
578 | 598 | <returns>The string representation of the <see cref="T:System.Index" />.</returns>
|
579 | 599 | <remarks>To be added.</remarks>
|
580 | 600 | </Docs>
|
|
613 | 633 | <ReturnType>System.Int32</ReturnType>
|
614 | 634 | </ReturnValue>
|
615 | 635 | <Docs>
|
616 |
| - <summary>Returns the index value.</summary> |
| 636 | + <summary>Gets the index value.</summary> |
617 | 637 | <value>The index value.</value>
|
618 | 638 | <remarks>To be added.</remarks>
|
619 | 639 | </Docs>
|
|
0 commit comments