コード例 #1
0
        public Product CreateProduct(string type, double price)
        {
            Product product = null;

            switch (type)
            {
            case "Ram":
                product = new Ram(price);
                break;

            case "Gpu":
                product = new Gpu(price);
                break;

            case "HardDrive":
                product = new HardDrive(price);
                break;

            case "SolidStateDrive":
                product = new SolidStateDrive(price);
                break;

            default:
                throw new InvalidOperationException("Invalid product type!");
            }

            return(product);
        }
コード例 #2
0
    public Product CreateProduct(string type, double price)
    {
        Product product = null;

        if (type == "Gpu")
        {
            product = new Gpu(price);
        }
        else if (type == "HardDrive")
        {
            product = new HardDrive(price);
        }
        else if (type == "Ram")
        {
            product = new Ram(price);
        }
        else if (type == "SolidStateDrive")
        {
            product = new SolidStateDrive(price);
        }
        else
        {
            throw new InvalidOperationException("Invalid product type!");
        }

        return(product);
    }
コード例 #3
0
 private void MakeHardDrive()
 {
     NewHardDrive = new HardDrive
     {
         //hard drive information
         Make           = comboBoxHDMake.Text,
         Model          = comboBoxHDModel.Text,
         Type           = comboBoxHDType.Text,
         Serial         = textBoxSerialNum.Text,
         SizeInGB       = Convert.ToDecimal(textBoxSize.Text),
         DriveInterface =
             RadioButtonListUtilities.ExtractTextFromRadioButtonGroup(groupBoxDriveInterface),
         DrivePosition =
             RadioButtonListUtilities.ExtractTextFromRadioButtonGroup(
                 groupBoxDrivePostitionAsInstalled),
         JumperSetting =
             RadioButtonListUtilities.ExtractTextFromRadioButtonGroup(groupBoxJumperSettings),
         JumperDiagram = jumperDiagram,
         CDFInfo       = new CdfInfo
         {
             IsFinishDate = true,
             Cdfdate      = dateTimePickerCDFDate.Value,
             TechExaminer =
                 SelectSingleEntityById.SelectEmployeeById(
                     new Guid(comboBoxCdfInfoTech.SelectedValue.ToString())),
         }
     };
 }
コード例 #4
0
ファイル: Program.cs プロジェクト: oksbelysheva/SSU
        private static List <HardDrive> GetInfoHDD()
        {
            string BaseDirectory = AppDomain.CurrentDomain.BaseDirectory;

            BaseDirectory = (BaseDirectory.Remove(BaseDirectory.IndexOf("\\")));

            ManagementObjectSearcher searcher = new
                                                ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive");
            List <HardDrive> hdCollection = new List <HardDrive>();

            foreach (ManagementObject wmi_HD in searcher.Get())
            {
                HardDrive hd = new HardDrive();
                hd.Model = wmi_HD["Model"].ToString();
                if (hd.Model.Contains("Reader USB Device"))
                {
                    continue;
                }
                hd.SerialNo = wmi_HD["SerialNumber"].ToString().Trim();

                hd.Directory = GetNameDisk(wmi_HD);

                if (hd.Directory == BaseDirectory)
                {
                    hdCollection.Add(hd);
                }
            }
            return(hdCollection);
        }
コード例 #5
0
        public Product CreateProduct(string type, double price)
        {
            type = type.ToLower();
            Product product = null;

            switch (type)
            {
            case "gpu":
                product = new Gpu(price);
                break;

            case "harddrive":
                product = new HardDrive(price);
                break;

            case "ram":
                product = new Ram(price);
                break;

            case "solidstatedrive":
                product = new SolidStateDrive(price);
                break;

            default:
                throw new InvalidOperationException("Invalid storage type!");
            }

            return(product);
        }
コード例 #6
0
ファイル: Anasayfa.cs プロジェクト: caglary/parola
        private void Form1_Load(object sender, EventArgs e)
        {
            bool hardDiskFinded = false;
            //eğer programa başka bilgisayardan giriş yapılırsa
            HardDrive hd   = new HardDrive();
            var       list = hd.GetHDDInformation();

            foreach (var item in list)
            {
                if (item.SerialNo == "2J1720122823")
                {
                    //Lenovo
                    hardDiskFinded = true;
                }
            }
            if (hardDiskFinded)
            {
                LoadingForm();
            }
            else
            {
                Password password = new Password();
                password.ShowDialog();
                LoadingForm();
            }
        }
コード例 #7
0
ファイル: EntryPoint.cs プロジェクト: Tectonik/Exam
        private static void Dell()
        {
            var ram = new Rammstein(8);
            var videoCard = new HardDrive() { IsMonochrome = false };

            pc = new PersonalComputer
            (
            new Cpu(8 / 2, 64, ram, videoCard), ram, new[] { new HardDrive(1000, false, 0) }, videoCard
            );

            var ram1 = new Rammstein(8 * 8);
            var card = new HardDrive();

            server = new Server
            (
                new Cpu(8, 64, ram1, card),
                ram1,
                new List<HardDrive> { new HardDrive(0, true, 2, new List<HardDrive> { new HardDrive(2000, false, 0), new HardDrive(2000, false, 0) }) },
                card
            );

            var ram2 = new Rammstein(8);
            var videoCard1 = new HardDrive() { IsMonochrome = false };

            laptop = new Laptop
            (
                new Cpu(8 / 2, 32, ram2, videoCard1),
                ram2,
                new[] { new HardDrive(1000, false, 0) },
                videoCard1,
                new LaptopBattery()
            );
        }
コード例 #8
0
        public string AddProduct(string type, double price)
        {
            Product product;

            switch (type)
            {
            case "Gpu":
                product = new Gpu(price);
                break;

            case "HardDrive":
                product = new HardDrive(price);
                break;

            case "Ram":
                product = new Ram(price);
                break;

            case "SolidStateDrive":
                product = new SolidStateDrive(price);
                break;

            default:
                throw new InvalidOperationException("Invalid product type!");
            }

            if (!products.ContainsKey(type))
            {
                products.Add(type, new Stack <Product>());
            }

            products[type].Push(product);

            return($"Added {type} to pool");
        }
コード例 #9
0
        static void Main(string[] args)
        {
            var mainboard = new Mainboard();

            Console.WriteLine(mainboard.Smbios.BIOS.Vendor);

            var cpu = Cpu.Discover();

            foreach (var item in cpu)
            {
                Print(item.CoreTemperatures);
                Print(item.CoreClocks);
                Print(item.CorePowers);
                Print(item.CoreVoltages);
                Print(item.CoreClocks);
            }

            var hdd = HardDrive.Discover();

            foreach (var item in hdd)
            {
                foreach (var smart in item.SmartSensors)
                {
                    Console.WriteLine(smart.Key.Name);
                    Print(new[] { smart.Value });
                }
            }
            Console.ReadKey();
        }
コード例 #10
0
        public static void SaveHardDriveToDB(string partid)
        {
            JObject  chosenpart = GetPartData(partid);
            Entities ORM        = new Entities();

            HardDrive tempObj = new HardDrive(chosenpart["title"].ToString());

            List <HardDrive> z = new List <HardDrive>();

            z = ORM.HardDrives.Where(x => x.ProductID == partid).ToList();

            if (z.Count < 1)
            {
                tempObj.ProductID     = chosenpart["product_id"].ToString();
                tempObj.Description   = "x";
                tempObj.Brand         = chosenpart["brand"].ToString();
                tempObj.Price         = int.Parse(chosenpart["price"].ToString());
                tempObj.Stars         = float.Parse(chosenpart["stars"].ToString());
                tempObj.ImageLink     = chosenpart["main_image"].ToString();
                tempObj.Manufacturer  = "x";
                tempObj.Capacity      = GetHardDrive_ReadSpeed(ParseToArray(chosenpart["feature_bullets"]));
                tempObj.CapacityUnits = null;
                tempObj.Interface     = null;
                tempObj.SlotSize      = false;//null;

                ORM.HardDrives.Add(tempObj);
                ORM.SaveChanges();
            }
        }
コード例 #11
0
 /// <summary>
 /// This Class make instance of new motherboard.
 /// </summary>
 /// <param name="cpuElement">CPU element on mootherboard.</param>
 /// <param name="ramElement">RAM element on motherboard.</param>
 /// <param name="hardDriveElement">Hard drive on mothervboard.</param>
 /// <param name="videoCardElement">Video card on motherboard.</param>
 public Motherboard(CPU cpuElement, RAM ramElement, HardDrive hardDriveElement, VideoCard videoCardElement)
 {
     this.CPUElement = cpuElement;
     this.RAMElement = ramElement;
     this.HardDriveElement = hardDriveElement;
     this.VideoCardElement = videoCardElement;
 }
コード例 #12
0
        public string AddProduct(string type, double price)
        {
            //var product = productFactory.CreateProduct(type, price);
            //products.Add(product);
            //return $"Added {type} to pool";
            Product product;

            switch (type)
            {
            case "Gpu":
                product = new Gpu(price);
                break;

            case "HardDrive":
                product = new HardDrive(price);
                break;

            case "Ram":
                product = new Ram(price);
                break;

            case "SolidStateDrive":
                product = new SolidStateDrive(price);
                break;

            default:
                throw new InvalidOperationException($"Invalid product type!");
            }

            products.Add(product);
            return($"Added {type} to pool");
        }
コード例 #13
0
ファイル: Database.cs プロジェクト: SW7-2016/Analyser
        public DistinctProductList <HardDrive> GetHardDriveData()
        {
            MySqlCommand command =
                new MySqlCommand(
                    "SELECT Product.ProductID, Product.name, HardDrive.isInternal, HardDrive.type, HardDrive.formFactor, " +
                    "HardDrive.capacity, HardDrive.cacheSize, HardDrive.transferRate, HardDrive.brand, HardDrive.sata, " +
                    "HardDrive.height, HardDrive.depth, HardDrive.width " +
                    "FROM Product, HardDrive " +
                    "WHERE Product.ProductID = HardDrive.ProductID", connection);

            DistinctProductList <HardDrive> result = new DistinctProductList <HardDrive>();
            MySqlDataReader reader = command.ExecuteReader();

            while (reader.Read())
            {
                object[] tempResult = new object[reader.FieldCount];
                reader.GetValues(tempResult);

                HardDrive row = new HardDrive("HardDrive", (int)tempResult[0], (string)tempResult[1],
                                              reader.GetBoolean(2), (string)tempResult[3],
                                              (string)tempResult[4], (string)tempResult[5], (string)tempResult[6], (string)tempResult[7],
                                              (string)tempResult[8], (string)tempResult[9], (string)tempResult[10], (string)tempResult[11],
                                              (string)tempResult[12]);

                result.Add(row);
            }


            reader.Close();

            return(result);
        }
コード例 #14
0
        public Product CreateProduct(string type, double price)
        {
            Product newProduct = null;

            switch (type)
            {
            case "Gpu":
                newProduct = new Gpu(price);
                break;

            case "HardDrive":
                newProduct = new HardDrive(price);
                break;

            case "Ram":
                newProduct = new Ram(price);
                break;

            case "SolidStateDrive":
                newProduct = new SolidStateDrive(price);
                break;

            default:
                throw new InvalidOperationException(ExceptionMessages.InvalidProductType);
            }

            return(newProduct);
        }
コード例 #15
0
        public static ICollection <HardDrive> GetHardDrives()
        {
            List <HardDrive> hddList = new List <HardDrive>();

            string[] requiredProperties = new string[]
            {
                "Caption",
                "Model",
                "Signature",
                "Size"
            };

            WmiClassCollection classCollection = Wmi.Query(Wmi.DISKDRIVE_CLASSNAME, requiredProperties);

            if (classCollection == null)
            {
                return(hddList);
            }

            foreach (WmiClass wmiClass in classCollection)
            {
                HardDrive hdd = new HardDrive(
                    (string)wmiClass["Caption"].Value,
                    (string)wmiClass["Model"].Value,
                    (uint?)wmiClass["Signature"].Value,
                    (ulong?)wmiClass["Size"].Value);

                hddList.Add(hdd);
            }

            return(hddList);
        }
コード例 #16
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            var      hardDrive = new HardDrive(tbName.Text, int.Parse(tbPrice.Text), tbCompany.Text, int.Parse(tbAmount.Text), int.Parse(tbCapacity.Text), int.Parse(tbRotateSpeed.Text), tbConnectionInterface.Text);
            IStorage storage   = ListItemStorage.GetInstance();

            storage.AddItem(hardDrive);
            this.Close();
        }
コード例 #17
0
        public void Load_ShouldAddtoTrunkSuccessfullyIfNotFull()
        {
            var product = new HardDrive(50);

            this.van.LoadProduct(product);

            Assert.AreEqual(1, this.van.Trunk.Count);
        }
コード例 #18
0
ファイル: Program.cs プロジェクト: prsquared/SOLIDAssignment1
 public Computer()
 {
     devices[0] = new Motherboard();
     devices[1] = new Cpu();
     devices[2] = new Ram();
     devices[3] = new HardDrive();
     devices[4] = new PowerSupply();
 }
コード例 #19
0
      public void TestSemiPropertyIsEmptyReturnsCorrectValueWhenNotEmpty()
      {
          Vehicle semi      = new Semi();
          Product hardDrive = new HardDrive(120);

          semi.LoadProduct(new Gpu(100));
          Assert.IsFalse(semi.IsEmpty, "Semi should not be empty");
      }
コード例 #20
0
        public void TestVanPropertyIsEmptyReturnsCorrectValueWhenNotEmpty()
        {
            Vehicle van       = new Van();
            Product hardDrive = new HardDrive(120);

            van.LoadProduct(new Gpu(100));
            Assert.IsFalse(van.IsEmpty, "Van should not be empty");
        }
コード例 #21
0
      public void TestSemiPropertyIsFullReturnsCorrectValueWhenNotFull()
      {
          Vehicle semi      = new Semi();
          Product hardDrive = new HardDrive(120);

          semi.LoadProduct(new Gpu(100));
          Assert.False(semi.IsFull, "Semi should not be full");
      }
コード例 #22
0
        public void TestTruckPropertyIsFullReturnsCorrectValueWhenNotFull()
        {
            Vehicle truck     = new Truck();
            Product hardDrive = new HardDrive(120);

            truck.LoadProduct(new Gpu(100));
            Assert.False(truck.IsFull, "Truck should not be full");
        }
コード例 #23
0
        public void TestTruckPropertyIsEmptyReturnsCorrectValueWhenNotEmpty()
        {
            Vehicle truck     = new Truck();
            Product hardDrive = new HardDrive(120);

            truck.LoadProduct(new Gpu(100));
            Assert.IsFalse(truck.IsEmpty, "Truck should not be empty");
        }
コード例 #24
0
        public void TestVanPropertyIsFullReturnsCorrectValueWhenNotFull()
        {
            Vehicle van       = new Van();
            Product hardDrive = new HardDrive(120);

            van.LoadProduct(new Gpu(100));
            Assert.False(van.IsFull, "Van should not be full");
        }
        public void TestDistributionCenterProperyProductsReturnsTheCorrectElements()
        {
            var distributionCenter = new DistributionCenter("SmartSolutions");
            var hardDirve          = new HardDrive(123);

            distributionCenter.GetVehicle(0).LoadProduct(hardDirve);
            distributionCenter.UnloadVehicle(0);
            Assert.AreEqual(distributionCenter.Products.ElementAt(0), hardDirve, "Product is not the same as expected.");
        }
        public void TestDistributionCenterPropertyIsFullReturnsFalse()
        {
            var distributionCenter = new DistributionCenter("SmartSolutions");
            var hardDirve          = new HardDrive(123);

            distributionCenter.GetVehicle(0).LoadProduct(hardDirve);
            distributionCenter.UnloadVehicle(0);
            Assert.IsFalse(distributionCenter.IsFull, "DistributionCenter should not be full.");
        }
コード例 #27
0
        public void TestTruckUnLoadProductThrowsExceptionWhenEmpty()
        {
            Vehicle truck     = new Truck();
            Product hardDrive = new HardDrive(120);

            truck.LoadProduct(new Gpu(100));
            truck.Unload();
            Assert.Throws <InvalidOperationException>(() => truck.Unload(), "Empty truck still unloads products.");
        }
コード例 #28
0
        public void TestVanPropertyIsFullReturnsCorrectValueWhenFull()
        {
            Vehicle van       = new Van();
            Product hardDrive = new HardDrive(120);

            van.LoadProduct(hardDrive);
            van.LoadProduct(hardDrive);
            Assert.True(van.IsFull, "Van should be full");
        }
コード例 #29
0
        public void TestWarehouseProperyProductsReturnsTheCorrectElements()
        {
            var warehouse = new Warehouse("SmartSolutions");
            var hardDirve = new HardDrive(123);

            warehouse.GetVehicle(0).LoadProduct(hardDirve);
            warehouse.UnloadVehicle(0);
            Assert.AreEqual(warehouse.Products.ElementAt(0), hardDirve, "Product is not the same as expected.");
        }
コード例 #30
0
        public void TestAutomatedWarehousePropertyIsFullReturnsTrue()
        {
            var automatedWarehouse = new AutomatedWarehouse("SmartSolutions");
            var hardDirve          = new HardDrive(123);

            automatedWarehouse.GetVehicle(0).LoadProduct(hardDirve);
            automatedWarehouse.UnloadVehicle(0);
            Assert.IsTrue(automatedWarehouse.IsFull, "AutomatedWarehouse should be full.");
        }
コード例 #31
0
 public Computer(int sectorSize, long bootSector, long bootAddress)
 {
     _sectorSize  = sectorSize;
     _bootSector  = bootSector;
     _bootAddress = bootAddress;
     Processor    = new Cpu();
     Ram          = new Memory();
     Hd           = new HardDrive();
 }
コード例 #32
0
      public void TestSemiUnLoadProductThrowsExceptionWhenEmpty()
      {
          Vehicle semi      = new Semi();
          Product hardDrive = new HardDrive(120);

          semi.LoadProduct(new Gpu(100));
          semi.Unload();
          Assert.Throws <InvalidOperationException>(() => semi.Unload(), "Empty Semi still unloads products.");
      }
コード例 #33
0
ファイル: FactoryDell.cs プロジェクト: damy90/Telerik-all
        public PC CreatePC()
        {
            var ram = new Ram(8);
            var videoCard = new VideoCard(false);
            var cpu = new Cpu(4, 64, ram, videoCard);
            var storage = new HardDrive(1000);
            var pc = new PC(cpu, ram, storage, videoCard);

            return pc;
        }
コード例 #34
0
ファイル: FactoryLenovo.cs プロジェクト: damy90/Telerik-all
        public PC CreatePC()
        {
            var ram = new Ram(4);
            var videoCard = new VideoCard(true);
            var cpu = new Cpu(2, 64, ram, videoCard);
            var storage = new HardDrive(2000);
            var pc = new PC(cpu, ram, storage, videoCard);

            return pc;
        }
コード例 #35
0
 public Server(
     CPU cpuOfComputer, 
     RAM ramOfComputer, 
     HardDrive hardDriveOfComputer,
     VideoCard videoCardOfComputer)
     : base(ComputerType.PC, cpuOfComputer, ramOfComputer, hardDriveOfComputer, videoCardOfComputer, null)
 {
     this.motherboard = 
         new Motherboard(this.CpuOfComputer, this.RamOfComputer, this.HardDriveOfComputer, this.VideoCardOfComputer);
 }
コード例 #36
0
 public Laptop(
     CPU cpuOfComputer, 
     RAM ramOfComputer, 
     HardDrive hardDriveOfComputer, 
     VideoCard videoCardOfComputer, 
     Battery laptopBattery)
     : base(ComputerType.PC, cpuOfComputer, ramOfComputer, hardDriveOfComputer, videoCardOfComputer, laptopBattery)
 {
     this.motherboard = 
         new Motherboard(this.CpuOfComputer, this.RamOfComputer, this.HardDriveOfComputer, this.VideoCardOfComputer);
 }
コード例 #37
0
        public override Server MakeServer()
        {
            CPU cpu = new CPU(8, 64);
            RAM ram = new RAM(64);
            HardDrive hardDrive = new HardDrive(2000, true, 2);
            VideoCard videoCard = new VideoCard(true);

            Server dellServer = new Server(cpu, ram, hardDrive, videoCard);

            return dellServer;
        }
コード例 #38
0
        public override PersonalComputer MakePersonalComputer()
        {
            CPU cpu = new CPU(4, 64);
            RAM ram = new RAM(8);
            HardDrive hardDrive = new HardDrive(1000, false, 0);
            VideoCard videoCard = new VideoCard(false);

            PersonalComputer dellPersonalComputer = new PersonalComputer(cpu, ram, hardDrive, videoCard);

            return dellPersonalComputer;
        }
コード例 #39
0
        public override PersonalComputer CreatePC()
        {
            var ram = new Ram((int)RamType.GB4);
            var videoCard = new VideoCard();
            var motherBoard = new Motherboard(ram, videoCard);
            var cpu = new AdvancedCpu(2, (int)ArchitectureType.Bits64, motherBoard);
            var hardDrive = new HardDrive(2000);
            var pc = new PersonalComputer(motherBoard, cpu, hardDrive);

            return pc;
        }
コード例 #40
0
        public IPersonalComputer GetPersonalComputer()
        {
            var cpu = new CPU(PcCpuCores, LaptopCpuBits);
            var ram = new RAM(PcRam);
            var hardDrive = new HardDrive(PcHardDriveCapacity, false);
            var videoCard = new VideoCard(false);
            var hardDrives = new List<HardDrive>();
            hardDrives.Add(hardDrive);

            return new PersonalComputer(cpu, ram, hardDrives, videoCard);
        }
コード例 #41
0
ファイル: Lenovo.cs プロジェクト: damy90/Telerik-all
        private IComputer ManufacturePC()
        {
            Ram ram = new Ram(4);
            HardDrive hardDrive = new HardDrive(2000, false, 0);
            IEnumerable<HardDrive> hardDrives = new List<HardDrive>() { hardDrive };
            IVideoCard videoCard = new MonochromeVideoCard();
            ICpu cpu = new Cpu(2, CpuType.Bits64, new Motherboard(ram, videoCard));
            IComputer pc = new PersonalComputer(cpu, ram, hardDrives, videoCard);

            return pc;
        }
コード例 #42
0
        public override Server MakeServer()
        {
            CPU cpu = new CPU(4, 32);
            RAM ram = new RAM(32);
            HardDrive hardDrive = new HardDrive(1000, true, 2);
            VideoCard videoCard = new VideoCard(true);

            Server hpServer = new Server(cpu, ram, hardDrive, videoCard);

            return hpServer;
        }
コード例 #43
0
        public override PersonalComputer MakePersonalComputer()
        {
            CPU cpu = new CPU(2, 32);
            RAM ram = new RAM(2);
            HardDrive hardDrive = new HardDrive(500, false, 0);
            VideoCard videoCard = new VideoCard(false);

            PersonalComputer hpPersonalComputer = new PersonalComputer(cpu, ram, hardDrive, videoCard);

            return hpPersonalComputer;
        }
コード例 #44
0
ファイル: FileSystem.cs プロジェクト: alexwaslike/DesktopGame
    void Start ()
    {
        HardDrive = GetComponent<HardDrive>();

        // display all desktop icons
        Directory desktop = GameObject.FindWithTag("Desktop").GetComponent<Directory>();
        for(int i=0; i<desktop.Files.Count; i++)
        {
            DisplayIcon(desktop.Files[i]);
        }
	}
コード例 #45
0
        public override PersonalComputer MakePersonalComputer()
        {
            CPU cpu = new CPU(2, 64);
            RAM ram = new RAM(4);
            HardDrive hardDrive = new HardDrive(2000, false, 0);
            VideoCard videoCard = new VideoCard(true);

            PersonalComputer lenovoPersonalComputer = new PersonalComputer(cpu, ram, hardDrive, videoCard);

            return lenovoPersonalComputer;
        }
コード例 #46
0
ファイル: FactoryDell.cs プロジェクト: damy90/Telerik-all
        public Laptop CreateLaptop()
        {
            var ram = new Ram(4);
            var videoCard = new VideoCard(false);
            var cpu = new Cpu(4, 32, ram, videoCard);
            var storage = new HardDrive(1000);
            var battery = new LaptopBattery();
            var laptop = new Laptop(cpu, ram, storage, videoCard, battery);

            return laptop;
        }
コード例 #47
0
        public override Server MakeServer()
        {
            CPU cpu = new CPU(2, 128);
            RAM ram = new RAM(8);
            HardDrive hardDrive = new HardDrive(500, true, 2);
            VideoCard videoCard = new VideoCard(true);

            Server lenovoServer = new Server(cpu, ram, hardDrive, videoCard);

            return lenovoServer;
        }
コード例 #48
0
ファイル: Lenovo.cs プロジェクト: damy90/Telerik-all
        private IComputer ManufactureLaptop()
        {
            Ram ram = new Ram(16);
            HardDrive hardDrive = new HardDrive(1000, false, 0);
            IEnumerable<HardDrive> hardDrives = new List<HardDrive>() { hardDrive };
            IVideoCard videoCard = new ColorfulVideoCard();
            LaptopBatery battery = new LaptopBatery();
            ICpu cpu = new Cpu(2, CpuType.Bits64, new Motherboard(ram, videoCard));
            IComputer laptop = new Laptop(cpu, ram, hardDrives, videoCard, battery);

            return laptop;
        }
コード例 #49
0
        public override Laptop MakeLaptop()
        {
            CPU cpu = new CPU(4, 32);
            RAM ram = new RAM(8);
            HardDrive hardDrive = new HardDrive(1000, false, 0);
            VideoCard videoCard = new VideoCard(false);
            Battery battery = new Battery();

            Laptop dellLaptop = new Laptop(cpu, ram, hardDrive, videoCard, battery);

            return dellLaptop;
        }
コード例 #50
0
ファイル: Computer.cs プロジェクト: damy90/Telerik-all
        public Computer(CentralProcessingUnit centralProcessingUnit, RamMemory ramMemory, HardDrive hardDrives, VideoCard videoCard)
        {
            this.CentralProcessingUnit = centralProcessingUnit;
            this.RamMemory = ramMemory;
            this.HardDrives = hardDrives;
            this.VideoCard = videoCard;

            this.Motherboard = new Motherboard();
            this.Motherboard.Register(this.CentralProcessingUnit);
            this.Motherboard.Register(this.RamMemory);
            this.Motherboard.Register(this.VideoCard);
        }
コード例 #51
0
        public override Laptop CreateLaptop()
        {
            var ram = new Ram((int)RamType.GB16);
            var videoCard = new VideoCard(false);
            var motherBoard = new Motherboard(ram, videoCard);
            var cpu = new AdvancedCpu(2, (int)ArchitectureType.Bits64, motherBoard);
            var hardDrive = new HardDrive(1000);
            var laptopBattery = new LaptopBattery();
            var laptop = new Laptop(motherBoard, cpu, hardDrive, laptopBattery);

            return laptop;
        }
コード例 #52
0
ファイル: Lenovo.cs プロジェクト: damy90/Telerik-all
        private IComputer ManufactureServer()
        {
            Ram ram = new Ram(8);
            HardDrive firstHardDrive = new HardDrive(500, true, 2);
            HardDrive secondHardDrive = new HardDrive(500, true, 2);
            IEnumerable<HardDrive> hardDrives = new List<HardDrive>() { firstHardDrive, secondHardDrive };
            IVideoCard videoCard = new MonochromeVideoCard();
            ICpu cpu = new Cpu(8, CpuType.Bits128, new Motherboard(ram, videoCard));
            IComputer server = new Server(cpu, ram, hardDrives, videoCard);

            return server;
        }
コード例 #53
0
        public ILaptop GetLaptop()
        {
            var cpu = new CPU(LaptopCpuCores, LaptopCpuBits);
            var ram = new RAM(LaptopRam);
            var hardDrive = new HardDrive(LaptopHardDriveCapacity, false);
            var videoCard = new VideoCard(false);
            var battery = new LaptopBattery();
            var hardDrives = new List<HardDrive>();
            hardDrives.Add(hardDrive);

            return new Laptop(cpu, ram, hardDrives, videoCard, battery);
        }
コード例 #54
0
        public override Laptop MakeLaptop()
        {
            CPU cpu = new CPU(2, 64);
            RAM ram = new RAM(16);
            HardDrive hardDrive = new HardDrive(1000, false, 0);
            VideoCard videoCard = new VideoCard(false);
            Battery battery = new Battery();

            Laptop lenovoLaptop = new Laptop(cpu, ram, hardDrive, videoCard, battery);

            return lenovoLaptop;
        }
コード例 #55
0
        public IServer GetServer()
        {
            var cpu = new CPU(ServerCpuCores, ServerCpuBits);
            var ram = new RAM(ServerRam);
            var hardDrive = new HardDrive(ServerHardDriveCapacity, true);
            var videoCard = new VideoCard(true);
            var hardDrives = new List<HardDrive>();
            for (int i = 0; i < ServerNumberOfHardDrives; i++)
            {
                hardDrives.Add(hardDrive);
            }

            return new Server(cpu, ram, hardDrives, videoCard);
        }
コード例 #56
0
 public Computer(
     ComputerType typeOfComputer, 
     CPU cpuOfComputer, 
     RAM ramOfComputer, 
     HardDrive hardDriveOfComputer, 
     VideoCard videoCardOfComputer, 
     Battery laptopBattery)
 {
     this.TypeOfComputer = typeOfComputer;
     this.CpuOfComputer = cpuOfComputer;
     this.RamOfComputer = ramOfComputer;
     this.HardDriveOfComputer = hardDriveOfComputer;
     this.VideoCardOfComputer = videoCardOfComputer;
     this.LaptopBattery = laptopBattery;
 }
コード例 #57
0
        public override Server CreateServer()
        {
            var ram = new Ram((int)RamType.GB8);
            var videoCard = new VideoCard();
            var motherBoard = new Motherboard(ram, videoCard);
            var cpu = new AdvancedCpu(2, (int)ArchitectureType.Bits128, motherBoard);
            var hardDriveOne = new HardDrive(500);
            var hardDriveTwo = new HardDrive(500);
            var raid = new Raid(500);
            raid.Add(hardDriveOne);
            raid.Add(hardDriveTwo);
            var server = new Server(motherBoard, cpu, raid);

            return server;
        }
コード例 #58
0
 private void MakeHardDrive()
 {
     NewHardDrive = new HardDrive
                        {
                            //hard drive information
                            Make = comboBoxHDMake.Text,
                            Model = comboBoxHDModel.Text,
                            Type = comboBoxHDType.Text,
                            Serial = textBoxSerialNum.Text,
                            SizeInGB = Convert.ToDecimal(textBoxSize.Text),
                            DriveInterface =
                                RadioButtonListUtilities.ExtractTextFromRadioButtonGroup(groupBoxDriveInterface),
                            DrivePosition =
                                RadioButtonListUtilities.ExtractTextFromRadioButtonGroup(
                                    groupBoxDrivePostitionAsInstalled),
                            JumperSetting =
                                RadioButtonListUtilities.ExtractTextFromRadioButtonGroup(groupBoxJumperSettings),
                            JumperDiagram = jumperDiagram,
                            CDFInfo = new CdfInfo
                                          {
                                              IsFinishDate = true,
                                              Cdfdate = dateTimePickerCDFDate.Value,
                                              TechExaminer =
                                                  SelectSingleEntityById.SelectEmployeeById(
                                                      new Guid(comboBoxCdfInfoTech.SelectedValue.ToString())),
                                          }
                        };
 }
コード例 #59
0
ファイル: Cpu.cs プロジェクト: Tectonik/Exam
 internal Cpu(byte numberOfCores, byte numberOfBits, Rammstein ram, HardDrive videoCard)
 {
     this.numberOfBits = numberOfBits;
     this.ram = ram;
     this.NumberOfCores = numberOfCores;
 }
コード例 #60
0
ファイル: EntryPoint.cs プロジェクト: Tectonik/Exam
        private static void Hp()
        {
            var ram = new Rammstein(8 / 4);
            var videoCard = new HardDrive() { IsMonochrome = false };
            pc = new PersonalComputer
            (
                new Cpu(8 / 4, 32, ram, videoCard), ram, new[] { new HardDrive(500, false, 0) }, videoCard
            );

            var serverRam = new Rammstein(8 * 4);
            var serverVideo = new HardDrive();
            server = new Server(
            new Cpu(8 / 2, 32, serverRam, serverVideo),
            serverRam,
            new List<HardDrive> { new HardDrive(0, true, 2, new List<HardDrive> { new HardDrive(1000, false, 0), new HardDrive(1000, false, 0) }) },
            serverVideo);

            var card = new HardDrive()
            {
                IsMonochrome
                = false
            };

            var ram1 = new Rammstein(8 / 2);

            laptop = new Laptop
            (
                new Cpu(8 / 4, 64, ram1, card),
                ram1,
                new[] { new HardDrive(500, false, 0) },
                card,
                new LaptopBattery()
            );
        }