/// <summary> /// Initializes a new instance of the class. /// </summary> public TrendTablePage(int pageNumber, TrendTable trendTable, TrendTableMeta meta) { IsReady = false; PageNumber = pageNumber; PageIndex = pageNumber - 1; TrendTable = trendTable ?? throw new ArgumentNullException(nameof(trendTable)); Metadata = meta ?? throw new ArgumentNullException(nameof(meta)); CnlNumList = null; }
/// <summary> /// Determines whether two object instances are equal. /// </summary> public bool Equals(TrendTableMeta meta) { return(meta == this || meta != null && meta.MinTimestamp == MinTimestamp && meta.MaxTimestamp == MaxTimestamp && meta.WritingPeriod == WritingPeriod && meta.PageCapacity == PageCapacity); }
/// <summary> /// Sets the table metadata based on the table date and writing period. /// </summary> public void SetDefaultMetadata() { Metadata = new TrendTableMeta { MinTimestamp = TableDate, MaxTimestamp = TableDate.AddDays(1.0), WritingPeriod = WritingPeriod, PageCapacity = GetPageCapacity() }; Pages = CreatePages(); }
/// <summary> /// Sets the table metadata. /// </summary> public void SetMetadata(TrendTableMeta meta) { if (meta == null) { throw new ArgumentNullException(nameof(meta)); } TableDate = meta.MinTimestamp.Date; WritingPeriod = meta.WritingPeriod; TableCapacity = GetTableCapacity(); Metadata = meta; Pages = CreatePages(); }