1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-10 03:45:41 +00:00

(#14) Perform solution-wide code cleanup

This commit is contained in:
Oliver Booth 2021-07-20 16:46:51 +01:00
parent b81cac03d6
commit ac203dda1f
No known key found for this signature in database
GPG Key ID: A4AC17007530E9B4
12 changed files with 41 additions and 42 deletions

View File

@ -18,8 +18,8 @@ namespace X10D
/// <param name="lower">The exclusive lower bound.</param>
/// <param name="upper">The exclusive upper bound.</param>
/// <returns>
/// <see langword="true" /> if <paramref name="value" /> is between the <paramref name="lower"/> and
/// <paramref name="upper"/>
/// <see langword="true" /> if <paramref name="value" /> is between the <paramref name="lower" /> and
/// <paramref name="upper" />
/// -or-
/// <see langword="false" /> otherwise.
/// </returns>
@ -112,7 +112,7 @@ namespace X10D
/// <returns>
/// <see langword="true" /> if <paramref name="value" /> is greater than <paramref name="other" />
/// -or-
/// <see langword="false"/> otherwise.
/// <see langword="false" /> otherwise.
/// </returns>
/// <example>
/// <code lang="csharp">
@ -144,7 +144,7 @@ namespace X10D
/// <returns>
/// <see langword="true" /> if <paramref name="value" /> is greater than or equal to <paramref name="other" />
/// -or-
/// <see langword="false"/> otherwise.
/// <see langword="false" /> otherwise.
/// </returns>
/// <example>
/// <code lang="csharp">
@ -176,7 +176,7 @@ namespace X10D
/// <returns>
/// <see langword="true" /> if <paramref name="value" /> is less than <paramref name="other" />
/// -or-
/// <see langword="false"/> otherwise.
/// <see langword="false" /> otherwise.
/// </returns>
/// <example>
/// <code lang="csharp">
@ -208,7 +208,7 @@ namespace X10D
/// <returns>
/// <see langword="true" /> if <paramref name="value" /> is less than or equal to <paramref name="other" />
/// -or-
/// <see langword="false"/> otherwise.
/// <see langword="false" /> otherwise.
/// </returns>
/// <example>
/// <code lang="csharp">

View File

@ -54,9 +54,6 @@ namespace X10D
return string.Join(";", list);
}
/// <returns>A <see cref="string" /> representing the dictionary as a <c>key=value;</c> set.</returns>
///
///
/// <summary>
/// Converts an <see cref="IEnumerable{T}" /> of <see cref="KeyValuePair{TKey, TValue}" /> to a HTTP GET parameter
/// string.
@ -64,7 +61,7 @@ namespace X10D
/// <typeparam name="TKey">The key type.</typeparam>
/// <typeparam name="TValue">The value type.</typeparam>
/// <param name="value">The source dictionary.</param>
/// <returns>Returns a <see cref="string" /> representing the dictionary as a key=value& set.</returns>
/// <returns>Returns a <see cref="string" /> representing the dictionary as a key=value&amp; set.</returns>
public static string ToGetParameters<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> value)
{
if (value is null)

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Runtime.CompilerServices;
namespace X10D
@ -124,7 +124,7 @@ namespace X10D
/// </summary>
/// <param name="value">The value to round.</param>
/// <param name="nearest">The nearest multiple to which <paramref name="value" /> should be rounded.</param>
/// <returns><paramref name="value" /> rounded to the nearest multiple of <paramref name="nearest"/>.</returns>
/// <returns><paramref name="value" /> rounded to the nearest multiple of <paramref name="nearest" />.</returns>
public static double Round(this double value, double nearest)
{
return Math.Round(value / nearest) * nearest;

View File

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
namespace X10D

View File

@ -45,6 +45,7 @@ namespace X10D
{
return BitConverter.GetBytes(value);
}
/// <summary>
/// Returns a value indicating whether the current value is evenly divisible by 2.
/// </summary>

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
@ -58,7 +58,7 @@ namespace X10D
}
/// <summary>
/// Returns a random color
/// Returns a random color.
/// </summary>
/// <param name="random"></param>
/// <returns></returns>
@ -212,7 +212,7 @@ namespace X10D
/// <returns>
/// A 64-bit signed integer that is greater than or equal to 0, and less than <paramref name="maxValue" />; that is,
/// the range of return values ordinarily includes 0 but not <paramref name="maxValue" />. However, if
/// <paramref name="maxValue" /> equals 0, <paramref name="maxValue"/> is returned.
/// <paramref name="maxValue" /> equals 0, <paramref name="maxValue" /> is returned.
/// </returns>
/// <remarks><paramref name="maxValue" /> must be greater than or equal to 0.</remarks>
/// <exception cref="ArgumentNullException"><paramref name="random" /> is <see langword="null" />.</exception>

View File

@ -77,7 +77,8 @@ namespace X10D
/// -or-
/// <paramref name="selector" /> is <see langword="null" />.
/// </exception>
public static TReturn? SelectFromCustomAttribute<TAttribute, TReturn>(this MemberInfo member,
public static TReturn? SelectFromCustomAttribute<TAttribute, TReturn>(
this MemberInfo member,
Func<TAttribute, TReturn> selector)
where TAttribute : Attribute
{

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Runtime.CompilerServices;
namespace X10D
@ -124,7 +124,7 @@ namespace X10D
/// </summary>
/// <param name="value">The value to round.</param>
/// <param name="nearest">The nearest multiple to which <paramref name="value" /> should be rounded.</param>
/// <returns><paramref name="value" /> rounded to the nearest multiple of <paramref name="nearest"/>.</returns>
/// <returns><paramref name="value" /> rounded to the nearest multiple of <paramref name="nearest" />.</returns>
public static float Round(this float value, float nearest)
{
return (float)((double)value).Round(nearest);

View File

@ -1,9 +1,9 @@
using System;
using System.IO;
using System.Security.Cryptography;
#if NET5_0
using System.Buffers.Binary;
#endif
using System.IO;
using System.Security.Cryptography;
namespace X10D
{

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -134,14 +134,14 @@ namespace X10D
throw new ArgumentException(Resource.EnumParseEmptyStringException, nameof(value));
}
var t = typeof(T);
var type = typeof(T);
if (!t.IsEnum)
if (!type.IsEnum)
{
throw new ArgumentException(Resource.EnumParseNotEnumException);
}
return (T)Enum.Parse(t, value, ignoreCase);
return (T)Enum.Parse(type, value, ignoreCase);
}
/// <summary>

View File

@ -45,8 +45,8 @@ namespace X10D
{
parsedResult = 0;
return match.Groups[@group].Success
&& double.TryParse(match.Groups[@group].Value, NumberStyles.Number, provider, out parsedResult);
return match.Groups[group].Success
&& double.TryParse(match.Groups[group].Value, NumberStyles.Number, provider, out parsedResult);
}
if (!TryParseAt(1, out var years))