Creates a object from a string name of the platform. The name of the platform to create. The Platform object represented by the string name.
(string platformName)
| 185 | /// <param name="platformName">The name of the platform to create.</param> |
| 186 | /// <returns>The Platform object represented by the string name.</returns> |
| 187 | internal static Platform FromString(string platformName) |
| 188 | { |
| 189 | if (Enum.TryParse(platformName, ignoreCase: true, out PlatformType platformTypeFromString)) |
| 190 | { |
| 191 | return new Platform(platformTypeFromString); |
| 192 | } |
| 193 | |
| 194 | // If the requested platform string is not a valid platform type, |
| 195 | // ignore it and use PlatformType.Any. |
| 196 | |
| 197 | return new Platform(PlatformType.Any); |
| 198 | } |
| 199 | } |
no outgoing calls
no test coverage detected