public object this[int row, string colName] { get { int index = _column.GetIndexByName(colName); return(this[row, index]); } set { int index = _column.GetIndexByName(colName); this[row, index] = value; } }
/// <summary> /// 索引器 /// </summary> /// <param name="name">名称</param> /// <returns>数据</returns> public object this[string name] { get { if (null == _column) { throw new ArgumentException("当前行不存在列"); } int index = _column.GetIndexByName(name); return(this[index]); } set { if (null == _column) { throw new ArgumentException("当前行不存在列"); } int index = _column.GetIndexByName(name); this[index] = value; } }