1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace Biff8Excel.Excel
- {
- public enum Visibility
- {
- Visible = 0x0,
- Hidden = 0x1
- }
- public class BoundSheet : IDisposable
- {
- uint m_byteOffset; // Offset in the file stream of this bundlesheet
- Biff8Excel.Records.BoundSheet m_boundSheet;
- string m_sheetname;
- public BoundSheet()
- {
- m_boundSheet = new Biff8Excel.Records.BoundSheet();
- }
- /// <summary>
- /// 取得或设定Sheet工作表名称
- /// </summary>
- public string SheetName
- {
- set
- {
- m_sheetname = value;
- m_boundSheet.StreamName = m_sheetname;
- }
- get
- {
- return m_sheetname;
- }
- }
- internal uint SheetOffset
- {
- set { m_boundSheet.StreamPosition = value; }
- }
- internal uint StreamOffset
- {
- set { m_byteOffset = value; }
- get { return m_byteOffset; }
- }
- public Visibility Visible
- {
- set
- {
- if (value == 0)
- m_boundSheet.Visible = (byte)Visibility.Visible;
- else
- m_boundSheet.Visible = (byte)Visibility.Hidden;
- }
- }
- internal byte[] WriteRecord
- {
- get { return m_boundSheet.GetByte(); }
- }
- #region IDisposable 成员
- public void Dispose(bool disposed)
- {
- if (disposed)
- {
- m_boundSheet = null;
- m_sheetname = null;
- }
- this.Dispose();
- }
- public void Dispose()
- {
- //GC.SuppressFinalize(this);
- }
- #endregion
- }
- }
|