/// <inheritdoc/> protected override ulong CalculateLongHashCode() { var result = base.CalculateLongHashCode(); if (LeftBoundary != null) { LeftBoundary.CheckDirty(); result ^= LeftBoundary.GetLongHashCode(); } if (RightBoundary != null) { RightBoundary.CheckDirty(); result ^= RightBoundary.GetLongHashCode(); } return(result); }
/// <summary> /// Clones the instance using special context and returns cloned instance. /// </summary> /// <param name="context">Special context for providing references continuity.</param> /// <returns>Cloned instance.</returns> public RangeValue Clone(Dictionary <object, object> context) { if (context.ContainsKey(this)) { return((RangeValue)context[this]); } var result = new RangeValue(); context[this] = result; result.LeftBoundary = LeftBoundary?.Clone(context); result.RightBoundary = RightBoundary?.Clone(context); result.AppendAnnotations(this, context); return(result); }
public CellToken(IEnumerable <IToken> tokens, CellToken previous) { foreach (var token in tokens) { if (token is CellWidth width) { Width = width.Value; } else if (token is CellWidthType widthType) { WidthUnit = widthType.Value; } else if (token is RightCellBoundary rightBoundary) { RightBoundary = rightBoundary.Value; } else { _styles.Add(token); } } if (WidthUnit == CellWidthUnit.Null) { WidthUnit = CellWidthUnit.Twip; if (previous == null) { Width = RightBoundary.ToTwip(); } else { Width = (RightBoundary - previous.RightBoundary).ToTwip(); } } Index = previous == null ? 0 : previous.Index + 1; }