public void GetInfo(IComputerFactory computerFactory) { IMainBoard mainBoard = computerFactory.CreateMainBoard(); IProcesor procesor = computerFactory.CreateProcessor(); Console.WriteLine(mainBoard.GetDescription()); Console.WriteLine(mainBoard.GetProcessorType(procesor)); }
public ComputerHardware(ICPU[] cPUS, bool isCPUsEnabled, bool isFanControllerEnabled, bool isMainboardEnabled, bool isVideoCardsEnabled, IMainBoard mainBoard, TimeBlock moment, IVideoCard[] videoCards) { CPUS = cPUS ?? throw new ArgumentNullException(nameof(cPUS)); IsCPUsEnabled = isCPUsEnabled; IsFanControllerEnabled = isFanControllerEnabled; IsMainboardEnabled = isMainboardEnabled; IsVideoCardsEnabled = isVideoCardsEnabled; MainBoard = mainBoard ?? throw new ArgumentNullException(nameof(mainBoard)); Moment = moment ?? throw new ArgumentNullException(nameof(moment)); VideoCards = videoCards ?? throw new ArgumentNullException(nameof(videoCards)); }
private void PrepareHardWares(IAbstractFactory schema) { this.cup = schema.CreateCUP(); this.mainBoard = schema.CreateMainBoard(); }