Пример #1
0
        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);
        }
Пример #2
0
        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()
        {
            DeviceMonitor DM = new DeviceMonitor(this.ID, this.Type, this.Name, this.RegistrationDate,
                                                 this.Diagonal, this.Resolution, this.Frequency, this.Connector);

            return(DM);
        }
Пример #4
0
        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);
        }