Malt.Reporting.OpenDocument.OdfTemplate.Save C# (CSharp) 메소드

Save() 공개 메소드

public Save ( Stream outStream ) : void
outStream Stream
리턴 void
        public override void Save(Stream outStream)
        {
            if (outStream == null || !outStream.CanWrite)
            {
                throw new ArgumentNullException("outStream");
            }

            //ODF 格式约定 mimetype 必须为第一个文件
            if (!this.entries.ContainsKey(MimeTypeEntryPath))
            {
                throw new InvalidDataException("Entry 'mimetype' not found");
            }

            using (var ze = new ZipFile())
            {
                this.AppendZipEntry(ze, MimeTypeEntryPath);

                foreach (var item in this.entries)
                {
                    if (item.Key == MimeTypeEntryPath)
                    {
                        continue;
                    }

                    this.AppendZipEntry(ze, item.Key);
                }

                ze.Save(outStream);
            }
        }