/// <summary>
 /// Highlight cells with date values occurring according to a given time period.
 /// </summary>
 /// <param name="DatePeriod">A given time period.</param>
 /// <param name="HighlightStyle">A built-in highlight style.</param>
 public void HighlightCellsWithDatesOccurring(TimePeriodValues DatePeriod, SLHighlightCellsStyleValues HighlightStyle)
 {
     this.HighlightCellsWithDatesOccurring(DatePeriod, this.TranslateToDifferentialFormat(HighlightStyle));
 }
 /// <summary>
 /// Highlight cells with values in the top/bottom range.
 /// </summary>
 /// <param name="IsTopRange">True if in the top range. False if in the bottom range.</param>
 /// <param name="Rank">The value of X in "Top/Bottom X". If <paramref name="IsPercent"/> is true, then X refers to X%, otherwise it's X number of items.</param>
 /// <param name="IsPercent">True if referring to percentage. False if referring to number of items.</param>
 /// <param name="HighlightStyle">A built-in highlight style.</param>
 public void HighlightCellsInTopRange(bool IsTopRange, uint Rank, bool IsPercent, SLHighlightCellsStyleValues HighlightStyle)
 {
     this.HighlightCellsInTopRange(IsTopRange, Rank, IsPercent, this.TranslateToDifferentialFormat(HighlightStyle));
 }
 /// <summary>
 /// Highlight cells with values less than a given value.
 /// </summary>
 /// <param name="IncludeEquality">True for less than or equal to. False for strictly less than.</param>
 /// <param name="Value">The value to be compared with.</param>
 /// <param name="HighlightStyle">A built-in highlight style.</param>
 public void HighlightCellsLessThan(bool IncludeEquality, string Value, SLHighlightCellsStyleValues HighlightStyle)
 {
     this.HighlightCellsLessThan(IncludeEquality, Value, this.TranslateToDifferentialFormat(HighlightStyle));
 }
 /// <summary>
 /// Highlight cells with values ending with a given value.
 /// </summary>
 /// <param name="Value">The value to be compared with.</param>
 /// <param name="HighlightStyle">A built-in highlight style.</param>
 public void HighlightCellsEndingWith(string Value, SLHighlightCellsStyleValues HighlightStyle)
 {
     this.HighlightCellsEndingWith(Value, this.TranslateToDifferentialFormat(HighlightStyle));
 }
 /// <summary>
 /// Highlight cells with values equal to a given value.
 /// </summary>
 /// <param name="IsEqual">True for equal to given value. False for not equal to given value.</param>
 /// <param name="Value">The value to be compared with.</param>
 /// <param name="HighlightStyle">A built-in highlight style.</param>
 public void HighlightCellsEqual(bool IsEqual, string Value, SLHighlightCellsStyleValues HighlightStyle)
 {
     this.HighlightCellsEqual(IsEqual, Value, this.TranslateToDifferentialFormat(HighlightStyle));
 }
 /// <summary>
 /// Highlight cells containing errors.
 /// </summary>
 /// <param name="ContainsErrors">True for containing errors. False for not containing errors.</param>
 /// <param name="HighlightStyle">A built-in highlight style.</param>
 public void HighlightCellsContainingErrors(bool ContainsErrors, SLHighlightCellsStyleValues HighlightStyle)
 {
     this.HighlightCellsContainingErrors(ContainsErrors, this.TranslateToDifferentialFormat(HighlightStyle));
 }
 /// <summary>
 /// Highlight cells with values containing a given value.
 /// </summary>
 /// <param name="IsContaining">True for containing given value. False for not containing given value.</param>
 /// <param name="Value">The value to be compared with.</param>
 /// <param name="HighlightStyle">A built-in highlight style.</param>
 public void HighlightCellsContainingText(bool IsContaining, string Value, SLHighlightCellsStyleValues HighlightStyle)
 {
     this.HighlightCellsContainingText(IsContaining, Value, this.TranslateToDifferentialFormat(HighlightStyle));
 }
 /// <summary>
 /// Highlight cells with values between 2 given values.
 /// </summary>
 /// <param name="IsBetween">True for between the 2 given values. False for not between the 2 given values.</param>
 /// <param name="Value1">The 1st value to be compared with.</param>
 /// <param name="Value2">The 2nd value to be compared with.</param>
 /// <param name="HighlightStyle">A built-in highlight style.</param>
 public void HighlightCellsBetween(bool IsBetween, string Value1, string Value2, SLHighlightCellsStyleValues HighlightStyle)
 {
     this.HighlightCellsBetween(IsBetween, Value1, Value2, this.TranslateToDifferentialFormat(HighlightStyle));
 }
 /// <summary>
 /// Highlight cells with values compared to the average.
 /// </summary>
 /// <param name="AverageType">The type of comparison to the average.</param>
 /// <param name="HighlightStyle">A built-in highlight style.</param>
 public void HighlightCellsAboveAverage(SLHighlightCellsAboveAverageValues AverageType, SLHighlightCellsStyleValues HighlightStyle)
 {
     this.HighlightCellsAboveAverage(AverageType, this.TranslateToDifferentialFormat(HighlightStyle));
 }
        internal SLDifferentialFormat TranslateToDifferentialFormat(SLHighlightCellsStyleValues style)
        {
            SLDifferentialFormat df = new SLDifferentialFormat();
            switch (style)
            {
                case SLHighlightCellsStyleValues.LightRedFillWithDarkRedText:
                    df.Font.Condense = false;
                    df.Font.Extend = false;
                    df.Font.FontColor = System.Drawing.Color.FromArgb(0xFF, 0x9C, 0x00, 0x06);
                    df.Fill.SetPatternBackgroundColor(System.Drawing.Color.FromArgb(0xFF, 0xFF, 0xC7, 0xCE));
                    break;
                case SLHighlightCellsStyleValues.YellowFillWithDarkYellowText:
                    df.Font.Condense = false;
                    df.Font.Extend = false;
                    df.Font.FontColor = System.Drawing.Color.FromArgb(0xFF, 0x9C, 0x65, 0x00);
                    df.Fill.SetPatternBackgroundColor(System.Drawing.Color.FromArgb(0xFF, 0xFF, 0xEB, 0x9C));
                    break;
                case SLHighlightCellsStyleValues.GreenFillWithDarkGreenText:
                    df.Font.Condense = false;
                    df.Font.Extend = false;
                    df.Font.FontColor = System.Drawing.Color.FromArgb(0xFF, 0x00, 0x61, 0x00);
                    df.Fill.SetPatternBackgroundColor(System.Drawing.Color.FromArgb(0xFF, 0xC6, 0xEF, 0xCE));
                    break;
                case SLHighlightCellsStyleValues.LightRedFill:
                    df.Fill.SetPatternBackgroundColor(System.Drawing.Color.FromArgb(0xFF, 0xFF, 0xC7, 0xCE));
                    break;
                case SLHighlightCellsStyleValues.RedText:
                    df.Font.Condense = false;
                    df.Font.Extend = false;
                    df.Font.FontColor = System.Drawing.Color.FromArgb(0xFF, 0x9C, 0x00, 0x06);
                    break;
                case SLHighlightCellsStyleValues.RedBorder:
                    df.Border.SetLeftBorder(BorderStyleValues.Thin, System.Drawing.Color.FromArgb(0xFF, 0x9C, 0x00, 0x06));
                    df.Border.SetRightBorder(BorderStyleValues.Thin, System.Drawing.Color.FromArgb(0xFF, 0x9C, 0x00, 0x06));
                    df.Border.SetTopBorder(BorderStyleValues.Thin, System.Drawing.Color.FromArgb(0xFF, 0x9C, 0x00, 0x06));
                    df.Border.SetBottomBorder(BorderStyleValues.Thin, System.Drawing.Color.FromArgb(0xFF, 0x9C, 0x00, 0x06));
                    break;
            }

            df.Sync();
            return df;
        }
 /// <summary>
 /// Highlight cells with unique values.
 /// </summary>
 /// <param name="HighlightStyle">A built-in highlight style.</param>
 public void HighlightCellsWithUniques(SLHighlightCellsStyleValues HighlightStyle)
 {
     this.HighlightCellsWithUniques(this.TranslateToDifferentialFormat(HighlightStyle));
 }
 /// <summary>
 /// Highlight cells with values according to a formula.
 /// </summary>
 /// <param name="Formula">The formula to apply.</param>
 /// <param name="HighlightStyle">A built-in highlight style.</param>
 public void HighlightCellsWithFormula(string Formula, SLHighlightCellsStyleValues HighlightStyle)
 {
     this.HighlightCellsWithFormula(Formula, this.TranslateToDifferentialFormat(HighlightStyle));
 }