Exemplo n.º 1
0
 /// <summary>
 /// Creates a new StartupProgress by initializing internal data structure for
 /// tracking progress of all defined phases.
 /// </summary>
 public StartupProgress()
 {
     foreach (Phase phase in EnumSet.AllOf <Phase>())
     {
         phases[phase] = new PhaseTracking();
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Returns the StepTracking internal data structure for the specified phase
        /// and step, possibly null if not found.
        /// </summary>
        /// <param name="phase">Phase to get</param>
        /// <param name="step">Step to get</param>
        /// <returns>StepTracking for phase and step, possibly null</returns>
        private StepTracking GetStepTracking(Phase phase, Step step)
        {
            PhaseTracking phaseTracking            = phases[phase];
            IDictionary <Step, StepTracking> steps = phaseTracking != null ? phaseTracking.steps
                                 : null;

            return(steps != null ? steps[step] : null);
        }
Exemplo n.º 3
0
        public PhaseTracking Clone()
        {
            PhaseTracking clone = new PhaseTracking();

            base.Copy(clone);
            clone.file = file;
            clone.size = size;
            foreach (KeyValuePair <Step, StepTracking> entry in steps)
            {
                clone.steps[entry.Key] = entry.Value.Clone();
            }
            return(clone);
        }
Exemplo n.º 4
0
        /// <summary>Returns the current run status of the specified phase.</summary>
        /// <param name="phase">Phase to get</param>
        /// <returns>Status run status of phase</returns>
        public virtual Status GetStatus(Phase phase)
        {
            PhaseTracking tracking = phases[phase];

            if (tracking.beginTime == long.MinValue)
            {
                return(Status.Pending);
            }
            else
            {
                if (tracking.endTime == long.MinValue)
                {
                    return(Status.Running);
                }
                else
                {
                    return(Status.Complete);
                }
            }
        }