예제 #1
0
파일: CPU.cs 프로젝트: buzzon/PC-Builder
 public IComponent Constructor(OptionCollection options, dynamic modelParserResult)
 {
     return(new CPU
     {
         Brand = Brand,
         Model = modelParserResult.Model,
         Benchmark = Benchmark,
         Price = Price,
         Url = Url
     });
 }
예제 #2
0
파일: HDD.cs 프로젝트: buzzon/PC-Builder
        public IComponent Constructor(OptionCollection options, dynamic modelParserResult)
        {
            Formfactor formfactor = Server.FindOrAdd(modelParserResult.Formfactor, options.Formfactors, new Formfactor());

            return(new HDD
            {
                Brand = Brand,
                Model = modelParserResult.Model,
                Benchmark = Benchmark,
                Price = Price,
                Url = Url,
                Formfactor = formfactor.Id,
                Capacity = modelParserResult.Capacity
            });
        }
예제 #3
0
파일: GPU.cs 프로젝트: buzzon/PC-Builder
        public IComplexComponent SpecificationParser(string specification, OptionCollection options)
        {
            string memory = Regex.Match(specification,
                                        "Объем памяти</td><td class=\"gr\\d\">(.+)</td></tr>").Groups[1].Value;

            if (memory.Length == 0)
            {
                return(null);
            }
            int index = memory.IndexOf('/');

            if (index > 0)
            {
                memory = memory.Remove(index);
            }
            Memory = int.Parse(memory);
            return(this);
        }
예제 #4
0
파일: CPU.cs 프로젝트: buzzon/PC-Builder
        public IComplexComponent SpecificationParser(string specification, OptionCollection options)
        {
            string cores = Regex.Match(specification,
                                       "Количество ядер</td><td class=\"gr\\d\">(.+)</td></tr>").Groups[1].Value;

            Cores = int.Parse(cores);

            string threads = Regex.Match(specification,
                                         "Количество потоков</td><td class=\"gr\\d\">(.+)</td></tr>").Groups[1].Value;

            if (threads.Length == 0)
            {
                Threads = int.Parse(cores) * 2;
            }
            else
            {
                Threads = int.Parse(threads);
            }

            string socketTitle = Regex.Match(specification,
                                             "Разъем</td><td class=\"gr\\d\">(.+)</td></tr>").Groups[1].Value;
            int removeIndex = socketTitle.IndexOf('-');

            if (removeIndex >= 0)
            {
                socketTitle = socketTitle.Remove(removeIndex);
            }
            Socket socket = Server.FindOrAdd(socketTitle, options.Sockets, new Socket());

            Socket = socket.Id;

            string frequency = Regex.Match(specification,
                                           "Частота, МГц</td><td class=\"gr\\d\">([^ <]+).*</td></tr>").Groups[1].Value;

            Frequency = int.Parse(frequency);
            return(this);
        }