public IMiningSoftware GetMiningSoftware(IMiningSoftwareConfig config) { var @params = new NamedParameterOverloads { { "config", config } }; return(_applicationContext.Container.Resolve <IMiningSoftware>(@params)); }
public MiningSoftware(IAlgorithmManager algorithmManager, IMiningSoftwareConfig config) { Name = config.Name; if (config.Version != null) { Version = new Version(config.Version); } Algorithms = new List <IHashAlgorithm>(); foreach (var entry in config.Algorithms) { var algorithm = algorithmManager.Get(entry); if (algorithm == null) { continue; } Algorithms.Add(algorithm); } foreach (var entry in config.Platforms) { switch (entry) { case "ati": Platforms = Platforms | Platforms.Ati; break; case "asic": Platforms = Platforms | Platforms.Asic; break; case "cpu": Platforms = Platforms | Platforms.Cpu; break; case "nvidia": Platforms = Platforms | Platforms.Nvidia; break; } } Site = config.Site; Downloads = config.Downloads.Where(x => x.Value != null).ToDictionary(x => x.Key, x => x.Value); }
public MiningSoftware(IAlgorithmManager algorithmManager, IMiningSoftwareConfig config) { Name = config.Name; if(config.Version!=null) Version = new Version(config.Version); Algorithms = new List<IHashAlgorithmStatistics>(); foreach(var entry in config.Algorithms) { var algorithm = algorithmManager.Get(entry); if (algorithm == null) continue; Algorithms.Add(algorithm); } foreach (var entry in config.Platforms) { switch (entry) { case "ati": Platforms = Platforms | Platforms.Ati; break; case "asic": Platforms = Platforms | Platforms.Asic; break; case "cpu": Platforms = Platforms | Platforms.Cpu; break; case "nvidia": Platforms = Platforms | Platforms.Nvidia; break; } } Site = config.Site; Downloads = config.Downloads.Where(x => x.Value != null).ToDictionary(x => x.Key, x => x.Value); }
public IMiningSoftware GetMiningSoftware(IMiningSoftwareConfig config) { var @params = new NamedParameterOverloads { {"config", config} }; return _applicationContext.Container.Resolve<IMiningSoftware>(@params); }