string OpenXmlFrom(string path)
        {
            var             uri   = new Uri(path, UriKind.Relative);
            CompressedEntry entry = compressor.GetEntry(uri.ToString());

            if (entry == null)
            {
                throw new ExcelSheetException(
                          string.Format(CannotFindZipEntryInFile, uri, targetFileName));
            }

            return(entry.Content);
        }
        void SaveSheetDocument(XmlDocument document, string name, string fileName)
        {
            try {
                var sheetStream = new MemoryStream();

                document.Save(sheetStream);
                string xml = StringFrom(sheetStream);

                CompressedEntry entry = compressor.GetEntry(SheetPathWithIdOf(name, fileName));
                entry.Content = xml;
            } catch (Exception e) {
                throw new ExcelSheetException(SaveSheetDocumentErrorMessage + e.Message);
            }
        }
        void SaveSharedStrings()
        {
            try {
                var sheetStream = new MemoryStream();

                sharedStringGateway.Save(sheetStream);
                string xml = StringFrom(sheetStream);

                CompressedEntry entry = compressor.GetEntry(SharedStringsPath);
                entry.Content = xml;
            } catch (Exception e) {
                throw new ExcelSheetException(SaveSharedStringsErrorMessage + e.Message);
            }
        }