private void ValidateMissionState(string missionState) { if (!Enum.IsDefined(typeof(MissionStateEnum), missionState)) { throw new ArgumentException(); } this.MissionState = Enum.Parse <MissionStateEnum>(missionState); }
public void CompleteMission() { if (this.State == MissionStateEnum.Finished) { throw new InvalidMissionCompletionException(); } this.State = MissionStateEnum.Finished; }
/// <summary>Initializes a new instance of the PisMission class.</summary> /// <param name="other">The other.</param> public PisMission(PisMission other) : this() { if (other != null) { this.CommercialNumber = other.CommercialNumber; this.OperatorCode = other.OperatorCode; this.MissionState = other.MissionState; } }
public void Complete() { if (this.MissionState == MissionStateEnum.Finished) { throw new InvalidOperationException("Mission already finished!"); } this.MissionState = MissionStateEnum.Finished; }
private void StateParse(string state) { bool validState = Enum.TryParse(typeof(MissionStateEnum), state, out object outState); if (validState == false) { throw new ArgumentException("Invalid state!"); } this.State = (MissionStateEnum)outState; }
public void CompleteMission() { this.MissionState = MissionStateEnum.Finished; }
public Mission(string codeName, MissionStateEnum missionState) { CodeName = codeName; MissionState = missionState; }
public PisMission() { this.CommercialNumber = string.Empty; this.OperatorCode = string.Empty; this.MissionState = MissionStateEnum.NI; }
public Missions(string codeName, MissionStateEnum missionStateEnum) { CodeName = codeName; State = missionStateEnum; }
public void CompleteMission(string codeName) { State = MissionStateEnum.Finished; }
public Mission(string codeName, MissionStateEnum missionStateEn) { this.CodeName = codeName; this.missionStateEnum = missionStateEn; }
public void CompleteMission(string missionName) { MissionState = MissionStateEnum.Finished; }
public Mitions(string codeName, MissionStateEnum missionStateEnum) { this.CodeName = codeName; this.MissionStateEnum = missionStateEnum; }
public Mission(string codeName, MissionStateEnum state) { CodeName = codeName; State = state; }