/// <summary> /// Set a custom 3-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> public void SetCustomIconSet(SLThreeIconSetValues IconSetType, bool ReverseIconOrder, bool ShowIconOnly, bool GreaterThanOrEqual2, string Value2, SLConditionalFormatRangeValues Type2, bool GreaterThanOrEqual3, string Value3, SLConditionalFormatRangeValues Type3) { SLThreeIconSetOptions Options = new SLThreeIconSetOptions(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; this.SetCustomIconSet(Options); }
/// <summary> /// Set a custom 3-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> public void SetCustomIconSet(SLThreeIconSetValues IconSetType, bool ReverseIconOrder, bool ShowIconOnly, bool GreaterThanOrEqual2, string Value2, SLConditionalFormatRangeValues Type2, bool GreaterThanOrEqual3, string Value3, SLConditionalFormatRangeValues Type3) { SLConditionalFormattingRule cfr = new SLConditionalFormattingRule(); cfr.Type = ConditionalFormatValues.IconSet; cfr.IconSet.Reverse = ReverseIconOrder; cfr.IconSet.ShowValue = !ShowIconOnly; switch (IconSetType) { case SLThreeIconSetValues.ThreeArrows: cfr.IconSet.IconSetValue = IconSetValues.ThreeArrows; break; case SLThreeIconSetValues.ThreeArrowsGray: cfr.IconSet.IconSetValue = IconSetValues.ThreeArrowsGray; break; case SLThreeIconSetValues.ThreeFlags: cfr.IconSet.IconSetValue = IconSetValues.ThreeFlags; break; case SLThreeIconSetValues.ThreeSigns: cfr.IconSet.IconSetValue = IconSetValues.ThreeSigns; break; case SLThreeIconSetValues.ThreeSymbols: cfr.IconSet.IconSetValue = IconSetValues.ThreeSymbols; break; case SLThreeIconSetValues.ThreeSymbols2: cfr.IconSet.IconSetValue = IconSetValues.ThreeSymbols2; break; case SLThreeIconSetValues.ThreeTrafficLights1: cfr.IconSet.IconSetValue = IconSetValues.ThreeTrafficLights1; break; case SLThreeIconSetValues.ThreeTrafficLights2: cfr.IconSet.IconSetValue = IconSetValues.ThreeTrafficLights2; 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); cfr.HasIconSet = true; this.AppendRule(cfr); }
/// <summary> /// Initializes an instance of SLThreeIconSetOptions. /// </summary> /// <param name="IconSetType">The type of icon set.</param> public SLThreeIconSetOptions(SLThreeIconSetValues IconSetType) { this.IconSetType = IconSetType; this.ReverseIconOrder = false; this.ShowIconOnly = false; this.IsCustomIcon = false; switch (IconSetType) { case SLThreeIconSetValues.ThreeArrows: this.vIcon1 = SLIconValues.RedDownArrow; this.vIcon2 = SLIconValues.YellowSideArrow; this.vIcon3 = SLIconValues.GreenUpArrow; break; case SLThreeIconSetValues.ThreeArrowsGray: this.vIcon1 = SLIconValues.GrayDownArrow; this.vIcon2 = SLIconValues.GraySideArrow; this.vIcon3 = SLIconValues.GrayUpArrow; break; case SLThreeIconSetValues.ThreeFlags: this.vIcon1 = SLIconValues.RedFlag; this.vIcon2 = SLIconValues.YellowFlag; this.vIcon3 = SLIconValues.GreenFlag; break; case SLThreeIconSetValues.ThreeSigns: this.vIcon1 = SLIconValues.RedDiamond; this.vIcon2 = SLIconValues.YellowTriangle; this.vIcon3 = SLIconValues.GreenCircle; break; case SLThreeIconSetValues.ThreeStars: this.vIcon1 = SLIconValues.SilverStar; this.vIcon2 = SLIconValues.HalfGoldStar; this.vIcon3 = SLIconValues.GoldStar; break; case SLThreeIconSetValues.ThreeSymbols: this.vIcon1 = SLIconValues.RedCrossSymbol; this.vIcon2 = SLIconValues.YellowExclamationSymbol; this.vIcon3 = SLIconValues.GreenCheckSymbol; break; case SLThreeIconSetValues.ThreeSymbols2: this.vIcon1 = SLIconValues.RedCross; this.vIcon2 = SLIconValues.YellowExclamation; this.vIcon3 = SLIconValues.GreenCheck; break; case SLThreeIconSetValues.ThreeTrafficLights1: this.vIcon1 = SLIconValues.RedCircleWithBorder; this.vIcon2 = SLIconValues.YellowCircle; this.vIcon3 = SLIconValues.GreenCircle; break; case SLThreeIconSetValues.ThreeTrafficLights2: this.vIcon1 = SLIconValues.RedTrafficLight; this.vIcon2 = SLIconValues.YellowTrafficLight; this.vIcon3 = SLIconValues.GreenTrafficLight; break; case SLThreeIconSetValues.ThreeTriangles: this.vIcon1 = SLIconValues.RedDownTriangle; this.vIcon2 = SLIconValues.YellowDash; this.vIcon3 = SLIconValues.GreenUpTriangle; break; } this.GreaterThanOrEqual2 = true; this.GreaterThanOrEqual3 = true; this.Value2 = "33"; this.Value3 = "67"; this.Type2 = SLConditionalFormatRangeValues.Percent; this.Type3 = SLConditionalFormatRangeValues.Percent; }