rstringrecord.cs

来自「Excel的操作,其中可以读取及写入Excel 文件」· CS 代码 · 共 100 行

CS
100
字号
using System;

using Microsoft.Fawvw.Components.NExcel.Biff;

namespace Microsoft.Fawvw.Components.NExcel.Read.Biff
{
	
	/// <summary> A label which is stored in the cell</summary>
	class RStringRecord:CellValue, LabelCell
	{
		/// <summary> Gets the label
		/// 
		/// </summary>
		/// <returns> the label
		/// </returns>
		virtual public string StringValue
		{
			get
			{
				return _Value;
			}
		}

		/// <summary>
		/// Returns the value.
		/// </summary>
		public override object Value
		{
			get
			{
				return this._Value;
			}
		}


		/// <summary> Gets the cell contents as a string
		/// 
		/// </summary>
		/// <returns> the label
		/// </returns>
		virtual public string Contents
		{
			get
			{
				return _Value;
			}
			
		}
		/// <summary> Accessor for the cell type
		/// 
		/// </summary>
		/// <returns> the cell type
		/// </returns>
		virtual public CellType Type
		{
			get
			{
				return CellType.LABEL;
			}
			
		}
		/// <summary> The .Length of the label in characters</summary>
		private int length;
		/// <summary> The label</summary>
		private string _Value;
		
		/// <summary> Dummy indicators for overloading the constructor</summary>
		public class Biff7
		{
		}
		
		public static Biff7 biff7;
		
		/// <summary> Constructs this object from the raw data
		/// 
		/// </summary>
		/// <param name="t">the raw data
		/// </param>
		/// <param name="fr">the formatting records
		/// </param>
		/// <param name="si">the sheet
		/// </param>
		/// <param name="ws">the workbook settings
		/// </param>
		/// <param name="dummy">dummy overload to indicate a biff 7 workbook
		/// </param>
		public RStringRecord(Record t, FormattingRecords fr, SheetImpl si, WorkbookSettings ws, Biff7 dummy):base(t, fr, si)
		{
			sbyte[] data = getRecord().Data;
			length = IntegerHelper.getInt(data[6], data[7]);
			
			_Value = StringHelper.getString(data, length, 8, ws);
		}
		static RStringRecord()
		{
			biff7 = new Biff7();
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?