/// <summary> /// Load rtf from string /// </summary> /// <param name="text">RTF text</param> /// <returns>is operation successful</returns> public bool LoadRTFText(string text) { //myTokenStack.Clear(); CurrentToken = null; if (text != null && text.Length > 3) { InnerReader = new StringReader(text); _lex = new Lex(InnerReader); return true; } return false; }
/// <summary> /// Load rtf from file /// </summary> /// <param name="fileName">spcial file name</param> /// <returns>is operation successful</returns> public bool LoadRTFFile(string fileName) { CurrentToken = null; if (File.Exists(fileName)) { var stream = new FileStream(fileName, FileMode.Open, FileAccess.Read); InnerReader = new StreamReader(stream, Encoding.ASCII); _stream = stream; _lex = new Lex(InnerReader); return true; } return false; }
/// <summary> /// Load rtf from reader /// </summary> /// <param name="reader">text reader</param> /// <returns>is operation successful</returns> public void LoadReader(TextReader reader) { //.Clear(); CurrentToken = null; InnerReader = reader; _lex = new Lex(InnerReader); }
/// <summary> /// Initialize instance from text reader /// </summary> public Reader(TextReader reader) { CurrentToken = null; InnerReader = reader; _lex = new Lex(InnerReader); }