Commit 7c8be298 authored by Brickner_cp's avatar Brickner_cp

Fixed documentation

parent 1328e773
......@@ -46,19 +46,6 @@ namespace PcapDotNet.Base.Test
//
#endregion
[TestMethod]
public void ParseTest()
{
// Random random = new Random();
// for (int i = 0; i != 100; ++i)
// {
// UInt48 expected = (UInt48)random.NextLong(UInt48.MaxValue + 1);
// UInt48 actual = UInt48.Parse(expected.ToString(), NumberStyles.Integer, CultureInfo.InvariantCulture);
//
// Assert.AreEqual(expected, actual);
// }
}
[TestMethod]
public void UInt128Test()
{
......
......@@ -51,10 +51,10 @@ namespace PcapDotNet.Base
/// However, the negative sign symbol can be used only with zero; otherwise, the method throws an <see cref="OverflowException"/>.
/// </description>
/// </item>
/// <item><term>digits</term><description>A sequence of digits ranging from 0 to 9. Any leading zeros are ignored.</description></item>
/// <item><term>digits</term><description>A sequence of digits from 0 through 9. Any leading zeros are ignored.</description></item>
/// </list>
/// <note>
/// The string specified by the <paramref name="value"/> parameter is interpreted by using the <see cref="NumberStyles.Integer"/> style.
/// The <paramref name="value"/> parameter is interpreted using the <see cref="NumberStyles.Integer"/> style.
/// It cannot contain any group separators or decimal separator, and it cannot have a decimal portion.
/// </note>
/// The <paramref name="value"/> parameter is parsed by using the formatting information in a <see cref="NumberFormatInfo"/> object that is initialized for the current system culture.
......@@ -67,7 +67,7 @@ namespace PcapDotNet.Base
}
/// <summary>
/// Converts the string representation of a number in a specified culture-specific format to its 64-bit unsigned integer equivalent.
/// Converts the string representation of a number in a specified culture-specific format to its 48-bit unsigned integer equivalent.
/// </summary>
/// <param name="value">A string that represents the number to convert.</param>
/// <param name="provider">An object that supplies culture-specific formatting information about <paramref name="value"/>.</param>
......@@ -83,8 +83,8 @@ namespace PcapDotNet.Base
/// <para>The <paramref name="value"/> parameter contains a number of the form:</para>
/// <para>[ws][sign]digits[ws]</para>
/// <para>
/// Items in square brackets ([ and ]) are optional.
/// The following table describes each element.
/// Elements in square brackets ([ and ]) are optional.
/// The following table describes each element:
/// </para>
/// <list type="table">
/// <listheader>
......@@ -119,7 +119,7 @@ namespace PcapDotNet.Base
}
/// <summary>
/// Converts the string representation of a number in a specified style to its 64-bit unsigned integer equivalent.
/// Converts the string representation of a number in a specified style to its 48-bit unsigned integer equivalent.
/// </summary>
/// <param name="value">
/// A string that represents the number to convert.
......@@ -184,8 +184,8 @@ namespace PcapDotNet.Base
/// </description>
/// </item>
/// <item>
/// <term>digits<para>fractional_digits</para><para>exponential_digits</para></term>
/// <description>A sequence of digits from 0 through 9. For fractional_digits, only the digit 0 is valid.</description>
/// <term>digits</term>
/// <description>A sequence of digits from 0 through 9.</description>
/// </item>
/// <item>
/// <term>.</term>
......@@ -201,6 +201,14 @@ namespace PcapDotNet.Base
/// The current culture's group separator can appear in <paramref name="value"/> if <paramref name="style"/> includes the <see cref="NumberStyles.AllowThousands"/> flag.</description>
/// </item>
/// <item>
/// <term>fractional_digits</term>
/// <description>
/// One or more occurrences of the digit 0-9 if <paramref name="style"/> includes the <see cref="NumberStyles.AllowExponent"/> flag,
/// or one or more occurrences of the digit 0 if it does not.
/// Fractional digits can appear in <paramref name="value"/> only if <paramref name="style"/> includes the <see cref="NumberStyles.AllowDecimalPoint"/> flag.
/// </description>
/// </item>
/// <item>
/// <term>E</term>
/// <description>
/// The "e" or "E" character, which indicates that the value is represented in exponential (scientific) notation.
......@@ -208,8 +216,11 @@ namespace PcapDotNet.Base
/// </description>
/// </item>
/// <item>
/// <term>hexdigits</term>
/// <description>A sequence of hexadecimal digits from 0 through f, or 0 through F.</description>
/// <term>exponential_digits</term>
/// <description>
/// A sequence of digits from 0 through 9.
/// The <paramref name="value"/> parameter can represent a number in exponential notation if <paramref name="style"/> includes the <see cref="NumberStyles.AllowExponent"/> flag.
/// </description>
/// </item>
/// <item><term>hexdigits</term><description>A sequence of hexadecimal digits from 0 through f, or 0 through F.</description></item>
/// </list>
......@@ -222,7 +233,7 @@ namespace PcapDotNet.Base
/// <description>Elements permitted in <paramref name="value"/> in addition to digits</description>
/// </listheader>
/// <item><term><see cref="NumberStyles.None"/></term><description>The digits element only.</description></item>
/// <item><term><see cref="NumberStyles.AllowDecimalPoint"/></term><description>The decimal point (.) and fractional-digits elements.</description></item>
/// <item><term><see cref="NumberStyles.AllowDecimalPoint"/></term><description>The decimal point (.) and fractional_digits elements. However, if <paramref name="style"/> does not include the <see cref="NumberStyles.AllowExponent"/> flag, fractional_digits must consist of only one or more 0 digits; otherwise, an <see cref="OverflowException"/> is thrown.</description></item>
/// <item><term><see cref="NumberStyles.AllowExponent"/></term><description>The "e" or "E" character, which indicates exponential notation, along with exponential_digits.</description></item>
/// <item><term><see cref="NumberStyles.AllowLeadingWhite"/></term><description>The ws element at the start of <paramref name="value"/>.</description></item>
/// <item><term><see cref="NumberStyles.AllowTrailingWhite"/></term><description>The ws element at the end of <paramref name="value"/>.</description></item>
......@@ -278,13 +289,13 @@ namespace PcapDotNet.Base
/// <para><paramref name="value"/> includes non-zero, fractional digits.</para>
/// </exception>
/// <remarks>
/// The <paramref name="style"/> parameter defines the style elements (such as white space or the positive or negative sign symbol) that are allowed in the s parameter for the parse operation to succeed.
/// The <paramref name="style"/> parameter defines the style elements (such as white space, the positive or negative sign symbol, the group separator symbol, or the decimal point symbol) that are allowed in the s parameter for the parse operation to succeed.
/// It must be a combination of bit flags from the <see cref="NumberStyles"/> enumeration.
/// <para>Depending on the value of style, the <paramref name="value"/> parameter may include the following elements:</para>
/// <para>[ws][$][sign]digits[.fractional_digits][E[sign]exponential_digits][ws]</para>
/// <para>[ws][$][sign][digits,]digits[.fractional_digits][E[sign]exponential_digits][ws]</para>
/// <para>
/// Elements in square brackets ([ and ]) are optional.
/// If <paramref name="style"/> includes <see cref="NumberStyles.AllowHexSpecifier"/>, the <paramref name="value"/> parameter may include the following elements:
/// If <paramref name="style"/> includes <see cref="NumberStyles.AllowHexSpecifier"/>, the <paramref name="value"/> parameter may contain the following elements:
/// </para>
/// <para>[ws]hexdigits[ws]</para>
/// <para>The following table describes each element.</para>
......@@ -297,7 +308,7 @@ namespace PcapDotNet.Base
/// <term>ws</term>
/// <description>
/// Optional white space.
/// White space can appear at the beginning of <paramref name="value"/> if <paramref name="style"/> includes the <see cref="NumberStyles.AllowLeadingWhite"/> flag,
/// White space can appear at the start of <paramref name="value"/> if <paramref name="style"/> includes the <see cref="NumberStyles.AllowLeadingWhite"/> flag,
/// and it can appear at the end of <paramref name="style"/> if <paramref name="style"/> includes the <see cref="NumberStyles.AllowTrailingWhite"/> flag.
/// </description>
/// </item>
......@@ -305,7 +316,7 @@ namespace PcapDotNet.Base
/// <term>$</term>
/// <description>
/// A culture-specific currency symbol.
/// Its position in the string is defined by the <see cref="NumberFormatInfo.CurrencyPositivePattern"/> property of the <see cref="NumberFormatInfo"/> object that is returned by the <see cref="IFormatProvider.GetFormat"/> method of the provider parameter.
/// Its position in the string is defined by the <see cref="NumberFormatInfo.CurrencyNegativePattern"/> and <see cref="NumberFormatInfo.CurrencyPositivePattern"/> properties of the <see cref="NumberFormatInfo"/> object that is returned by the <see cref="IFormatProvider.GetFormat"/> method of the provider parameter.
/// The currency symbol can appear in <paramref name="value"/> if <paramref name="style"/> includes the <see cref="NumberStyles.AllowCurrencySymbol"/> flag.
/// </description>
/// </item>
......@@ -313,9 +324,9 @@ namespace PcapDotNet.Base
/// <term>sign</term>
/// <description>
/// An optional sign.
/// (The method throws an <see cref="OverflowException"/> if <paramref name="value"/> includes a negative sign and represents a non-zero number.)
/// The sign can appear at the beginning of <paramref name="value"/> if <paramref name="style"/> includes the <see cref="NumberStyles.AllowLeadingSign"/> flag, and it can appear the end of <paramref name="value"/> if <paramref name="style"/> includes the <see cref="NumberStyles.AllowTrailingSign"/> flag.
/// The sign can appear at the start of <paramref name="value"/> if <paramref name="style"/> includes the <see cref="NumberStyles.AllowLeadingSign"/> flag, and it can appear at the end of <paramref name="value"/> if <paramref name="style"/> includes the <see cref="NumberStyles.AllowTrailingSign"/> flag.
/// Parentheses can be used in <paramref name="value"/> to indicate a negative value if <paramref name="style"/> includes the <see cref="NumberStyles.AllowParentheses"/> flag.
/// However, the negative sign symbol can be used only with zero; otherwise, the method throws an <see cref="OverflowException"/>.
/// </description>
/// </item>
/// <item><term>digits</term><description>A sequence of digits from 0 through 9.</description></item>
......@@ -327,6 +338,12 @@ namespace PcapDotNet.Base
/// </description>
/// </item>
/// <item>
/// <term>,</term>
/// <description>
/// A culture-specific group separator symbol.
/// The current culture's group separator can appear in <paramref name="value"/> if <paramref name="style"/> includes the <see cref="NumberStyles.AllowThousands"/> flag.</description>
/// </item>
/// <item>
/// <term>fractional_digits</term>
/// <description>
/// One or more occurrences of the digit 0-9 if <paramref name="style"/> includes the <see cref="NumberStyles.AllowExponent"/> flag,
......@@ -355,26 +372,31 @@ namespace PcapDotNet.Base
/// The following table indicates how individual <see cref="NumberStyles"/> members affect the elements that may be present in <paramref name="value"/>.
/// <list type="table">
/// <listheader>
/// <term>Non-composite <see cref="NumberStyles"/> values</term>
/// <term><see cref="NumberStyles"/> value</term>
/// <description>Elements permitted in <paramref name="value"/> in addition to digits</description>
/// </listheader>
/// <item><term><see cref="NumberStyles.None"/></term><description>Decimal digits only.</description></item>
/// <item><term><see cref="NumberStyles.None"/></term><description>The digits element only.</description></item>
/// <item><term><see cref="NumberStyles.AllowDecimalPoint"/></term><description>The decimal point (.) and fractional_digits elements. However, if <paramref name="style"/> does not include the <see cref="NumberStyles.AllowExponent"/> flag, fractional_digits must consist of only one or more 0 digits; otherwise, an <see cref="OverflowException"/> is thrown.</description></item>
/// <item><term><see cref="NumberStyles.AllowExponent"/></term><description>The "e" or "E" character, which indicates exponential notation, along with exponential_digits.</description></item>
/// <item><term><see cref="NumberStyles.AllowLeadingWhite"/></term><description>The ws element at the beginning of <paramref name="value"/>.</description></item>
/// <item><term><see cref="NumberStyles.AllowLeadingWhite"/></term><description>The ws element at the start of <paramref name="value"/>.</description></item>
/// <item><term><see cref="NumberStyles.AllowTrailingWhite"/></term><description>The ws element at the end of <paramref name="value"/>.</description></item>
/// <item><term><see cref="NumberStyles.AllowLeadingSign"/></term><description>A sign before digits.</description></item>
/// <item><term><see cref="NumberStyles.AllowTrailingSign"/></term><description>A sign after digits.</description></item>
/// <item><term><see cref="NumberStyles.AllowParentheses"/></term><description>Parentheses before and after digits to indicate a negative value.</description></item>
/// <item><term><see cref="NumberStyles.AllowLeadingSign"/></term><description>The sign element at the start of <paramref name="value"/>.</description></item>
/// <item><term><see cref="NumberStyles.AllowTrailingSign"/></term><description>The sign element at the end of <paramref name="value"/>.</description></item>
/// <item><term><see cref="NumberStyles.AllowParentheses"/></term><description>The sign element in the form of parentheses enclosing the numeric value.</description></item>
/// <item><term><see cref="NumberStyles.AllowThousands"/></term><description>The group separator (,) element. </description></item>
/// <item><term><see cref="NumberStyles.AllowCurrencySymbol"/></term><description>The currency ($) element.</description></item>
/// <item><term><see cref="NumberStyles.Currency"/></term><description>All elements. However, <paramref name="value"/> cannot represent a hexadecimal number or a number in exponential notation.</description></item>
/// <item><term><see cref="NumberStyles.Float"/></term><description>The ws element at the start or end of <paramref name="value"/>, sign at the start of <paramref name="value"/>, and the decimal point (.) symbol. The <paramref name="value"/> parameter can also use exponential notation.</description></item>
/// <item><term><see cref="NumberStyles.Number"/></term><description>The ws, sign, group separator (,), and decimal point (.) elements.</description></item>
/// <item><term><see cref="NumberStyles.Any"/></term><description>All elements. However, <paramref name="value"/> cannot represent a hexadecimal number.</description></item>
/// </list>
/// If the <see cref="NumberStyles.AllowHexSpecifier"/> flag is used, <paramref name="value"/> must be a hexadecimal value.
/// The only other flags that can be combined with it are <see cref="NumberStyles.AllowLeadingWhite"/> and <see cref="NumberStyles.AllowTrailingWhite"/>.
/// Unlike the other <see cref="NumberStyles"/> values, which allow for, but do not require, the presence of particular style elements in <paramref name="value"/>, the <see cref="NumberStyles.AllowHexSpecifier"/> style value means that the individual numeric characters in <paramref name="value"/> are always interpreted as hexadecimal characters.
/// Valid hexadecimal characters are 0-9, A-F, and a-f.
/// The only other flags that can be combined with the <paramref name="style"/> parameter are <see cref="NumberStyles.AllowLeadingWhite"/> and <see cref="NumberStyles.AllowTrailingWhite"/>.
/// (The <see cref="NumberStyles"/> enumeration includes a composite number style, <see cref="NumberStyles.HexNumber"/>, that includes both white-space flags.)
/// <note>
/// If the <paramref name="value"/> parameter is the string representation of a hexadecimal number, it cannot be preceded by any decoration (such as 0x or &amp;h) that differentiates it as a hexadecimal number.
/// This causes the parse operation to throw an exception.
/// If <paramref name="value"/> is the string representation of a hexadecimal number, it cannot be preceded by any decoration (such as 0x or &amp;h) that differentiates it as a hexadecimal number.
/// This causes the conversion to fail.
/// </note>
/// The <paramref name="provider"/> parameter is an <see cref="IFormatProvider"/> implementation whose <see cref="IFormatProvider.GetFormat"/> method returns a <see cref="NumberFormatInfo"/> object that provides culture-specific information about the format of <paramref name="value"/>.
/// There are three ways to use the <paramref name="provider"/> parameter to supply custom formatting information to the parse operation:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment