public static void Save(BinaryWriter writer, TokenBase token)
        {
            TokenType type;
            if(!Types.TryGetValue(token.GetType(), out type))
                throw new NotSupportedException();

            writer.Write((byte)type);
            token.Save(writer);
        }
Example #2
0
 private void CreateEmptyLine(TokenBase token)
 {
     if (_block != null)
     {
         _block.EndLine();
         _block.LastTokenID = token.ID - 1;
         _output.Enqueue(_block);
     }
     _block = new TextTokenBlock
                  {
                      TextAlign = _lastOpenTag.TextProperties.TextAlign,
                      MarginLeft = _marginLeft,
                      MarginRight = _marginRight,
                      FirstTokenID = token.ID,
                      LastTokenID = token.ID,
                      TextIndent = 0.0
                  };
     _firstTokenID = token.ID;
     _textWidth = 0.0;
     _separator = false;
 }