示例#1
0
文件: XmlIR.cs 项目: japj/vulcan
        public BimlFile AddXml(BimlFile bimlFile)
        {
            if (!BimlFiles.Any(item => item.FilePath == bimlFile.FilePath))
            {
                BimlFiles.Add(bimlFile);
            }

            return bimlFile;
        }
示例#2
0
文件: XmlIR.cs 项目: japj/vulcan
        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();
        }
示例#3
0
文件: XmlIR.cs 项目: japj/vulcan
 public BimlFile AddXml(string fileName, XmlIRDocumentType docType, bool isReadOnly)
 {
     var bimlFile = new BimlFile(docType, fileName, isReadOnly);
     return AddXml(bimlFile);
 }