escherrecord.cs
来自「Excel的操作,其中可以读取及写入Excel 文件」· CS 代码 · 共 168 行
CS
168 行
using System;
namespace Microsoft.Fawvw.Components.NExcel.Biff.Drawing
{
/// <summary> The base class for all escher records. This class contains
/// the common header data and is basically a wrapper for the EscherRecordData
/// object
/// </summary>
public abstract class EscherRecord
{
/// <summary> Identifies whether this item is a container
///
/// </summary>
/// <param name="cont">TRUE if this is a container, FALSE otherwise
/// </param>
virtual protected internal bool Container
{
set
{
data.setContainer(value);
}
}
/// <summary> Gets the entire .Length of the record, including the header
///
/// </summary>
/// <returns> the .Length of the record, including the header data
/// </returns>
virtual public int Length
{
get
{
return data.getLength() + HEADER_LENGTH;
}
}
/// <summary> Accessor for the escher stream
///
/// </summary>
/// <returns> the escher stream
/// </returns>
virtual protected internal EscherStream EscherStream
{
get
{
return data.EscherStream;
}
}
/// <summary> The position of this escher record in the stream
///
/// </summary>
/// <returns> the position
/// </returns>
virtual protected internal int Pos
{
get
{
return data.Pos;
}
}
/// <summary> Accessor for the instance
///
/// </summary>
/// <returns> the instance
/// </returns>
/// <summary> Sets the instance number when writing out the escher data
///
/// </summary>
/// <param name="i">the instance
/// </param>
virtual protected internal int Instance
{
get
{
return data.Instance;
}
set
{
data.Instance = value;
}
}
/// <summary> Sets the version when writing out the escher data
///
/// </summary>
/// <param name="v">the version
/// </param>
virtual protected internal int Version
{
set
{
data.Version = value;
}
}
/// <summary> Accessor for the escher type
///
/// </summary>
/// <returns> the type
/// </returns>
virtual public EscherRecordType Type
{
get
{
return data.Type;
}
}
/// <summary> Abstract method used to retrieve the generated escher data when writing
/// out image information
///
/// </summary>
/// <returns> the escher data
/// </returns>
public abstract sbyte[] Data{get;}
/// <summary> Gets the data that was read in, excluding the header data
///
/// </summary>
/// <returns> the bytes read in, excluding the header data
/// </returns>
virtual internal sbyte[] Bytes
{
get
{
return data.Bytes;
}
}
/// <summary> The escher data</summary>
private EscherRecordData data;
/// <summary> The .Length of the escher header on all records</summary>
protected internal const int HEADER_LENGTH = 8;
/// <summary> Constructor
///
/// </summary>
/// <param name="erd">the data
/// </param>
protected internal EscherRecord(EscherRecordData erd)
{
data = erd;
}
/// <summary> Constructor
///
/// </summary>
/// <param name="type">the type
/// </param>
protected internal EscherRecord(EscherRecordType type)
{
data = new EscherRecordData(type);
}
/// <summary> Prepends the standard header data to the first eight bytes of the array
/// and returns it
/// </summary>
internal sbyte[] setHeaderData(sbyte[] d)
{
return data.setHeaderData(d);
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?