Пример #1
0
        public void LoadFormXml()
        {
            var path = string.Format("{0}\\DokuFlex\\ScanSettings.xml",
                                     Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData));

            if (!File.Exists(path))
            {
                return;
            }

            var scanSetting = (ScanSetting)null;
            var xml         = XElement.Load(path);

            foreach (var element in xml.Elements("Setting"))
            {
                scanSetting = new ScanSetting()
                {
                    Name        = element.Element("Name").Value,
                    Scanner     = element.Element("Scanner").Value,
                    ColorFormat = element.Element("Color").Value,
                    FileType    = element.Element("FileType").Value,
                    Resolution  = float.Parse(element.Element("Resolution").Value),
                    IsDefault   = bool.Parse(element.Element("IsDefault").Value)
                };

                scanSetting.Routing.Documentary     = element.Element("Routing").Element("Documentary").Value;
                scanSetting.Routing.DocumentaryName = element.Element("Routing").Element("DocumentaryName").Value;
                scanSetting.Routing.Homologation    = int.Parse(element.Element("Routing").Element("Homologation").Value);
                scanSetting.Routing.Certificate     = element.Element("Routing").Element("Certificate").Value;
                scanSetting.Routing.CertificateName = element.Element("Routing").Element("CertificateName").Value;
                scanSetting.Routing.ConvertToPdf    = bool.Parse(element.Element("Routing").Element("ConvertToPdf").Value);
                scanSetting.Routing.Community       = element.Element("Routing").Element("Community").Value;
                scanSetting.Routing.CommunityName   = element.Element("Routing").Element("CommunityName").Value;
                scanSetting.Routing.Folder          = element.Element("Routing").Element("Folder").Value;
                scanSetting.Routing.FolderPath      = element.Element("Routing").Element("FolderPath").Value;

                this.Add(scanSetting);
            }
        }
Пример #2
0
 public void Remove(ScanSetting item)
 {
     _settings.Remove(item);
 }
Пример #3
0
 public void Add(ScanSetting item)
 {
     _settings.Add(item);
 }