AK.F1.Timing.Service.Utility.IcsConverter.GetSessionType C# (CSharp) Метод

GetSessionType() приватный статический Метод

private static GetSessionType ( IEvent e ) : SessionType
e IEvent
Результат SessionType
        private static SessionType GetSessionType(IEvent e)
        {
            var s = e.Summary;
            if (s.StartsWith("First"))
            {
                return SessionType.P1;
            }
            if (s.StartsWith("Second"))
            {
                return SessionType.P2;
            }
            if (s.StartsWith("Third"))
            {
                return SessionType.P3;
            }
            if (s.StartsWith("Qualifying"))
            {
                return SessionType.Qually;
            }
            if (s.EndsWith("Prix"))
            {
                return SessionType.Race;
            }
            throw new FormatException("Failed to parse the session type from '" + s + "'.");
        }