1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-22 13:48:47 +00:00

💄Reformat files

This commit is contained in:
Oliver Booth 2019-11-16 01:57:59 +00:00
parent e537b9c727
commit a01ef63ab0
No known key found for this signature in database
GPG Key ID: 4B0992B2602C3778
7 changed files with 13 additions and 11 deletions

View File

@ -24,7 +24,7 @@
actual.CompareTo(lower) > 0 && actual.CompareTo(upper) < 0;
/// <summary>
/// Gets the value
/// Gets the value
/// </summary>
/// <param name="value"></param>
/// <returns></returns>

View File

@ -18,7 +18,7 @@
/// <param name="obj">The object to convert.</param>
/// <returns>Returns the value converted to <see cref="T"/>.</returns>
public static T To<T>(this IConvertible obj) =>
(T) Convert.ChangeType(obj, typeof(T));
(T)Convert.ChangeType(obj, typeof(T));
/// <summary>
/// Converts the object to another type, returning the default value on failure.

View File

@ -21,7 +21,7 @@
/// </summary>
/// <param name="dateOfBirth">The date of birth.</param>
public static int Age(this DateTime dateOfBirth) =>
(int) (((DateTime.Today - TimeSpan.FromDays(1) - dateOfBirth.Date).TotalDays + 1) / 365.2425);
(int)(((DateTime.Today - TimeSpan.FromDays(1) - dateOfBirth.Date).TotalDays + 1) / 365.2425);
/// <summary>
/// Gets a DateTime representing the first specified day in the current month
@ -147,7 +147,7 @@
public static long ToUnixTimeStamp(this DateTime time, bool useMillis = false)
{
TimeSpan difference = time - UnixEpoch;
return (long) (useMillis ? difference.TotalMilliseconds : difference.TotalSeconds);
return (long)(useMillis ? difference.TotalMilliseconds : difference.TotalSeconds);
}
/// <summary>

View File

@ -12,6 +12,7 @@
public static class Int16Extensions
{
#region TimeSpan Returns
// TODO change
public static TimeSpan Days(this ushort number) =>
@ -85,7 +86,7 @@
/// <returns>Returns a <see cref="DateTime"/> representing <paramref name="timestamp"/> seconds since the Unix
/// epoch.</returns>
public static DateTime FromUnixTimestamp(this short timestamp, bool isMillis = false) =>
((long) timestamp).FromUnixTimestamp(isMillis);
((long)timestamp).FromUnixTimestamp(isMillis);
/// <summary>
/// Converts the <see cref="UInt16"/> to a <see cref="Byte"/>[].
@ -103,7 +104,6 @@
public static byte[] GetBytes(this short number) =>
BitConverter.GetBytes(number);
/// <summary>
/// Determines if the <see cref="Int16"/> is a prime number.
/// </summary>
@ -111,7 +111,7 @@
/// <returns>Returns <see langword="true"/> if <paramref name="number"/> is prime, <see langword="false"/>
/// otherwise.</returns>
public static bool IsPrime(this short number) =>
((long) number).IsPrime();
((long)number).IsPrime();
/// <summary>
/// Gets an boolean value that represents this integer.
@ -131,4 +131,4 @@
public static bool ToBoolean(this ushort value) =>
value != 0;
}
}
}

View File

@ -12,6 +12,7 @@
public static class Int32Extensions
{
#region TimeSpan Returns
// TODO change
public static TimeSpan Days(this uint number) =>

View File

@ -12,6 +12,7 @@
public static class Int64Extensions
{
#region TimeSpan Returns
// TODO change
public static TimeSpan Days(this ulong number) =>
@ -123,7 +124,7 @@
return false;
}
long boundary = (long) Math.Floor(Math.Sqrt(number));
long boundary = (long)Math.Floor(Math.Sqrt(number));
for (int i = 3; i <= boundary; i += 2)
{
if (number % i == 0)
@ -131,7 +132,7 @@
return false;
}
}
return true;
}

View File

@ -68,7 +68,7 @@
throw new ArgumentException("Type provided must be an Enum.", "T");
}
return (T) Enum.Parse(t, value, ignoreCase);
return (T)Enum.Parse(t, value, ignoreCase);
}
/// <summary>