/// <summary>
 /// Initializes a new instance of the <see cref="POIFSWriterEvent"/> class.
 /// </summary>
 /// <param name="stream">the POIFSDocumentWriter, freshly opened</param>
 /// <param name="path">the path of the document</param>
 /// <param name="documentName">the name of the document</param>
 /// <param name="limit">the limit, in bytes, that can be written to the stream</param>
 public POIFSWriterEventArgs(POIFSDocumentWriter stream, POIFSDocumentPath path, string documentName, int limit)
 {
     this.stream = stream;
     this.path = path;
     this.documentName = documentName;
     this.limit = limit;
 }
Exemplo n.º 2
0
 internal virtual void WriteBlocks(Stream stream)
 {
     if (this.Valid)
     {
         if (this.BeforeWriting != null)
         {
             POIFSDocumentWriter stream2 = new POIFSDocumentWriter(stream, this.size);
             OnBeforeWriting(new POIFSWriterEventArgs(stream2, this.path, this.name, this.size));
             stream2.WriteFiller(this.CountBlocks * POIFSConstants.BIG_BLOCK_SIZE, DocumentBlock.FillByte);
         }
         else
         {
             for (int i = 0; i < this.bigBlocks.Length; i++)
             {
                 this.bigBlocks[i].WriteBlocks(stream);
             }
         }
     }
 }
Exemplo n.º 3
0
 internal virtual void WriteBlocks(Stream stream)
 {
     if (this.Valid)
     {
         if (this.BeforeWriting != null)
         {
             POIFSDocumentWriter stream2 = new POIFSDocumentWriter(stream, this.size);
             OnBeforeWriting(new POIFSWriterEventArgs(stream2, this.path, this.name, this.size));
             stream2.WriteFiller(this.CountBlocks * POIFSConstants.BIG_BLOCK_SIZE, DocumentBlock.FillByte);
         }
         else
         {
             for (int i = 0; i < this.bigBlocks.Length; i++)
             {
                 this.bigBlocks[i].WriteBlocks(stream);
             }
         }
     }
 }