/// <summary> /// Initializes a new XlsDocument from the provided stream, reading in as much information /// from the file as possible and representing it appropriately with MyXls objects /// (Workbook, Worksheets, Cells, etc.). /// </summary> /// <param name="stream">The stream to read into this XlsDocument.</param> public XlsDocument(System.IO.Stream stream) { if (stream == null) throw new ArgumentException("Can't be null", "stream"); _ole2Doc = new Ole2Document(); _ole2Doc.Load(stream); //TODO: SummaryInformationSection and DocumentSummaryInformationSections should be read by MyOle2 _workbook = new Workbook(this, _ole2Doc.Streams[_ole2Doc.Streams.GetIndex(org.in2bits.MyOle2.Directory.Biff8Workbook)].Bytes, null); }
internal XFs(XlsDocument doc, Workbook workbook) { _doc = doc; _workbook = workbook; _xfs = new List<XF>(); AddDefaultStyleXFs(); AddDefaultUserXF(); //AddDefaultFormattedStyleXFs(); //what was I thinking about here? }
/// <summary> /// Initializes a new instance of the XlsDocument class. /// </summary> public XlsDocument() { _forceStandardOle2Stream = false; _isLittleEndian = true; _ole2Doc = new MyOle2.Ole2Document(); SetOleDefaults(); _summaryInformation = new SummaryInformationSection(); _documentSummaryInformation = new DocumentSummaryInformationSection(); _workbook = new Workbook(this); }
internal XlsDocument(string fileName, Workbook.BytesReadCallback workbookBytesReadCallback) { if (string.IsNullOrEmpty(fileName)) throw new ArgumentException("Can't be null or Empty", "fileName"); if (!File.Exists(fileName)) #if SILVERLIGHT throw new FileNotFoundException(string.Format("Excel File not found: {0}", fileName)); #else throw new FileNotFoundException("Excel File not found", fileName); #endif _ole2Doc = new Ole2Document(); using (FileStream fileStream = File.Open(fileName, FileMode.Open, FileAccess.Read, FileShare.Read)) { _ole2Doc.Load(fileStream); } //TODO: SummaryInformationSection and DocumentSummaryInformationSections should be read by MyOle2 _workbook = new Workbook(this, _ole2Doc.Streams[_ole2Doc.Streams.GetIndex(org.in2bits.MyOle2.Directory.Biff8Workbook)].Bytes, workbookBytesReadCallback); }
internal Palette(Workbook workbook) { _workbook = workbook; InitDefaultPalette(); }