public bool Find_Device_ID(string id) { if (PCList.Count > 0) { DevicePC found1 = PCList.Find(getinfo => getinfo.ID == id); if (found1 != null) { return(true); } } if (MonList.Count > 0) { DeviceMonitor found2 = MonList.Find(getinfo => getinfo.ID == id); if (found2 != null) { return(true); } } if (PrList.Count > 0) { DevicePrinter found2 = PrList.Find(getinfo => getinfo.ID == id); if (found2 != null) { return(true); } } return(false); }
public void Delete_Device(string id) { DevicePC pc_to_remove = PCList.Find(getinfo => getinfo.ID == id); if (pc_to_remove != null) { PCList.Remove(pc_to_remove); return; } DeviceMonitor mon_to_remove = MonList.Find(getinfo => getinfo.ID == id); if (mon_to_remove != null) { MonList.Remove(mon_to_remove); return; } DevicePrinter pr_to_remove = PrList.Find(getinfo => getinfo.ID == id); if (pr_to_remove != null) { PrList.Remove(pr_to_remove); return; } }
public object Clone() { DevicePC DP = new DevicePC(this.ID, this.Type, this.Name, this.RegistrationDate, this.Case, this.PowerSupply, this.Moterboard, this.CPU, this.RAM, this.Drive, this.GraphicsCard); return(DP); }
public bool Find_Device(string id, string name, DateTime RegDate) { if (PCList.Count > 0) { DevicePC found1 = PCList.Find(getinfo => getinfo.ID == id && getinfo.Name == name && getinfo.RegistrationDate == RegDate); if (found1 != null) { return(true); } } if (MonList.Count > 0) { DeviceMonitor found2 = MonList.Find(getinfo => getinfo.ID == id && getinfo.Name == name && getinfo.RegistrationDate == RegDate); if (found2 != null) { return(true); } } if (PrList.Count > 0) { DevicePrinter found2 = PrList.Find(getinfo => getinfo.ID == id && getinfo.Name == name && getinfo.RegistrationDate == RegDate); if (found2 != null) { return(true); } } return(false); }