/// <summary> /// Compares this counter with another counter. A cookie can specify /// a specific counter type. /// </summary> /// <param name="other">The other.</param> /// <param name="cookie">The cookie.</param> /// <returns></returns> public virtual double Compare(TreeTableVisibleCounter other, int cookie) { if (other == null) { return(0); } if ((cookie & TreeTableCounterCookies.CountVisible) != 0) { return(GetVisibleCount() - other.GetVisibleCount()); } return(0); }
/// <summary> /// Combines the counter values of this counter object with the values of another counter object /// and returns a new counter object. /// </summary> /// <param name="other">The other.</param> /// <param name="cookie">The cookie.</param> /// <returns></returns> public TreeTableVisibleCounter Combine(TreeTableVisibleCounter other, int cookie) { if (other == null || other.IsEmpty(int.MaxValue)) { return(this); } if (this.IsEmpty(int.MaxValue)) { return(other); } TreeTableVisibleCounter counter = CreateCounter(); counter.visibleCount = GetVisibleCount() + other.GetVisibleCount(); counter.OnCombineCounters(this, other, cookie); return(counter); }