public int CompareTo(object obj) { if (obj is ChartXYValue) { ChartXYValue chartXYValue = (ChartXYValue)obj; return(LqtUtil.DurationToDateTime(this.XValue).CompareTo(LqtUtil.DurationToDateTime(chartXYValue.XValue))); //return 1; } throw new ArgumentException("This object is not of type ChartXYValue"); }
private void RaiseSelectedGroupChanged(ListViewGroup lgroup) { try { if (OnSelectedGroupChanged != null) { IList <ChartXYValue> xyvlues = new List <ChartXYValue>(); foreach (ListViewItem li in lgroup.Items) { ChartXYValue c = new ChartXYValue(); c.XValue = li.SubItems[0].Text; c.YValue = decimal.Parse(li.SubItems[4].Text); xyvlues.Add(c); } OnSelectedGroupChanged(this, new LqtListViewGroupSelectedEventArgs(xyvlues, lgroup.Header)); } } catch { } }