| 123456789101112131415161718192021222324252627282930313233 |
- using System;
- using System.Collections.Generic;
- namespace MuchInfo.Chart.Data.Interfaces
- {
- /// <summary>
- /// 日期数据点接口
- /// </summary>
- public interface IDateDataPoint
- {
- /// <summary>
- /// 时间
- /// </summary>
- DateTime Date { get; set; }
- }
- /// <summary>
- /// 比较时间
- /// </summary>
- public class DataPointComparer<T> : IEqualityComparer<T>
- where T : IDateDataPoint
- {
- public bool Equals(T x, T y)
- {
- return x.Date.CompareTo(y.Date) == 0;
- }
- public int GetHashCode(T obj)
- {
- return obj.Date.GetHashCode();
- }
- }
- }
|