예제 #1
0
        public static Fluent CreateStart()
        {
            Fluent fluent = new Fluent();

            fluent.start = DateTime.Now;
            return(fluent);
        }
예제 #2
0
        public TimeSpan GetLastLap()
        {
            if (laps == null || laps.Count == 0)
            {
                return(new TimeSpan(0));
            }

            Fluent f = (Fluent)laps[laps.Count - 1];

            return(f.GetTimeSpan());
        }
예제 #3
0
        public static Fluent Create(DateTime start, string task)
        {
            Fluent f = new Fluent();

            f.start = start;
            if (task != null && task.Length > 0)
            {
                f.task = task;
            }
            return(f);
        }
예제 #4
0
        public void Start()
        {
            //If it is already started do nothing.
            Fluent fluent = GetLastFluent();

            if (fluent != null && fluent.Stopped == false)
            {
                return;
            }

            fluent = Fluent.CreateStart();
            laps.Add(fluent);
        }
예제 #5
0
        public void Stop(string task)
        {
            //If no last lap or already stopped do nothing
            Fluent fluent = GetLastFluent();

            if (fluent == null)
            {
                return;
            }
            if (fluent.Stopped)
            {
                return;
            }
            fluent.Stop();
            fluent.Task = task;
        }
예제 #6
0
 internal void AddFluent(DateTime start, DateTime end, string task)
 {
     laps.Add(Fluent.Create(start, end, task));
 }