/// <summary> /// Initializes an instance of SLFourIconSetOptions. /// </summary> /// <param name="IconSetType">The type of icon set.</param> public SLFourIconSetOptions(SLFourIconSetValues IconSetType) { this.IconSetType = IconSetType; this.ReverseIconOrder = false; this.ShowIconOnly = false; this.IsCustomIcon = false; this.GreaterThanOrEqual2 = true; this.GreaterThanOrEqual3 = true; this.GreaterThanOrEqual4 = true; switch (IconSetType) { case SLFourIconSetValues.FourArrows: this.vIcon1 = SLIconValues.RedDownArrow; this.vIcon2 = SLIconValues.YellowDownInclineArrow; this.vIcon3 = SLIconValues.YellowUpInclineArrow; this.vIcon4 = SLIconValues.GreenUpArrow; break; case SLFourIconSetValues.FourArrowsGray: this.vIcon1 = SLIconValues.GrayDownArrow; this.vIcon2 = SLIconValues.GrayDownInclineArrow; this.vIcon3 = SLIconValues.GrayUpInclineArrow; this.vIcon4 = SLIconValues.GrayUpArrow; break; case SLFourIconSetValues.FourRating: this.vIcon1 = SLIconValues.SignalMeterWithOneFilledBar; this.vIcon2 = SLIconValues.SignalMeterWithTwoFilledBars; this.vIcon3 = SLIconValues.SignalMeterWithThreeFilledBars; this.vIcon4 = SLIconValues.SignalMeterWithFourFilledBars; break; case SLFourIconSetValues.FourRedToBlack: this.vIcon1 = SLIconValues.BlackCircle; this.vIcon2 = SLIconValues.GrayCircle; this.vIcon3 = SLIconValues.PinkCircle; this.vIcon4 = SLIconValues.RedCircle; break; case SLFourIconSetValues.FourTrafficLights: this.vIcon1 = SLIconValues.BlackCircleWithBorder; this.vIcon2 = SLIconValues.RedCircleWithBorder; this.vIcon3 = SLIconValues.YellowCircle; this.vIcon4 = SLIconValues.GreenCircle; break; } this.Value2 = "25"; this.Value3 = "50"; this.Value4 = "75"; this.Type2 = SLConditionalFormatRangeValues.Percent; this.Type3 = SLConditionalFormatRangeValues.Percent; this.Type4 = SLConditionalFormatRangeValues.Percent; }
/// <summary> /// Set a custom 4-icon set. /// </summary> /// <param name="IconSetType">The type of 4-icon set.</param> /// <param name="ReverseIconOrder">True to reverse the order of the icons. False to use the default order.</param> /// <param name="ShowIconOnly">True to show only icons. False to show both icon and value.</param> /// <param name="GreaterThanOrEqual2">True if values are to be greater than or equal to the 2nd range value. False if values are to be strictly greater than.</param> /// <param name="Value2">The 2nd range value.</param> /// <param name="Type2">The conditional format type for the 2nd range value.</param> /// <param name="GreaterThanOrEqual3">True if values are to be greater than or equal to the 3rd range value. False if values are to be strictly greater than.</param> /// <param name="Value3">The 3rd range value.</param> /// <param name="Type3">The conditional format type for the 3rd range value.</param> /// <param name="GreaterThanOrEqual4">True if values are to be greater than or equal to the 4th range value. False if values are to be strictly greater than.</param> /// <param name="Value4">The 4th range value.</param> /// <param name="Type4">The conditional format type for the 4th range value.</param> public void SetCustomIconSet(SLFourIconSetValues IconSetType, bool ReverseIconOrder, bool ShowIconOnly, bool GreaterThanOrEqual2, string Value2, SLConditionalFormatRangeValues Type2, bool GreaterThanOrEqual3, string Value3, SLConditionalFormatRangeValues Type3, bool GreaterThanOrEqual4, string Value4, SLConditionalFormatRangeValues Type4) { SLFourIconSetOptions Options = new SLFourIconSetOptions(IconSetType); Options.ReverseIconOrder = ReverseIconOrder; Options.ShowIconOnly = ShowIconOnly; Options.GreaterThanOrEqual2 = GreaterThanOrEqual2; Options.Value2 = Value2; Options.Type2 = Type2; Options.GreaterThanOrEqual3 = GreaterThanOrEqual3; Options.Value3 = Value3; Options.Type3 = Type3; Options.GreaterThanOrEqual4 = GreaterThanOrEqual4; Options.Value4 = Value4; Options.Type4 = Type4; this.SetCustomIconSet(Options); }
/// <summary> /// Set a custom 4-icon set. /// </summary> /// <param name="IconSetType">The type of 3-icon set.</param> /// <param name="ReverseIconOrder">True to reverse the order of the icons. False to use the default order.</param> /// <param name="ShowIconOnly">True to show only icons. False to show both icon and value.</param> /// <param name="GreaterThanOrEqual2">True if values are to be greater than or equal to the 2nd range value. False if values are to be strictly greater than.</param> /// <param name="Value2">The 2nd range value.</param> /// <param name="Type2">The conditional format type for the 2nd range value.</param> /// <param name="GreaterThanOrEqual3">True if values are to be greater than or equal to the 3rd range value. False if values are to be strictly greater than.</param> /// <param name="Value3">The 3rd range value.</param> /// <param name="Type3">The conditional format type for the 3rd range value.</param> /// <param name="GreaterThanOrEqual4">True if values are to be greater than or equal to the 4th range value. False if values are to be strictly greater than.</param> /// <param name="Value4">The 4th range value.</param> /// <param name="Type4">The conditional format type for the 4th range value.</param> public void SetCustomIconSet(SLFourIconSetValues IconSetType, bool ReverseIconOrder, bool ShowIconOnly, bool GreaterThanOrEqual2, string Value2, SLConditionalFormatRangeValues Type2, bool GreaterThanOrEqual3, string Value3, SLConditionalFormatRangeValues Type3, bool GreaterThanOrEqual4, string Value4, SLConditionalFormatRangeValues Type4) { SLConditionalFormattingRule cfr = new SLConditionalFormattingRule(); cfr.Type = ConditionalFormatValues.IconSet; cfr.IconSet.Reverse = ReverseIconOrder; cfr.IconSet.ShowValue = !ShowIconOnly; switch (IconSetType) { case SLFourIconSetValues.FourArrows: cfr.IconSet.IconSetValue = IconSetValues.FourArrows; break; case SLFourIconSetValues.FourArrowsGray: cfr.IconSet.IconSetValue = IconSetValues.FourArrowsGray; break; case SLFourIconSetValues.FourRating: cfr.IconSet.IconSetValue = IconSetValues.FourRating; break; case SLFourIconSetValues.FourRedToBlack: cfr.IconSet.IconSetValue = IconSetValues.FourRedToBlack; break; case SLFourIconSetValues.FourTrafficLights: cfr.IconSet.IconSetValue = IconSetValues.FourTrafficLights; break; } SLConditionalFormatValueObject cfvo; cfvo = new SLConditionalFormatValueObject(); cfvo.Type = ConditionalFormatValueObjectValues.Percent; cfvo.Val = "0"; cfr.IconSet.Cfvos.Add(cfvo); cfvo = new SLConditionalFormatValueObject(); cfvo.Type = this.TranslateRangeValues(Type2); cfvo.Val = Value2; cfvo.GreaterThanOrEqual = GreaterThanOrEqual2; cfr.IconSet.Cfvos.Add(cfvo); cfvo = new SLConditionalFormatValueObject(); cfvo.Type = this.TranslateRangeValues(Type3); cfvo.Val = Value3; cfvo.GreaterThanOrEqual = GreaterThanOrEqual3; cfr.IconSet.Cfvos.Add(cfvo); cfvo = new SLConditionalFormatValueObject(); cfvo.Type = this.TranslateRangeValues(Type4); cfvo.Val = Value4; cfvo.GreaterThanOrEqual = GreaterThanOrEqual4; cfr.IconSet.Cfvos.Add(cfvo); cfr.HasIconSet = true; this.AppendRule(cfr); }