Пример #1
0
        private void DrawSegmentTimer(Graphics graphics)
        {
            TextFormatFlags segmentTimeFlags     = TextFormatFlags.Left | TextFormatFlags.Bottom | TextFormatFlags.WordEllipsis;
            TextFormatFlags segmentBestTimeFlags = TextFormatFlags.Left | TextFormatFlags.Top | TextFormatFlags.WordEllipsis;

            Rectangle segmentTimeRectangle    = new Rectangle(0, watchRectangle.Y + watchRectangle.Height, DEFAULT_WIDTH / 2, DEFAULT_HEIGHT / 2);
            Rectangle segmentBestimeRectangle = new Rectangle(0, segmentTimeRectangle.Y + segmentTimeRectangle.Height, DEFAULT_WIDTH / 2, DEFAULT_HEIGHT / 2);
            Rectangle segmentTimerRectangle   = new Rectangle(DEFAULT_WIDTH / 2, watchRectangle.Y + watchRectangle.Height, DEFAULT_WIDTH / 2, DEFAULT_HEIGHT);

            graphics.FillRectangle(new SolidBrush(Settings.Default.SegmentTimerBackgroundColor), segmentTimeRectangle);
            graphics.FillRectangle(new SolidBrush(Settings.Default.SegmentTimerBackgroundColor), segmentBestimeRectangle);
            graphics.FillRectangle(new SolidBrush(Settings.Default.SegmentTimerBackgroundColor), segmentTimerRectangle);

            String segmentTime     = (this.split.RunStatus == RunStatus.ON_GOING) ? FaceSplitUtils.TimeFormat(this.split.CurrentSegment.BackupSegmentTime) : FaceSplitUtils.TimeFormat(this.split.Segments.Last().BackupSegmentTime);
            String segmentBestTime = (this.split.RunStatus == RunStatus.ON_GOING) ? FaceSplitUtils.TimeFormat(this.split.CurrentSegment.BackupBestSegmentTime) : FaceSplitUtils.TimeFormat(this.split.Segments.Last().BackupBestSegmentTime);
            String segmentTimerString;

            segmentTimerString = (this.split.RunStatus == RunStatus.DONE) ? segmentTimeOnCompletionPause.ToString()
                : FaceSplitUtils.TimeFormat((Math.Truncate(this.segmentWatch.Elapsed.TotalSeconds * 100) / 100) + timeElapsedSinceSplit);

            TextRenderer.DrawText(graphics, "PB: " + segmentTime, Settings.Default.SegmentTimerPBFont,
                                  segmentTimeRectangle, Settings.Default.SegmentTimerPBColor, segmentTimeFlags);

            TextRenderer.DrawText(graphics, "BEST: " + segmentBestTime, Settings.Default.SegmentTimerBestFont,
                                  segmentBestimeRectangle, Settings.Default.SegmentTimerBestColor, segmentBestTimeFlags);

            TextRenderer.DrawText(graphics, segmentTimerString, Settings.Default.SegmentTimerFont,
                                  segmentTimerRectangle, segmentWatchColor);
        }
Пример #2
0
 private void FillSplitSegments()
 {
     foreach (DataGridViewRow rows in this.segmentsGridView.Rows)
     {
         String segmentName     = (rows.Cells[0].Value == null) ? "-" : rows.Cells[0].Value.ToString();
         double splitTime       = (rows.Cells[1].Value == null) ? 0.0 : FaceSplitUtils.TimeParse(rows.Cells[1].Value.ToString());
         double segmentTime     = (rows.Cells[2].Value == null) ? 0.0 : FaceSplitUtils.TimeParse(rows.Cells[2].Value.ToString());
         double bestSegmentTime = (rows.Cells[3].Value == null) ? 0.0 : FaceSplitUtils.TimeParse(rows.Cells[3].Value.ToString());
         this.split.Segments.Add(new Segment(segmentName, splitTime, segmentTime, bestSegmentTime));
     }
 }
Пример #3
0
 public String GetPossibleTimeSave()
 {
     if (this.split.SegmentHasPossibleTimeSave())
     {
         Double possibleTimeSave       = this.split.GetPossibleTimeSave();
         String possibleTimeSaveString = FaceSplitUtils.TimeFormat(possibleTimeSave);
         possibleTimeSaveString = FaceSplitUtils.CutDecimals(possibleTimeSaveString, 2);
         return(possibleTimeSaveString);
     }
     return("-");
 }
Пример #4
0
        public String GetSOB()
        {
            Double sob       = this.split.GetSOB();
            String sobString = "-";

            if (sob != 0.0)
            {
                sobString = FaceSplitUtils.TimeFormat(sob);
            }
            sobString = FaceSplitUtils.CutDecimals(sobString, 2);
            return(sobString);
        }
Пример #5
0
        public String GetPredictedTime()
        {
            Double predictedTime       = this.split.GetPredictedTime();
            String predictedTimeString = "-";

            if (predictedTime != 0.0)
            {
                predictedTimeString = FaceSplitUtils.TimeFormat(predictedTime);
            }
            predictedTimeString = FaceSplitUtils.CutDecimals(predictedTimeString, 2);
            return(predictedTimeString);
        }
Пример #6
0
 /// <summary>
 /// Fill the rows in the table with the split information.
 /// </summary>
 private void FillSegmentRows()
 {
     for (int i = 0; i < this.split.Segments.Count; ++i)
     {
         if (i >= this.segmentsGridView.Rows.Count)
         {
             AddRow();
         }
         this.segmentsGridView.Rows[i].Cells[0].Value = this.split.Segments.ElementAt(i).SegmentName;
         this.segmentsGridView.Rows[i].Cells[1].Value = FaceSplitUtils.TimeFormat(this.split.Segments.ElementAt(i).SplitTime);
         this.segmentsGridView.Rows[i].Cells[2].Value = FaceSplitUtils.TimeFormat(this.split.Segments.ElementAt(i).SegmentTime);
         this.segmentsGridView.Rows[i].Cells[3].Value = FaceSplitUtils.TimeFormat(this.split.Segments.ElementAt(i).BestSegmentTime);
     }
 }
Пример #7
0
        /// <summary>
        /// Draw the list of segments.
        /// </summary>
        /// <param name="graphics"></param>
        private void DrawSegments(Graphics graphics)
        {
            string segmentName;
            string segmentSplitTime;
            string runDeltaString = "";
            Bitmap segmentIcon;

            TextFormatFlags nameFlags = TextFormatFlags.Left | TextFormatFlags.VerticalCenter |
                                        TextFormatFlags.WordEllipsis;
            TextFormatFlags splitTimeFlags = TextFormatFlags.Right | TextFormatFlags.VerticalCenter |
                                             TextFormatFlags.WordBreak;
            TextFormatFlags runDeltaFlags = TextFormatFlags.Left | TextFormatFlags.VerticalCenter |
                                            TextFormatFlags.WordBreak;

            Rectangle segmentIconRectangle;
            Rectangle segmentNameRectangle;
            Rectangle segmentSplitTimeRectangle;

            Color rectangleColor = SettingsLayout.Default.SplitsBackgroundColor;

            for (int i = 0; i < segmentsRectangles.Count; ++i)
            {
                rectangleColor                   = (i == split.LiveIndex) ? SettingsLayout.Default.CurrentSegmentColor : SettingsLayout.Default.SplitsBackgroundColor;
                segmentName                      = split.Segments.ElementAt(i).SegmentName;
                segmentSplitTime                 = (split.Segments.ElementAt(i).SplitTime == 0) ? "-" : FaceSplitUtils.TimeFormat(split.Segments.ElementAt(i).SplitTime);
                segmentSplitTime                 = FaceSplitUtils.CutDecimals(segmentSplitTime, 2);
                segmentIcon                      = split.Segments.ElementAt(i).Icon;
                runDeltaString                   = GetRunDeltaString(i);
                runDeltaString                   = FaceSplitUtils.CutDecimals(runDeltaString, 2);
                segmentNameRectangle             = segmentsRectangles.ElementAt(i);
                segmentNameRectangle.Width      /= 2;
                segmentNameRectangle.X           = 17;
                segmentSplitTimeRectangle        = segmentsRectangles.ElementAt(i);
                segmentSplitTimeRectangle.Width /= 2;
                segmentSplitTimeRectangle.X      = segmentNameRectangle.Width;
                segmentIconRectangle             = new Rectangle(0, segmentNameRectangle.Y, 16, 16);
                graphics.FillRectangle(new SolidBrush(rectangleColor), segmentsRectangles.ElementAt(i));
                graphics.DrawImage(segmentIcon, segmentIconRectangle);
                TextRenderer.DrawText(graphics, segmentName, SettingsLayout.Default.SplitNamesFont,
                                      segmentNameRectangle, SettingsLayout.Default.SplitNamesColor, nameFlags);
                TextRenderer.DrawText(graphics, segmentSplitTime, SettingsLayout.Default.SplitTimesFont,
                                      segmentSplitTimeRectangle, SettingsLayout.Default.SplitTimesColor, splitTimeFlags);
                if (!string.IsNullOrEmpty(runDeltaString.Trim()))
                {
                    TextRenderer.DrawText(graphics, runDeltaString, SettingsLayout.Default.SplitDeltasFont,
                                          segmentSplitTimeRectangle, split.GetSegmentColor(i), runDeltaFlags);
                }
            }
        }
Пример #8
0
 /// <summary>
 /// Get the list of splits time from the data grid view.
 /// </summary>
 /// <param name="splitsTime">The list of splits time to be fill.</param>
 private void FillSplitsTime(List <double> splitsTime)
 {
     foreach (DataGridViewRow rows in this.segmentsGridView.Rows)
     {
         String splitTimeString = (rows.Cells[1].Value == null) ? "" : rows.Cells[1].Value.ToString();
         if (!String.IsNullOrEmpty(splitTimeString.Trim()))
         {
             splitsTime.Add(FaceSplitUtils.TimeParse(splitTimeString));
         }
         else
         {
             splitsTime.Add(INVALID_VALUE);
         }
     }
 }
Пример #9
0
        /// <summary>
        /// Draw the list of segments.
        /// </summary>
        /// <param name="graphics"></param>
        private void DrawSegments(Graphics graphics)
        {
            String segmentName;
            String segmentSplitTime;
            String runDeltaString = "";

            TextFormatFlags nameFlags = TextFormatFlags.Left | TextFormatFlags.VerticalCenter |
                                        TextFormatFlags.WordEllipsis;
            TextFormatFlags splitTimeFlags = TextFormatFlags.Right | TextFormatFlags.VerticalCenter |
                                             TextFormatFlags.WordBreak;
            TextFormatFlags runDeltaFlags = TextFormatFlags.Left | TextFormatFlags.VerticalCenter |
                                            TextFormatFlags.WordBreak;

            Rectangle segmentNameRectangle;
            Rectangle segmentSplitTimeRectangle;
            Color     rectangleColor = Settings.Default.SplitsBackgroundColor;

            for (int i = 0; i < segmentsRectangles.Count; ++i)
            {
                rectangleColor   = (i == this.split.LiveIndex) ? Settings.Default.CurrentSegmentColor : Settings.Default.SplitsBackgroundColor;
                segmentName      = this.split.Segments.ElementAt(i).SegmentName;
                segmentSplitTime = (this.split.Segments.ElementAt(i).SplitTime == 0) ? "-" : FaceSplitUtils.TimeFormat(this.split.Segments.ElementAt(i).SplitTime);
                segmentSplitTime = FaceSplitUtils.CutDecimals(segmentSplitTime, 2);
                runDeltaString   = GetRunDeltaString(i);
                //if (i == this.split.LiveIndex && (runDeltaString.IndexOf("+") == -1 && runDeltaString.IndexOf("-") == -1))
                //{
                //    runDeltaString = "";
                //}
                runDeltaString                   = FaceSplitUtils.CutDecimals(runDeltaString, 2);
                segmentNameRectangle             = segmentsRectangles.ElementAt(i);
                segmentNameRectangle.Width      /= 2;
                segmentSplitTimeRectangle        = segmentsRectangles.ElementAt(i);
                segmentSplitTimeRectangle.Width /= 2;
                segmentSplitTimeRectangle.X      = segmentNameRectangle.Width;
                graphics.FillRectangle(new SolidBrush(rectangleColor), segmentsRectangles.ElementAt(i));
                TextRenderer.DrawText(graphics, segmentName, Settings.Default.SplitNamesFont,
                                      segmentNameRectangle, Settings.Default.SplitNamesColor, nameFlags);
                TextRenderer.DrawText(graphics, segmentSplitTime, Settings.Default.SplitTimesFont,
                                      segmentSplitTimeRectangle, Settings.Default.SplitTimesColor, splitTimeFlags);
                if (!String.IsNullOrEmpty(runDeltaString.Trim()))
                {
                    TextRenderer.DrawText(graphics, runDeltaString, Settings.Default.SplitDeltasFont,
                                          segmentSplitTimeRectangle, this.split.GetSegmentColor(i), runDeltaFlags);
                }
            }
        }
Пример #10
0
 /// <summary>
 /// Fill the rows in the table with the split information.
 /// </summary>
 private void FillSegmentRows()
 {
     for (int i = 0; i < split.Segments.Count; ++i)
     {
         if (i >= segmentsGridView.Rows.Count)
         {
             AddRow();
         }
         segmentsGridView.Rows[i].Cells[SEGMENT_NAME_ROW].Value       = split.Segments.ElementAt(i).SegmentName;
         segmentsGridView.Rows[i].Cells[SEGMENT_SPLIT_TIME_ROW].Value = FaceSplitUtils.TimeFormat(split.Segments.ElementAt(i).SplitTime);
         segmentsGridView.Rows[i].Cells[SEGMENT_TIME_ROW].Value       = FaceSplitUtils.TimeFormat(split.Segments.ElementAt(i).SegmentTime);
         segmentsGridView.Rows[i].Cells[SEGMENT_BEST_TIME_ROW].Value  = FaceSplitUtils.TimeFormat(split.Segments.ElementAt(i).BestSegmentTime);
         segmentsGridView.Rows[i].Cells[SEGMENT_ICON_ROW].Value       = split.Segments.ElementAt(i).Icon;
         icons.ElementAt(i).Icon     = split.Segments.ElementAt(i).Icon;
         icons.ElementAt(i).IconPath = split.Segments.ElementAt(i).IconPath;
     }
 }
Пример #11
0
        private void FillOnlySegmentTimeColumn(List <double> segmentsTime)
        {
            int index = 0;

            foreach (DataGridViewRow rows in this.segmentsGridView.Rows)
            {
                DataGridViewCell cellSegmentTime = rows.Cells[2];
                if (segmentsTime.ElementAt(index) != INVALID_VALUE)
                {
                    cellSegmentTime.Value = FaceSplitUtils.TimeFormat(segmentsTime.ElementAt(index));
                }
                else
                {
                    cellSegmentTime.Value = "";
                }
                index++;
            }
        }
Пример #12
0
        private void LoadFile(String fileName)
        {
            String[]       lines            = File.ReadAllLines(fileName);
            String         runTitle         = "";
            String         runGoal          = "";
            int            runCount         = 0;
            int            runsCompleted    = 0;
            String         segmentName      = "";
            String         segmentSplitTime = "";
            String         segmentTime      = "";
            String         segmentBestTime  = "";
            List <Segment> segments         = new List <Segment>();

            try
            {
                runTitle      = lines.ElementAt(0);
                runGoal       = lines.ElementAt(1);
                runCount      = Int32.Parse(lines.ElementAt(2));
                runsCompleted = Int32.Parse(lines.ElementAt(3));
                for (int i = 4; i < lines.Length; ++i)
                {
                    segmentName      = lines.ElementAt(i).Split('-').ElementAt(0);
                    segmentSplitTime = lines.ElementAt(i).Split('-').ElementAt(1);
                    segmentTime      = lines.ElementAt(i).Split('-').ElementAt(2);
                    segmentBestTime  = lines.ElementAt(i).Split('-').ElementAt(3);
                    segments.Add(new Segment(segmentName, FaceSplitUtils.TimeParse(segmentSplitTime), FaceSplitUtils.TimeParse(segmentTime), FaceSplitUtils.TimeParse(segmentBestTime)));
                }
                this.split = new Split(runTitle, runGoal, runCount, segments);
                this.split.RunsCompleted = runsCompleted;
                this.split.File          = fileName;
                this.informations.Clear();
                FillInformations();
                CreateSegmentsRectangles();
                this.displayMode = DisplayMode.SEGMENTS;
            }
            catch (FormatException fe)
            {
                MessageBox.Show("This file was not recognize as a FaceSplit split file.");
            }
            catch (IndexOutOfRangeException iore)
            {
                MessageBox.Show("This file was not recognize as a FaceSplit split file.");
            }
        }
Пример #13
0
        /// <summary>
        /// Fill the segment cells in the table with the segments time from the list.
        /// </summary>
        /// <param name="segmentsTime">The list we use to fill the cells.</param>
        private void FillSegmentColumns(List <double> segmentsTime)
        {
            int index = 0;

            foreach (DataGridViewRow rows in segmentsGridView.Rows)
            {
                DataGridViewCell cellSegmentTime     = rows.Cells[SEGMENT_TIME_ROW];
                DataGridViewCell cellBestSegmentTime = rows.Cells[SEGMENT_BEST_TIME_ROW];
                if (segmentsTime.ElementAt(index) != INVALID_VALUE)
                {
                    cellSegmentTime.Value     = FaceSplitUtils.TimeFormat(segmentsTime.ElementAt(index));
                    cellBestSegmentTime.Value = FaceSplitUtils.TimeFormat(segmentsTime.ElementAt(index));
                }
                else
                {
                    cellSegmentTime.Value     = "";
                    cellBestSegmentTime.Value = "";
                }
                index++;
            }
        }
Пример #14
0
        private String GetPreviousSegmentDeltaString()
        {
            String  segmentDeltaString;
            double  segmentDelta;
            Boolean lostTime;
            Boolean bestSegment = false;
            double  timeElapsed = (Math.Truncate(this.segmentWatch.Elapsed.TotalSeconds * 100) / 100) + this.timeElapsedSinceSplit;

            if (this.split.LiveIndex > 0)
            {
                bestSegment = this.split.PreviousSegmentIsBestSegment();
            }
            if (this.split.CurrentSegmentHasLiveDelta(timeElapsed))
            {
                this.informations[(int)InformationIndexs.PREVIOUS_SEGMENT].PrimaryText = "Live segment: ";
                segmentDelta       = this.split.GetLiveSegmentDelta(timeElapsed);
                segmentDeltaString = FaceSplitUtils.TimeFormat(Math.Abs(segmentDelta));
                lostTime           = (segmentDelta > 0);
                if (lostTime)
                {
                    this.informations[(int)InformationIndexs.PREVIOUS_SEGMENT].SecondaryTextColor = Settings.Default.PreviousSegmentDeltaLostColor;
                    segmentDeltaString     = segmentDeltaString.Insert(0, "+");
                    this.segmentWatchColor = Settings.Default.SegmentTimerLosingTimeColor;
                }
                else
                {
                    this.informations[(int)InformationIndexs.PREVIOUS_SEGMENT].SecondaryTextColor = Settings.Default.PreviousSegmentDeltaSavedColor;
                    segmentDeltaString = segmentDeltaString.Insert(0, "-");
                }
            }
            else if (this.split.PreviousSegmentHasSegmentDelta())
            {
                this.informations[(int)InformationIndexs.PREVIOUS_SEGMENT].PrimaryText = "Previous segment: ";
                segmentDelta       = this.split.GetPreviousSegmentDelta();
                segmentDeltaString = FaceSplitUtils.TimeFormat(Math.Abs(segmentDelta));
                lostTime           = (segmentDelta > 0);
                if (bestSegment)
                {
                    this.informations[(int)InformationIndexs.PREVIOUS_SEGMENT].SecondaryTextColor = Settings.Default.PreviousSegmentDeltaBestSegmentColor;
                    segmentDeltaString = segmentDeltaString.Insert(0, "-");
                }
                else
                {
                    if (lostTime)
                    {
                        this.informations[(int)InformationIndexs.PREVIOUS_SEGMENT].SecondaryTextColor = Settings.Default.PreviousSegmentDeltaLostColor;
                        segmentDeltaString = segmentDeltaString.Insert(0, "+");
                    }
                    else
                    {
                        this.informations[(int)InformationIndexs.PREVIOUS_SEGMENT].SecondaryTextColor = Settings.Default.PreviousSegmentDeltaSavedColor;
                        segmentDeltaString = segmentDeltaString.Insert(0, "-");
                    }
                }
                this.split.SetPreviousSegmentColor(bestSegment, lostTime);
            }
            else
            {
                this.informations[(int)InformationIndexs.PREVIOUS_SEGMENT].PrimaryText        = "Previous segment: ";
                this.informations[(int)InformationIndexs.PREVIOUS_SEGMENT].SecondaryTextColor = Settings.Default.PreviousSegmentDeltaNoDeltaColor;
                segmentDeltaString = "-";
            }
            segmentDeltaString = FaceSplitUtils.CutDecimals(segmentDeltaString, 2);
            return(segmentDeltaString);
        }
Пример #15
0
        /// <summary>
        /// Fetch the run delta for each split with the index.
        /// Returns it into a string.
        /// </summary>
        /// <param name="index">The index of the split.</param>
        /// <returns>The run delta into a string.</returns>
        private String GetRunDeltaString(int index)
        {
            Boolean lostTime;
            double  runDelta;
            Double  timeElapsed    = (Math.Truncate(this.segmentWatch.Elapsed.TotalSeconds * 100) / 100) + this.timeElapsedSinceSplit;
            String  runDeltaString = "";

            if (index < this.split.LiveIndex)
            {
                //Done mean we are after the last split but we still have the possiblity of going back.
                if ((this.split.RunStatus == RunStatus.ON_GOING || this.split.RunStatus == RunStatus.DONE) && !this.split.FirstSplit() && this.split.SegmentHasRunDelta(index))
                {
                    runDelta       = this.split.GetRunDelta(index);
                    lostTime       = (runDelta > 0);
                    runDeltaString = FaceSplitUtils.TimeFormat(Math.Abs(runDelta));
                    if (lostTime)
                    {
                        runDeltaString = runDeltaString.Insert(0, "+");
                    }
                    else
                    {
                        runDeltaString = runDeltaString.Insert(0, "-");
                    }
                }
            }
            else if (index == this.split.LiveIndex && this.split.SegmentHasRunDelta(index))
            {
                runDelta       = this.split.GetLiveRunDelta(Math.Truncate(this.watch.Elapsed.TotalSeconds * 100) / 100);
                lostTime       = (runDelta > 0);
                runDeltaString = FaceSplitUtils.TimeFormat(Math.Abs(runDelta));
                if (lostTime)
                {
                    runDeltaString = runDeltaString.Insert(0, "+");
                    if ((index == 0) || (index > 0 && runDelta > this.split.GetRunDelta(index - 1)))
                    {
                        this.split.SetCurrentSegmentColor(Settings.Default.SplitDeltasBehindLosingColor);
                    }
                    else
                    {
                        this.split.SetCurrentSegmentColor(Settings.Default.SplitDeltasBehindSavingColor);
                    }
                    this.watchColor = Settings.Default.TimerBehindColor;
                }
                else if ((index > 0 && runDelta > this.split.GetRunDelta(index - 1)))
                {
                    runDeltaString = runDeltaString.Insert(0, "-");
                    this.split.SetCurrentSegmentColor(Settings.Default.SplitDeltasAheadLosingColor);
                }
                else if (this.split.CurrentSegmentHasLiveDelta(timeElapsed))
                {
                    runDeltaString = runDeltaString.Insert(0, "-");
                    this.split.SetCurrentSegmentColor(Settings.Default.SplitDeltasAheadSavingColor);
                }
                else
                {
                    runDeltaString  = "";
                    this.watchColor = Settings.Default.TimerRunningColor;
                }
            }
            return(runDeltaString);
        }
Пример #16
0
 private void FillSplitSegments()
 {
     foreach (DataGridViewRow rows in segmentsGridView.Rows)
     {
         string     segmentName     = (rows.Cells[SEGMENT_NAME_ROW].Value == null) ? "-" : rows.Cells[SEGMENT_NAME_ROW].Value.ToString();
         double     splitTime       = (rows.Cells[SEGMENT_SPLIT_TIME_ROW].Value == null) ? 0.0 : FaceSplitUtils.TimeParse(rows.Cells[SEGMENT_SPLIT_TIME_ROW].Value.ToString());
         double     segmentTime     = (rows.Cells[SEGMENT_TIME_ROW].Value == null) ? 0.0 : FaceSplitUtils.TimeParse(rows.Cells[SEGMENT_TIME_ROW].Value.ToString());
         double     bestSegmentTime = (rows.Cells[SEGMENT_BEST_TIME_ROW].Value == null) ? 0.0 : FaceSplitUtils.TimeParse(rows.Cells[SEGMENT_BEST_TIME_ROW].Value.ToString());
         BitmapFile icon            = icons.ElementAt(rows.Index);
         split.Segments.Add(new Segment(segmentName, splitTime, segmentTime, bestSegmentTime, icon));
     }
 }