/// <summary> /// Changes the state of the phase /// </summary> /// <param name="type">The state to set</param> /// <param name="description">The optional description to set</param> /// <returns>The current state of the phase</returns> public virtual PhaseState UpdateState(PhaseStateType type, string description = null) { PhaseState current = GetCurrentState(); if (current != null && current.Type == type) { current.LastModified = DateTime.UtcNow; current.Description = description; return(current); } PhaseState newState = new PhaseState(type, description); States.Add(newState); return(newState); }
/// <summary> /// Sets the identified phase's state with optional description. /// </summary> /// <param name="phaseName">Name of phase to update</param> /// <param name="state">The state to set</param> /// <param name="stateDescription">Optional description</param> public virtual void UpdatePhaseState(string phaseName, PhaseStateType state, string stateDescription = null) { PhaseState s = Phases[phaseName].UpdateState(state, stateDescription); LastModified = s.LastModified; }