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

📄 arraypropertydescriptor.cs

📁 分析家数据格式解析源码。日线行情、分笔成交
💻 CS
字号:
// Static Model

namespace FinData
{

	using System;
	using System.Diagnostics;
	using System.ComponentModel;
	/// <summary>
	/// Property decriptor for array
	/// </summary>
	public class ArrayPropertyDescriptor	: PropertyDescriptor
	{
		private string		_name;
		private Type		_type;
		private int			_index;

		public ArrayPropertyDescriptor(string name,Type type,int index) : base (name,null)
		{
			_name	= name;
			_type	= type;
			_index  = index;
		}

		public override string DisplayName
		{
			get
			{
				return _name;
			}
		}

		public override Type ComponentType
		{
			get
			{
				return typeof(ArrayRowView);
			}
		}
		
		public override bool IsReadOnly
		{
			get
			{
				return false;
			}
		}
		public override Type PropertyType
		{
			get
			{
				return _type;
			}
		}
		
		public override object GetValue(object component)
		{
			try
			{

				return ((ArrayRowView)component).GetColumn(_index);
			}
			catch(Exception e)
			{
				Debug.WriteLine(e);
			}

			Debug.Assert(false);

			return null;
		}

		public override void SetValue(object component, object value)
		{
			try
			{
				((ArrayRowView)component).SetColumnValue(_index,value);
			}
			catch(Exception e)
			{
				Debug.WriteLine(e);
				Debug.Assert(false);
			}

			
		}

		public override bool CanResetValue(object component)
		{
			return false;
		}
		public override void ResetValue(object component)
		{
			
		}
		public override bool ShouldSerializeValue(object component)
		{
			return false;
		}
	}// END CLASS DEFINITION ArrayPropertyDescriptor

} // FinData

⌨️ 快捷键说明

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