public static TypeOfTrain getTypeOfTrain(String type) { TypeOfTrain newType; if (type.Equals(EC)) { newType = TypeOfTrain.EC; } else if (IC.Equals(type)) { newType = TypeOfTrain.IC; } else if (EN.Equals(type)) { newType = TypeOfTrain.EN; } else if (Ex.Equals(type)) { newType = TypeOfTrain.Ex; } else if (Os.Equals(type)) { newType = TypeOfTrain.Os; } else if (R.Equals(type)) { newType = TypeOfTrain.R; } else if (SC.Equals(type)) { newType = TypeOfTrain.SC; } else if (Sp.Equals(type)) { newType = TypeOfTrain.Sp; } else { newType = TypeOfTrain.Os; } return(newType); }
public override bool Equals(object obj) { if (obj == null) { return(false); } if (obj == this) { return(true); } return(obj is ServiceStatus other && ((App == null && other.App == null) || (App?.Equals(other.App) == true)) && ((Moto == null && other.Moto == null) || (Moto?.Equals(other.Moto) == true)) && Notes.Equals(other.Notes) && Users.Equals(other.Users) && ((Time == null && other.Time == null) || (Time?.Equals(other.Time) == true)) && ((Os == null && other.Os == null) || (Os?.Equals(other.Os) == true)) && ((PhpVersion == null && other.PhpVersion == null) || (PhpVersion?.Equals(other.PhpVersion) == true)) && ((Status == null && other.Status == null) || (Status?.Equals(other.Status) == true))); }