public string ExtractTranscriptSuffix(CommentaryType commentaryType) { if (!Enum.IsDefined(typeof(CommentaryType), commentaryType)) { throw new InvalidEnumArgumentException(nameof(commentaryType), (int)commentaryType, typeof(CommentaryType)); } switch (commentaryType) { case CommentaryType.Default: return(string.Empty); case CommentaryType.DriverInPits: return(_languagePhrases.DriverInPitsSuffix); case CommentaryType.DriverOut: return(_languagePhrases.DriverOutSuffix); case CommentaryType.DriverP1: return(_languagePhrases.DriverP1Suffix); case CommentaryType.DriverP2: return(_languagePhrases.DriverP2Suffix); case CommentaryType.DriverP3: return(_languagePhrases.DriverP3Suffix); case CommentaryType.TeamOut: return(_languagePhrases.TeamOutSuffix); default: throw new ArgumentOutOfRangeException(nameof(commentaryType)); } }
public string ExtractFileNameSuffix(CommentaryType commentaryType) { if (!Enum.IsDefined(typeof(CommentaryType), commentaryType)) { throw new InvalidEnumArgumentException(nameof(commentaryType), (int)commentaryType, typeof(CommentaryType)); } switch (commentaryType) { case CommentaryType.Default: return(string.Empty); case CommentaryType.DriverInPits: return(DriverInPitsFileNameSuffix); case CommentaryType.DriverOut: return(DriverOutFileNameSuffix); case CommentaryType.DriverP1: return(DriverP1FileNameSuffix); case CommentaryType.DriverP2: return(DriverP2FileNameSuffix); case CommentaryType.DriverP3: return(DriverP3FileNameSuffix); case CommentaryType.TeamOut: return(TeamOutFileNameSuffix); default: throw new ArgumentOutOfRangeException(nameof(commentaryType)); } }
public string ExtractFileNamePrefix(string fileName, CommentaryType commentaryType) { if (fileName == null) { throw new ArgumentNullException(nameof(fileName)); } if (!Enum.IsDefined(typeof(CommentaryType), commentaryType)) { throw new InvalidEnumArgumentException(nameof(commentaryType), (int)commentaryType, typeof(CommentaryType)); } switch (commentaryType) { case CommentaryType.Default: return(string.Empty); case CommentaryType.DriverInPits: return(fileName.Substring(0, fileName.Length - DriverInPitsFileNameSuffix.Length)); case CommentaryType.DriverOut: return(fileName.Substring(0, fileName.Length - DriverOutFileNameSuffix.Length)); case CommentaryType.DriverP1: return(fileName.Substring(0, fileName.Length - DriverP1FileNameSuffix.Length)); case CommentaryType.DriverP2: return(fileName.Substring(0, fileName.Length - DriverP2FileNameSuffix.Length)); case CommentaryType.DriverP3: return(fileName.Substring(0, fileName.Length - DriverP3FileNameSuffix.Length)); case CommentaryType.TeamOut: return(fileName.Substring(0, fileName.Length - TeamOutFileNameSuffix.Length)); default: throw new ArgumentOutOfRangeException(nameof(commentaryType)); } }
public void Remove(CommentaryType item) { context.CommentTypes.Remove(item); }
public CommentaryType Add(CommentaryType item) { return(context.CommentTypes.Add(item)); }