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