This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Dependency { | |
private static Dependency _instance; | |
public static Dependency Instance => _instance ?? (_instance = new Dependency()); | |
private ConcurrentDictionary<Type, Object> _store = new ConcurrentDictionary<Type, object>(); | |
public Dependency() { | |
_store = new ConcurrentDictionary<Type, object>(); | |
} | |
public void Register<T>(Object obj) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Helpers | |
{ | |
using System; | |
public static class Extensions | |
{ | |
public static string ToPrettyDataSize(this double value, int decimalChars = 2, DataSizeStandart dataSizeStandart = DataSizeStandart.Iec) | |
{ | |
var iec = (int)dataSizeStandart; | |
var size = (int)(Math.Log(value) / Math.Log(iec)); |