Exemplo n.º 1
0
 /// <summary>
 /// Adds the entry from memory stream.
 /// </summary>
 /// <param name="memoryStream">The memory stream.</param>
 /// <param name="entryName">Name of the entry.</param>
 public void AddEntryFromMemoryStream(MemoryStream memoryStream, string entryName)
 {
     if (memoryStream != null)
     {
         this._package.BeginUpdate();
         memoryStream.Flush();
         memoryStream.Position = 0;
         ZipEntry zipEntry = this.GetEntryByName(entryName);
         if (zipEntry != null)
         {
             this._package.Delete(zipEntry);
         }
         ODFMemoryStream odfMemStream = new ODFMemoryStream(memoryStream);
         this._package.Add(odfMemStream, "/" + entryName);
         this._hasChanges = true;
     }
 }
Exemplo n.º 2
0
		/// <summary>
		/// Adds the entry from memory stream.
		/// </summary>
		/// <param name="memoryStream">The memory stream.</param>
		/// <param name="entryName">Name of the entry.</param>
		public void AddEntryFromMemoryStream(MemoryStream memoryStream, string entryName)
		{
			if (memoryStream != null)
			{
                this._package.BeginUpdate();
                memoryStream.Flush();
                memoryStream.Position = 0;
                ZipEntry zipEntry = this.GetEntryByName(entryName);
                if (zipEntry != null)
                {
                    this._package.Delete(zipEntry);
                }
                ODFMemoryStream odfMemStream = new ODFMemoryStream(memoryStream);                
				this._package.Add(odfMemStream, "/"+entryName);
				this._hasChanges = true;
			}
		}