コード例 #1
0
ファイル: IconSetRule.cs プロジェクト: Daoting/dt
 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];
     }
 }
コード例 #2
0
ファイル: IconSetRule.cs プロジェクト: Daoting/dt
        /// <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));
            }
        }
コード例 #3
0
ファイル: IconDrawingObject.cs プロジェクト: Daoting/dt
 /// <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;
 }
コード例 #4
0
ファイル: IconSetRule.cs プロジェクト: Daoting/dt
 /// <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);
 }
コード例 #5
0
ファイル: IconSetRule.cs プロジェクト: Daoting/dt
 void Init(Dt.Cells.Data.IconSetType iconSetType)
 {
     this.showIconOnly     = false;
     this.reverseIconOrder = false;
     this.InitIconSetType(iconSetType);
 }
コード例 #6
0
ファイル: IconSetRule.cs プロジェクト: Daoting/dt
 /// <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));
 }