mirror of https://github.com/oliverbooth/X10D
(#14) Perform solution-wide code cleanup
This commit is contained in:
parent
b81cac03d6
commit
ac203dda1f
|
@ -54,9 +54,6 @@ namespace X10D
|
||||||
return string.Join(";", list);
|
return string.Join(";", list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <returns>A <see cref="string" /> representing the dictionary as a <c>key=value;</c> set.</returns>
|
|
||||||
///
|
|
||||||
///
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Converts an <see cref="IEnumerable{T}" /> of <see cref="KeyValuePair{TKey, TValue}" /> to a HTTP GET parameter
|
/// Converts an <see cref="IEnumerable{T}" /> of <see cref="KeyValuePair{TKey, TValue}" /> to a HTTP GET parameter
|
||||||
/// string.
|
/// string.
|
||||||
|
@ -64,7 +61,7 @@ namespace X10D
|
||||||
/// <typeparam name="TKey">The key type.</typeparam>
|
/// <typeparam name="TKey">The key type.</typeparam>
|
||||||
/// <typeparam name="TValue">The value type.</typeparam>
|
/// <typeparam name="TValue">The value type.</typeparam>
|
||||||
/// <param name="value">The source dictionary.</param>
|
/// <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& set.</returns>
|
||||||
public static string ToGetParameters<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> value)
|
public static string ToGetParameters<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> value)
|
||||||
{
|
{
|
||||||
if (value is null)
|
if (value is null)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
namespace X10D
|
namespace X10D
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace X10D
|
namespace X10D
|
||||||
|
|
|
@ -45,6 +45,7 @@ namespace X10D
|
||||||
{
|
{
|
||||||
return BitConverter.GetBytes(value);
|
return BitConverter.GetBytes(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a value indicating whether the current value is evenly divisible by 2.
|
/// Returns a value indicating whether the current value is evenly divisible by 2.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
@ -58,7 +58,7 @@ namespace X10D
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a random color
|
/// Returns a random color.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="random"></param>
|
/// <param name="random"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
|
|
@ -77,7 +77,8 @@ namespace X10D
|
||||||
/// -or-
|
/// -or-
|
||||||
/// <paramref name="selector" /> is <see langword="null" />.
|
/// <paramref name="selector" /> is <see langword="null" />.
|
||||||
/// </exception>
|
/// </exception>
|
||||||
public static TReturn? SelectFromCustomAttribute<TAttribute, TReturn>(this MemberInfo member,
|
public static TReturn? SelectFromCustomAttribute<TAttribute, TReturn>(
|
||||||
|
this MemberInfo member,
|
||||||
Func<TAttribute, TReturn> selector)
|
Func<TAttribute, TReturn> selector)
|
||||||
where TAttribute : Attribute
|
where TAttribute : Attribute
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
namespace X10D
|
namespace X10D
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Security.Cryptography;
|
||||||
#if NET5_0
|
#if NET5_0
|
||||||
using System.Buffers.Binary;
|
using System.Buffers.Binary;
|
||||||
#endif
|
#endif
|
||||||
using System.IO;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
|
|
||||||
namespace X10D
|
namespace X10D
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
@ -134,14 +134,14 @@ namespace X10D
|
||||||
throw new ArgumentException(Resource.EnumParseEmptyStringException, nameof(value));
|
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);
|
throw new ArgumentException(Resource.EnumParseNotEnumException);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (T)Enum.Parse(t, value, ignoreCase);
|
return (T)Enum.Parse(type, value, ignoreCase);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -45,8 +45,8 @@ namespace X10D
|
||||||
{
|
{
|
||||||
parsedResult = 0;
|
parsedResult = 0;
|
||||||
|
|
||||||
return match.Groups[@group].Success
|
return match.Groups[group].Success
|
||||||
&& double.TryParse(match.Groups[@group].Value, NumberStyles.Number, provider, out parsedResult);
|
&& double.TryParse(match.Groups[group].Value, NumberStyles.Number, provider, out parsedResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!TryParseAt(1, out var years))
|
if (!TryParseAt(1, out var years))
|
||||||
|
|
Loading…
Reference in New Issue