コード例 #1
0
        public XmlSource ReadXmlIfExists(string filePath)
        {
            var file = TryGetFileInfo(filePath);

            if (!file.Exists)
            {
                return(XmlSource.NonExisting(filePath));
            }
            using (var stream = file.OpenRead())
            {
                return(new XmlSource(file.FullName, XDocument.Load(stream)));
            }
        }