Ejemplo n.º 1
0
        internal void LoadConfigFromJSON(string filename)
        {
            this.filename = filename;
            XsdValidatorConfig config = JsonConvert.DeserializeObject <XsdValidatorConfig>(File.ReadAllText(filename));

            Helper.SetTextFromSettings(config.XMLFilename, this.cbPath);
            if (config.XSDFiles != null)
            {
                InitGridView();

                List <FileInfo> list = new List <FileInfo>();
                foreach (var fullfilename in config.XSDFiles)
                {
                    if (File.Exists(fullfilename))
                    {
                        list.Add(new FileInfo(fullfilename));
                    }
                    else
                    {
                        Logger.Log($"{fullfilename} doesn't exist");
                    }
                }
                dgKeyValue.DataSource = list;
            }
            this.cbShowWarnings.Checked = config.ShowWarnings;

            Helper.SetTextFromSettings(config.XMLFilenameForXSD, this.cbXmlFileForXSD);
        }
Ejemplo n.º 2
0
        public override IConfigService  GetConfigFromUI()
        {
            XsdValidatorConfig conf = new XsdValidatorConfig();

            conf.XMLFilename = cbPath.Text;
            if (dgKeyValue.DataSource != null)
            {
                var fileList = dgKeyValue.DataSource as List <FileInfo>;
                conf.XSDFiles = fileList.ConvertAll(p => p.FullName);
            }
            conf.ShowWarnings = cbShowWarnings.Checked;


            conf.XMLFilenameForXSD = cbXmlFileForXSD.Text;

            return(conf);
        }
Ejemplo n.º 3
0
 public override string GetDefaultWorkspaceFilename()
 {
     return(XsdValidatorConfig.GetWorkspaceFilename());
 }