internal ExcelStyles(XmlNamespaceManager NameSpaceManager, XmlDocument xml, ExcelWorkbook wb) : base(NameSpaceManager, xml) { _styleXml=xml; _wb = wb; _nameSpaceManager = NameSpaceManager; SchemaNodeOrder = new string[] { "numFmts", "fonts", "fills", "borders", "cellStyleXfs", "cellXfs", "cellStyles", "dxfs" }; LoadFromDocument(); }
internal ExcelNamedRangeCollection(ExcelWorkbook wb, ExcelWorksheet ws) { _wb = wb; _ws = ws; }
internal ExcelNamedRangeCollection(ExcelWorkbook wb) { _wb = wb; _ws = null; }
internal ExcelNamedRange(string name, ExcelWorkbook wb, ExcelWorksheet nameSheet) : base(wb, nameSheet, name, true) { Name = name; _sheet = nameSheet; }
/// <summary> /// Creates a new ExcelWorkbookView which provides access to all the /// view states of the worksheet. /// </summary> /// <param name="ns"></param> /// <param name="node"></param> /// <param name="wb"></param> internal ExcelWorkbookView(XmlNamespaceManager ns, XmlNode node, ExcelWorkbook wb) : base(ns, node) { SchemaNodeOrder = wb.SchemaNodeOrder; }
internal ExcelProtection(XmlNamespaceManager ns, XmlNode topNode, ExcelWorkbook wb) : base(ns, topNode) { SchemaNodeOrder = wb.SchemaNodeOrder; }
internal ExcelNamedRange(string name,ExcelWorkbook wb, ExcelWorksheet nameSheet) : base(wb, nameSheet, name, true) { Name = name; _sheet = nameSheet; }
/// <summary> /// /// </summary> /// <param name="input"></param> /// <param name="output"></param> /// <param name="Password"></param> private void Load(Stream input, Stream output, string Password) { //Release some resources: if (this._package != null) { this._package.Close(); this._package = null; } if (this._stream != null) { this._stream.Close(); this._stream.Dispose(); this._stream = null; } if (Password != null) { Stream encrStream = new MemoryStream(); CopyStream(input, ref encrStream); EncryptedPackageHandler eph=new EncryptedPackageHandler(); Encryption.Password = Password; this._stream = eph.DecryptPackage((MemoryStream)encrStream, Encryption); } else { this._stream = output; CopyStream(input, ref this._stream); } try { this._package = Package.Open(this._stream, FileMode.Open, FileAccess.ReadWrite); } catch (Exception ex) { EncryptedPackageHandler eph = new EncryptedPackageHandler(); if (Password == null && EncryptedPackageHandler.IsStorageILockBytes(eph.GetLockbyte((MemoryStream)_stream)) == 0) { throw new Exception("Can not open the package. Package is an OLE compound document. If this is an encrypted package, please supply the password", ex); } else { throw (ex); } } //Clear the workbook so that it gets reinitialized next time this._workbook = null; }