public BimlFile AddXml(BimlFile bimlFile) { if (!BimlFiles.Any(item => item.FilePath == bimlFile.FilePath)) { BimlFiles.Add(bimlFile); } return bimlFile; }
public void ValidateXDocuments() { foreach (BimlFile bimlFile in BimlFiles) { _currentBimlFile = bimlFile; if (bimlFile.XDocument == null) { try { XDocument.Load(new StringReader(bimlFile.Text), LoadOptions.SetLineInfo | LoadOptions.PreserveWhitespace); } catch (XmlException e) { MessageEngine.Trace(bimlFile.FilePath, e.LineNumber, e.LinePosition, Severity.Error, "V0150", e, e.Message); } } else { bimlFile.XDocument.Validate(SchemaSet, ValidationEventHandler, false); } } IsValidated = true; Id = Guid.NewGuid(); }
public BimlFile AddXml(string fileName, XmlIRDocumentType docType, bool isReadOnly) { var bimlFile = new BimlFile(docType, fileName, isReadOnly); return AddXml(bimlFile); }