You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.1 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Teamcenter.Soa.Client.Model;
using KPlan.Util;
namespace KPlan.Forms {
class TableRowData {
private const string INDEX = "INDEX";
public ModelObject mo { get; set; }
private string title = "";
public TableRowData(ModelObject mo) {
this.mo = mo;
}
public object[] GetRowData(int index,List<string> config) {
int len = config.Count;
object[] res = new object[len];
if (len > 0) {
title = GetPropValue(mo, config[0], index);
res[0] = this;
}
for (int i = 1; i < len; i++) {
res[i] = GetPropValue(mo, config[i],index);
}
return res;
}
private string GetPropValue(ModelObject mo, string config, int index) {
if (INDEX.Equals(config)) {
return index + "";
}
return TCUtil.GetPropValue(mo, config);
}
public override string ToString() {
return title;
}
}
}