示例#1
0
        public static void LoadXmlFile(
            System.IO.TextReader reader,
            DomDocument document)
        {
            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }
            if (document == null)
            {
                throw new ArgumentNullException("document");
            }
            DomDocument tempDoc = LoadXmlFileWithCreateDocument(reader, document);

            if (tempDoc != null)
            {
                //string txt = tempDoc.GetDebugText() ;
                //System.Windows.Forms.MessageBox.Show(txt);
                document.CopyContent(tempDoc, true);
                document.AfterLoad(FileFormat.XML);
                //txt = txt + "\r\n------------\r\n" + document.GetDebugText();
                //System.Windows.Forms.MessageBox.Show(txt);
            }
            else
            {
                //System.Windows.Forms.MessageBox.Show("Load NULL");
            }
        }
示例#2
0
        public static void LoadXmlFile(
            System.IO.Stream stream,
            DomDocument document)
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }
            if (document == null)
            {
                throw new ArgumentNullException("document");
            }

            DomDocument doc = LoadXmlFileWithCreateDocument(stream, document);

            if (doc != null)
            {
                document.CopyContent(doc, true);
                document.AfterLoad(FileFormat.XML);
            }
        }
示例#3
0
        public static void LoadXmlFile(
            string fileName,
            DomDocument document)
        {
            if (fileName == null)
            {
                throw new ArgumentNullException("fileName");
            }
            if (System.IO.File.Exists(fileName) == false)
            {
                throw new System.IO.FileNotFoundException(fileName);
            }
            if (document == null)
            {
                throw new ArgumentNullException("document");
            }
            DomDocument doc = LoadXmlFileWithCreateDocument(fileName, document);

            if (doc != null)
            {
                document.CopyContent(doc, true);
                document.AfterLoad(FileFormat.XML);
            }
        }