示例#1
0
        public void EnableManufacturer(KnownManufacturerInfo info)
        {
            Manufacturer mfg = MachineDB.FindManufacturerByUUID(info.uuid);

            if (mfg == null)
            {
                MachineDB.CreateManufacturer(info.name, info.uuid, info.default_uuid);
                OnManufacturerListModified(this, EventArgs.Empty);
            }
            CachedManufacturers = null;
        }
示例#2
0
        public void DisableManufacturer(KnownManufacturerInfo info)
        {
            Manufacturer mfg = MachineDB.FindManufacturerByUUID(info.uuid);

            if (mfg != null && DisabledManufacturers.Contains(mfg) == false)
            {
                DisabledManufacturers.Add(mfg);
                CachedManufacturers.Remove(mfg);
                OnManufacturerListModified(this, EventArgs.Empty);
            }
        }
示例#3
0
        public static List <KnownManufacturerInfo> LoadManufacturers()
        {
            List <KnownManufacturerInfo> result = new List <KnownManufacturerInfo>();

            string mfg_file_text = FResources.LoadText("printers/manufacturers");

            string[] rows = mfg_file_text.Split('\n', '\r');
            foreach (string rowdata in rows)
            {
                string[] values = rowdata.Split(',');
                if (values.Length < 3)
                {
                    continue;
                }
                KnownManufacturerInfo mi = new KnownManufacturerInfo();
                mi.name         = values[0];
                mi.uuid         = values[1];
                mi.default_uuid = values[2];
                result.Add(mi);
            }

            return(result);
        }