/// <summary> /// /// </summary> /// <returns></returns> public virtual ReportItemCollection GetReportItems() { ReportItemCollection reportItems = new ReportItemCollection(); AttributePropertyInfoPairCollection attPropertyInfos = this.GetDeviceDataItemAttributes(); foreach (AttributePropertyInfoPair item in attPropertyInfos) { DataItemAttribute att = item.Attribute; PropertyInfo pi = item.PropertyInfo; object value = pi.GetValue(this, null); ReportItem reportItem = new ReportItem(att.Name, value, att.Unit, att.Format); reportItems.Add(reportItem); } return reportItems; }
/// <summary> /// /// </summary> /// <param name="this1"></param> /// <returns></returns> private ListViewItem CreateListViewItem(int no, ReportItem item) { string[] items = new string[] { no.ToString(), item.Name, item.FormatedValue, item.Unit.Text }; ListViewItem lvi = new ListViewItem(items); lvi.Tag = item; return lvi; }