void InitIconSetType(Dt.Cells.Data.IconSetType iconSetType) { this.iconSetType = iconSetType; if ((this.iconSetType >= Dt.Cells.Data.IconSetType.ThreeArrowsColored) && (this.iconSetType <= Dt.Cells.Data.IconSetType.ThreeSymbolsUncircled)) { this.iconCriteria = new IconCriterion[] { new IconCriterion(true, IconValueType.Percent, (int)0x21), new IconCriterion(true, IconValueType.Percent, (int)0x43) }; } else if ((this.iconSetType >= Dt.Cells.Data.IconSetType.FourArrowsColored) && (this.iconSetType <= Dt.Cells.Data.IconSetType.FourTrafficLights)) { this.iconCriteria = new IconCriterion[] { new IconCriterion(true, IconValueType.Percent, (int)0x19), new IconCriterion(true, IconValueType.Percent, (int)50), new IconCriterion(true, IconValueType.Percent, (int)0x4b) }; } else if ((this.iconSetType >= Dt.Cells.Data.IconSetType.FiveArrowsColored) && (this.iconSetType <= Dt.Cells.Data.IconSetType.FiveBoxes)) { this.iconCriteria = new IconCriterion[] { new IconCriterion(true, IconValueType.Percent, (int)20), new IconCriterion(true, IconValueType.Percent, (int)40), new IconCriterion(true, IconValueType.Percent, (int)60), new IconCriterion(true, IconValueType.Percent, (int)80) }; } else if (this.iconSetType > Dt.Cells.Data.IconSetType.FiveBoxes) { this.iconCriteria = new IconCriterion[0]; } }
/// <summary> /// Generates the rule from its XML representation. /// </summary> /// <param name="reader">The XML reader.</param> protected override void OnReadXml(XmlReader reader) { base.OnReadXml(reader); string name = reader.Name; if (name != null) { if (name != "IconSetType") { if (name != "ReverseIconOrder") { if (name == "ShowIconOnly") { this.showIconOnly = (bool)((bool)Serializer.DeserializeObj(typeof(bool), reader)); return; } if (name == "IconCriteria") { List <IconCriterion> list = new List <IconCriterion>(); Serializer.DeserializeList((IList)list, reader); if (list != null) { this.iconCriteria = list.ToArray(); } } return; } } else { this.iconSetType = (Dt.Cells.Data.IconSetType)Serializer.DeserializeObj(typeof(Dt.Cells.Data.IconSetType), reader); return; } this.reverseIconOrder = (bool)((bool)Serializer.DeserializeObj(typeof(bool), reader)); } }
/// <summary> /// Constructs an icon object with the specified row index, column index, icon set type, icon collection index, and icon or icon and data. /// </summary> /// <param name="rowIndex">The row index.</param> /// <param name="columnIndex">The column index.</param> /// <param name="iconSetType">The icon set type.</param> /// <param name="indexOfIcon">The index of the icon collection.</param> /// <param name="showIconOnly"> /// <c>true</c>Show bar only; otherwise, <c>false</c> /// </param> public IconDrawingObject(int rowIndex, int columnIndex, Dt.Cells.Data.IconSetType iconSetType, int indexOfIcon, bool showIconOnly) : base(rowIndex, columnIndex) { this.iconSetType = iconSetType; this.indexOfIcon = indexOfIcon; this.showIconOnly = showIconOnly; }
/// <summary> /// Creates a new icon set rule with a specified icon set type. /// </summary> /// <param name="iconSetType">Type of icon set.</param> internal IconSetRule(Dt.Cells.Data.IconSetType iconSetType) : base(null) { this.Init(iconSetType); }
void Init(Dt.Cells.Data.IconSetType iconSetType) { this.showIconOnly = false; this.reverseIconOrder = false; this.InitIconSetType(iconSetType); }
/// <summary> /// Creates a new icon rule set based on the specified parameter. /// </summary> /// <param name="iconSetType">The icon set type.</param> /// <returns>Returns the icon set rule object.</returns> public static IconSetRule Create(Dt.Cells.Data.IconSetType iconSetType) { return(new IconSetRule(iconSetType)); }