Compares the platform to the specified type. A value to compare to. if the platforms match; otherwise .
(PlatformType compareTo)
| 158 | /// <param name="compareTo">A <see cref="Selenium.PlatformType"/> value to compare to.</param> |
| 159 | /// <returns><see langword="true"/> if the platforms match; otherwise <see langword="false"/>.</returns> |
| 160 | public bool IsPlatformType(PlatformType compareTo) |
| 161 | { |
| 162 | return compareTo switch |
| 163 | { |
| 164 | PlatformType.Any => true, |
| 165 | PlatformType.Windows => this.PlatformType is PlatformType.Windows or PlatformType.XP or PlatformType.Vista, |
| 166 | PlatformType.Vista => this.PlatformType is PlatformType.Windows or PlatformType.Vista, |
| 167 | PlatformType.XP => this.PlatformType is PlatformType.Windows or PlatformType.XP, |
| 168 | PlatformType.Linux => this.PlatformType is PlatformType.Linux or PlatformType.Unix, |
| 169 | _ => this.PlatformType == compareTo, |
| 170 | }; |
| 171 | } |
| 172 | |
| 173 | /// <summary> |
| 174 | /// Returns the string value for this platform type. |