| using System; |
| using System.Diagnostics.CodeAnalysis; |
|
|
| namespace VersOne.Epub.Schema |
| { |
| |
| |
| |
| |
| public enum EpubPageProgressionDirection |
| { |
| |
| |
| |
| DEFAULT = 1, |
|
|
| |
| |
| |
| LEFT_TO_RIGHT, |
|
|
| |
| |
| |
| RIGHT_TO_LEFT, |
|
|
| |
| |
| |
| UNKNOWN |
| } |
|
|
| [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", |
| Justification = "Enum and parser need to be close to each other to avoid issues when the enum was changed without changing the parser. The file needs to be named after enum.")] |
| internal static class EpubPageProgressionDirectionParser |
| { |
| public static EpubPageProgressionDirection Parse(string stringValue) |
| { |
| if (String.IsNullOrEmpty(stringValue)) |
| { |
| return EpubPageProgressionDirection.UNKNOWN; |
| } |
| return stringValue.ToLowerInvariant() switch |
| { |
| "default" => EpubPageProgressionDirection.DEFAULT, |
| "ltr" => EpubPageProgressionDirection.LEFT_TO_RIGHT, |
| "rtl" => EpubPageProgressionDirection.RIGHT_TO_LEFT, |
| _ => EpubPageProgressionDirection.UNKNOWN |
| }; |
| } |
| } |
| } |
|
|