public InfoSearchItem(IRecWorkMainData data) { tIdx = dTypes.IndexOf(data.GetType()); tIdx = tIdx < 0 ? dTypes.Count - 1 : tIdx; this.Data = data; ViewItem = Activator.CreateInstance(vTypes[tIdx], data) as DataListItemBase; }
private string ToMenuString(IRecWorkMainData data) { string s = (data.DataTitle == "" ? "(空白)" : data.DataTitle); if (data is ManualAutoAddData) { var view = new ManualAutoAddDataItem(data as ManualAutoAddData); s = string.Format("({0}){1} {2}", view.DayOfWeek, view.StartTimeShort, s); } return(s); }
class DummyType { public DummyType(IRecWorkMainData data) { }
public static IEnumerable <InfoSearchItem> Items(IRecWorkMainData d) { return(new List <InfoSearchItem> { new InfoSearchItem(d) }); }