예제 #1
0
 /// <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;
 }
예제 #2
0
 /// <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;
 }
예제 #3
0
 /// <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);
 }
예제 #4
0
파일: Reader.cs 프로젝트: nitrotm/MSGReader
 /// <summary>
 /// Initialize instance from text reader
 /// </summary>
 public Reader(TextReader reader)
 {
     CurrentToken = null;
     InnerReader  = reader;
     _lex         = new Lex(InnerReader);
 }