示例#1
0
        private void RefreshTree()
        {
            List <GearStats> rowData = new List <GearStats>();

            if (gearSelection.Count > 0)
            {
                string equipmentId             = Options.Instance.GetGearEquipmentId(activity);
                List <SprocketCombo> sprockets = Options.Instance.GetSprocketCombos(equipmentId);

                foreach (SprocketCombo combo in sprockets)
                {
                    INumericTimeDataSeries guessGears = new NumericTimeDataSeries(GearUtils.GuessGears(gearSelection, sprockets));
                    guessGears = GearUtils.RemovePausedTimesInTrack(guessGears, activity);
                    GearStats item = new GearStats(guessGears, combo.GearRatio, activity);
                    rowData.Add(item);
                }

                // Add 'Total' Line
                rowData.Add(new GearStats(rowData));
            }

            treeListStats.Columns.Clear();
            foreach (TreeList.Column column in GetTreeColumns())
            {
                treeListStats.Columns.Add(column);
            }

            treeListStats.RowDataRenderer = new MyRowDataRenderer(treeListStats);
            treeListStats.RowData         = rowData;
        }
示例#2
0
        private bool IsTotalRow(object element)
        {
            GearStats item = element as GearStats;

            if (item != null && item.Ratio == "Total")
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }