Load() public final méthode

public final Load ( [ filename ) : void
filename [
Résultat void
 public static XmlDocumentEx LoadStream(Stream stream)
 {
     try
     {
         XmlDocument doc = new XmlDocumentEx();
         doc.Load(stream);
         return((XmlDocumentEx)doc);
     }
     catch (Exception ex)
     {
         Log.Warn(ex, string.Format("Cannot load xml. {1}\r\n{2}", ex.Message, Environment.StackTrace));
         return(null);
     }
 }
        public static XmlDocumentEx LoadFile([NotNull] string path)
        {
            Assert.ArgumentNotNull(path, "path");
              if (!FileSystem.FileSystem.Local.File.Exists(path))
              {
            throw new FileIsMissingException("The " + path + " doesn't exists");
              }

              var document = new XmlDocumentEx
              {
            FilePath = path
              };
              document.Load(path);
              return document;
        }
Exemple #3
0
        public static XmlDocumentEx LoadFile([NotNull] string path)
        {
            Assert.ArgumentNotNull(path, "path");
            if (!FileSystem.FileSystem.Local.File.Exists(path))
            {
                throw new FileIsMissingException("The " + path + " doesn't exists");
            }

            var document = new XmlDocumentEx
            {
                FilePath = path
            };

            document.Load(path);
            return(document);
        }
        public static XmlDocumentEx LoadFileSafe([NotNull] string path)
        {
            Assert.ArgumentNotNull(path, "path");

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

            var document = new XmlDocumentEx
            {
                FilePath = path
            };

            document.Load(path);
            return(document);
        }
        public static XmlDocumentEx LoadFileSafe([NotNull] string path)
        {
            Assert.ArgumentNotNull(path, "path");

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

              var document = new XmlDocumentEx
              {
            FilePath = path
              };

              document.Load(path);
              return document;
        }