Пример #1
0
        public IMiningSoftware GetMiningSoftware(IMiningSoftwareConfig config)
        {
            var @params = new NamedParameterOverloads
            {
                { "config", config }
            };

            return(_applicationContext.Container.Resolve <IMiningSoftware>(@params));
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
        public IMiningSoftware GetMiningSoftware(IMiningSoftwareConfig config)
        {
            var @params = new NamedParameterOverloads
            {
                {"config", config}
            };

            return _applicationContext.Container.Resolve<IMiningSoftware>(@params);
        }