arraypropertydescriptor.cs
来自「分析家数据格式解析源码。日线行情、分笔成交」· CS 代码 · 共 103 行
CS
103 行
// 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 + =
减小字号Ctrl + -
显示快捷键?