예제 #1
0
        /// <summary>
        /// Sort the children by time, exclude pauses
        /// </summary>
        public static IList <TrailResultWrapper> ChildrenTimeSorted(TrailResultWrapper parent)
        {
            IList <TrailResultWrapper> displayedChildren = new List <TrailResultWrapper>();

            foreach (TrailResultWrapper tr in parent.Children)
            {
                if (!(tr.Result is PausedChildTrailResult))
                {
                    displayedChildren.Add(tr);
                }
            }
            ((List <TrailResultWrapper>)displayedChildren).Sort((x, y) => x.Result.StartTime.CompareTo(y.Result.StartTime));

            return(displayedChildren);
        }
예제 #2
0
        public TrailResultWrapper(TrailResultWrapper parent, ChildTrailResult element)
            : base(parent, element)
        {
            element.Wrapper = this;
            //several separate substructues..
            parent.Children.Add(this);
            parent.m_allChildren.Add(this);

            if (element.SubResults.Count > 1)
            {
                foreach (ChildTrailResult sctr in element.SubResults)
                {
                    TrailResultWrapper strw = new TrailResultWrapper(this, sctr);
                }
            }
        }
예제 #3
0
 private void GetChildren()
 {
     //TODO This should be lazy (calculated if children visible),
     //requires overiding Children
     if (this.Element != null && this.Element is ParentTrailResult)
     {
         IList <ChildTrailResult> children = (this.Element as ParentTrailResult).getChildren();
         if (children != null && (children.Count > 1 ||
                                  children.Count == 1 && children[0].SubResults.Count > 0))
         {
             foreach (ChildTrailResult tr in children)
             {
                 TrailResultWrapper tn = new TrailResultWrapper(this, tr);
             }
         }
     }
 }
예제 #4
0
        public void SetSummary(IList <TrailResultWrapper> list)
        {
            this.results.Clear();
            //Get summary from upaused and not summary
            IList <TrailResultWrapper> unpaused = TrailResultWrapper.UnpausedResults(list);

            foreach (TrailResultWrapper t in unpaused)
            {
                if (!(t.Result is SummaryTrailResult))
                {
                    this.results.Add(t.Result);
                }
            }
            this.m_order = unpaused.Count;
            this.Clear(false);
            this.m_PoolLengthInfo = Data.PoolLengthInfo.GetPoolLength(this.results);
        }
예제 #5
0
 protected override System.Drawing.FontStyle GetCellFontStyle(object element, TreeList.Column column)
 {
     if (element is TrailResultWrapper)
     {
         TrailResultWrapper wrapper = (element as TrailResultWrapper);
         if (wrapper.Result is SummaryTrailResult)
         {
             if ((wrapper.Element as SummaryTrailResult).IsTotal)
             {
                 return(System.Drawing.FontStyle.Bold);
             }
             return(System.Drawing.FontStyle.Italic);
         }
         else if (wrapper.Result is PausedChildTrailResult)
         {
             PausedChildTrailResult   pause = wrapper.Result as PausedChildTrailResult;
             System.Drawing.FontStyle res   = System.Drawing.FontStyle.Strikeout;
             if (pause.pauseType == PauseType.Stopped)
             {
                 res |= FontStyle.Italic;
             }
             if (pause.pauseType == PauseType.Timer)
             {
                 res |= FontStyle.Bold;
             }
             return(res);
         }
         else
         {
             if (Controller.TrailController.Instance.ReferenceResult != null &&
                 wrapper.Result == Controller.TrailController.Instance.ReferenceResult.Result)
             {
                 return(System.Drawing.FontStyle.Italic);
             }
         }
     }
     return(base.GetCellFontStyle(element, column));
 }
예제 #6
0
 private TrailResultWrapper(TrailResultWrapper parent, TrailResult element)
     : base(parent, element)
 {
     element.Wrapper = this;
 }
예제 #7
0
 public static IList <TrailResultWrapper> UnpausedResults(IList <TrailResultWrapper> tn)
 {
     return(TrailResultWrapper.GetUnpausedResults(tn, false));
 }