//internal static bool LoadOldXmlFile( // System.IO.Stream stream, // XTextDocument document ) //{ // if (stream == null) // { // throw new ArgumentNullException("stream"); // } // if (document == null) // { // throw new ArgumentNullException("document"); // } // System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument(); // xmlDoc.Load( stream ); // DCSoft.CSharpWriter.Xml.OldXMLLoader loader = new Xml.OldXMLLoader(); // return loader.LoadOldXml(document, xmlDoc.DocumentElement); //} //internal static bool LoadOldXmlFile( // System.IO.TextReader reader, // XTextDocument document) //{ // if (reader == null) // { // throw new ArgumentNullException("reader"); // } // if (document == null) // { // throw new ArgumentNullException("document"); // } // System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument(); // xmlDoc.Load(reader); // DCSoft.CSharpWriter.Xml.OldXMLLoader loader = new Xml.OldXMLLoader(); // return loader.LoadOldXml(document, xmlDoc.DocumentElement); //} public static void LoadRTFFile(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"); } using (StreamReader reader = new StreamReader( fileName, Encoding.Default, true)) { RTFLoader loader = new RTFLoader(); loader.Load(reader); loader.EnableDocumentSetting = true; loader.ReadContent(document); } }
public static void LoadRTFFile( TextReader reader, DomDocument document) { if (reader == null) { throw new ArgumentNullException("reader"); } if (document == null) { throw new ArgumentNullException("document"); } RTFLoader loader = new RTFLoader(); loader.Load(reader); loader.EnableDocumentSetting = true; loader.ReadContent(document); }
//public static void LoadHtmlFile( // System.IO.Stream stream , // XTextDocument document) //{ // if (url == null) // { // throw new ArgumentNullException("url"); // } // if (document == null) // { // throw new ArgumentNullException("document"); // } // HTMLDocument htmlDoc = new HTMLDocument(); // htmlDoc.LoadUrl(url); // HtmlLoader loader = new HtmlLoader(); // loader.Load(htmlDoc, document); // document.AfterLoad(FileFormat.Html); //} public static void LoadRTFFile( Stream stream, DomDocument document) { if (stream == null) { throw new ArgumentNullException("stream"); } if (document == null) { throw new ArgumentNullException("document"); } StreamReader reader = new StreamReader( stream, Encoding.Default, true); RTFLoader loader = new RTFLoader(); loader.Load(reader); loader.EnableDocumentSetting = true; loader.ReadContent(document); }