Projektdateien hinzufügen.

This commit is contained in:
Kevin Krüger
2023-07-24 12:00:34 +02:00
parent 656751e10b
commit 0d00a90942
210 changed files with 45049 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
namespace VideoBrowser.Extensions
{
using VideoBrowser.Common;
/// <summary>
/// Defines the <see cref="StringExtension" />
/// </summary>
public static class StringExtension
{
#region Properties
/// <summary>
/// Gets the ByteSizeFormatProvider
/// </summary>
private static ByteFormatProvider ByteSizeFormatProvider { get; } = new ByteFormatProvider();
#endregion Properties
#region Methods
/// <summary>
/// Replace dependency property name to property name.
/// </summary>
/// <param name="propertyName">The propertyName<see cref="string"/></param>
/// <returns>The <see cref="string"/></returns>
public static string Name(this string propertyName)
{
var name = propertyName.Replace("Property", string.Empty);
return name;
}
/// <summary>
/// The ToFormatedByte
/// </summary>
/// <param name="byteSize">The byteSize<see cref="int"/></param>
/// <returns>The <see cref="string"/></returns>
public static string ToFormatedByte(int byteSize)
{
var formated = string.Format(ByteSizeFormatProvider, "{0:fs}", byteSize);
return formated;
}
/// <summary>
/// The ToFormatedSpeed
/// </summary>
/// <param name="speed">The speed<see cref="int"/></param>
/// <returns>The <see cref="string"/></returns>
public static string ToFormatedSpeed(int speed)
{
var formated = string.Format(ByteSizeFormatProvider, "{0:s}", speed);
return formated;
}
#endregion Methods
}
}