Exemplo n.º 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);
        }
Exemplo n.º 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()
        {
            DevicePrinter DP = new DevicePrinter(this.ID, this.Type, this.Name, this.RegistrationDate,
                                                 this.PrintTechnology, this.PaperSize, this.Colors, this.Scanner);

            return(DP);
        }
Exemplo n.º 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);
        }