public void SetArchiveDumpData(FetchData data) { DataListView.Items.Clear(); DataListView.BeginUpdate(); DateTime[] dates = data.getDateTimestamps(); int count = dates.Length; double[] values = data.getValues()[0]; for (var i = 0; i < count; i++) { if (double.IsNaN(data.getValues()[0][i])) { continue; } ListViewItem lvi = DataListView.Items.Add(dates[i].ToString()); lvi.SubItems.Add(values[i].ToString()); } DataListView.EndUpdate(); }
public void LoadDataListViewSettings(DataListView listView) { if (listView == null) { throw new ArgumentNullException(); } listView.BeginUpdate(); DataListViewSettings.SerializableDataListViewInfo serializableDataListViewInfo = this.FindSuitableSetting(listView); if (serializableDataListViewInfo == null) { listView.SortDirection = ListSortDirection.Ascending; } else { listView.SortDirection = serializableDataListViewInfo.SortDirection; listView.SortProperty = serializableDataListViewInfo.SortProperty; listView.IsColumnsWidthDirty = serializableDataListViewInfo.IsColumnsWidthDirty; int length = serializableDataListViewInfo.Columns.GetLength(0); ArrayList arrayList = new ArrayList(length); int num = 0; for (int i = 0; i < length; i++) { if (!string.IsNullOrEmpty(serializableDataListViewInfo.Columns[i].ColumnName)) { ExchangeColumnHeader exchangeColumnHeader = listView.AvailableColumns[serializableDataListViewInfo.Columns[i].ColumnName]; exchangeColumnHeader.Visible = true; exchangeColumnHeader.Width = serializableDataListViewInfo.Columns[i].ColumnWidth; exchangeColumnHeader.DisplayIndex = num++; arrayList.Add(exchangeColumnHeader); } } if (arrayList.Count > 0) { foreach (ExchangeColumnHeader exchangeColumnHeader2 in listView.AvailableColumns) { exchangeColumnHeader2.Visible = arrayList.Contains(exchangeColumnHeader2); } } } listView.EndUpdate(); }