private IMemoryApi memoryApi = null; //add for the addition of interface of IMemoryApi void PrepareHardware(IAbstractFactory2 schema) { cpuApi = (ICPUApi)schema.CreateApi(1); mainboardApi = (IMainboardApi)schema.CreateApi(2); memoryApi = (IMemoryApi)schema.CreateApi(3); cpuApi.Calculate(); mainboardApi.InstallCPU(); if (memoryApi != null) // Add For addtional interface of IMemoryApi { memoryApi.RunMem(); } }
public void MakeComputer(IAbstractFactory2 schema) { PrepareHardware(schema); }