Пример #1
0
        public RTF(Stream stream)
        {
            source = new StreamReader(stream);

            text_buffer = new StringBuilder(1024);
            //pushed_text_buffer = new StringBuilder(1024);

            rtf_class    = TokenClass.None;
            pushed_class = TokenClass.None;
            pushed_char  = unchecked ((char)-1);

            line_num      = 0;
            line_pos      = 0;
            prev_char     = unchecked ((char)-1);
            bump_line     = false;
            font_list     = null;
            charset_stack = null;

            cur_charset = new Charset();

            destination_callbacks = new DestinationCallback();
            class_callbacks       = new ClassCallback();

            destination_callbacks [Minor.OptDest]   = new DestinationDelegate(HandleOptDest);
            destination_callbacks[Minor.FontTbl]    = new DestinationDelegate(ReadFontTbl);
            destination_callbacks[Minor.ColorTbl]   = new DestinationDelegate(ReadColorTbl);
            destination_callbacks[Minor.StyleSheet] = new DestinationDelegate(ReadStyleSheet);
            destination_callbacks[Minor.Info]       = new DestinationDelegate(ReadInfoGroup);
            destination_callbacks[Minor.Pict]       = new DestinationDelegate(ReadPictGroup);
            destination_callbacks[Minor.Object]     = new DestinationDelegate(ReadObjGroup);
        }
Пример #2
0
		public RTF(Stream stream) {
			source = new StreamReader(stream);

			text_buffer = new StringBuilder(1024);
			//pushed_text_buffer = new StringBuilder(1024);

			rtf_class = TokenClass.None;
			pushed_class = TokenClass.None;
			pushed_char = unchecked((char)-1);

			line_num = 0;
			line_pos = 0;
			prev_char = unchecked((char)-1);
			bump_line = false;

			cur_charset = new Charset();

			destination_callbacks = new DestinationCallback();
			class_callbacks = new ClassCallback();

			destination_callbacks [Minor.OptDest] = new DestinationDelegate (HandleOptDest);
			destination_callbacks[Minor.FontTbl] = new DestinationDelegate(ReadFontTbl);
			destination_callbacks[Minor.ColorTbl] = new DestinationDelegate(ReadColorTbl);
			destination_callbacks[Minor.StyleSheet] = new DestinationDelegate(ReadStyleSheet);
			destination_callbacks[Minor.Info] = new DestinationDelegate(ReadInfoGroup);
			destination_callbacks[Minor.Pict] = new DestinationDelegate(ReadPictGroup);
			destination_callbacks[Minor.Object] = new DestinationDelegate(ReadObjGroup);
		}