⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 doublevalue.cs

📁 Excel的操作,其中可以读取及写入Excel 文件
💻 CS
字号:
using System;

using Microsoft.Fawvw.Components.NExcel.ExcelCommon;
using Microsoft.Fawvw.Components.NExcel.Biff;

namespace Microsoft.Fawvw.Components.NExcel.Biff.Formula
{
	
	/// <summary> A cell reference in a formula</summary>
	class DoubleValue:NumberValue, ParsedThing
	{
		/// <summary> Gets the token representation of this item in RPN
		/// 
		/// </summary>
		/// <returns> the bytes applicable to this formula
		/// </returns>
		override internal sbyte[] Bytes
		{
			get
			{
				sbyte[] data = new sbyte[9];
				data[0] = Token.DOUBLE.Code;
				
				DoubleHelper.getIEEEBytes(Value, data, 1);
				
				return data;
			}
			
		}
		/// <summary> The logger</summary>
		private static Logger logger;
		
		/// <summary> The value of this double in the formula</summary>
		private double Value;
		
		/// <summary> Constructor</summary>
		public DoubleValue()
		{
		}
		
		/// <summary> Constructor for a double value when reading from a string</summary>
		public DoubleValue(string s)
		{
			try
			{
				Value = System.Double.Parse(s);
			}
			catch (System.FormatException e)
			{
				logger.warn(e, e);
				Value = 0;
			}
		}
		
		/// <summary> Reads the ptg data from the array starting at the specified position
		/// 
		/// </summary>
		/// <param name="data">the RPN array
		/// </param>
		/// <param name="pos">the current position in the array, excluding the ptg identifier
		/// </param>
		/// <returns> the number of bytes read
		/// </returns>
		public override int read(sbyte[] data, int pos)
		{
			Value = DoubleHelper.getIEEEDouble(data, pos);
			
			return 8;
		}
		
		public override double getValue()
		{
			return Value;
		}
		static DoubleValue()
		{
			logger = Logger.getLogger(typeof(DoubleValue));
		}
	}
}

⌨️ 快捷键说明

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