WriteDefinition() public method

public WriteDefinition ( Stream result ) : void
result Stream
return void
Ejemplo n.º 1
0
 /**
  * Write the definition part of the colour list. Calls the writeDefinition
  * methods of the RtfColors in the colour list.
  */
 public virtual void WriteDefinition(Stream result)
 {
     result.Write(OPEN_GROUP, 0, OPEN_GROUP.Length);
     result.Write(COLOR_TABLE, 0, COLOR_TABLE.Length);
     for (int i = 0; i < colorList.Count; i++)
     {
         RtfColor color = (RtfColor)colorList[i];
         color.WriteDefinition(result);
     }
     result.Write(CLOSE_GROUP, 0, CLOSE_GROUP.Length);
     this.document.OutputDebugLinebreak(result);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Write the definition part of the colour list. Calls the writeDefinition
 /// methods of the RtfColors in the colour list.
 /// </summary>
 public virtual void WriteDefinition(Stream result)
 {
     result.Write(OpenGroup, 0, OpenGroup.Length);
     result.Write(_colorTable, 0, _colorTable.Length);
     for (int i = 0; i < _colorList.Count; i++)
     {
         RtfColor color = (RtfColor)_colorList[i];
         color.WriteDefinition(result);
     }
     result.Write(CloseGroup, 0, CloseGroup.Length);
     Document.OutputDebugLinebreak(result);
 }
Ejemplo n.º 3
0
        /**
         * Write the definition part of the colour list. Calls the writeDefinition
         * methods of the RtfColors in the colour list.
         *
         * @return A byte array with the definition colour list
         */
        public byte[] WriteDefinition()
        {
            MemoryStream result = new MemoryStream();

            byte[] t;
            try {
                result.Write(OPEN_GROUP, 0, OPEN_GROUP.Length);
                result.Write(COLOR_TABLE, 0, COLOR_TABLE.Length);
                for (int i = 0; i < colorList.Count; i++)
                {
                    RtfColor color = (RtfColor)colorList[i];
                    result.Write(t = color.WriteDefinition(), 0, t.Length);
                }
                result.Write(CLOSE_GROUP, 0, CLOSE_GROUP.Length);
                result.WriteByte((byte)'\n');
            } catch (IOException) {
            }
            return(result.ToArray());
        }