File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ public class DeviceDetector
109
109
new MobileParser ( )
110
110
} ;
111
111
112
- protected List < IBotParserAbstract > botParsers = new List < IBotParserAbstract >
112
+ protected IReadOnlyList < IBotParserAbstract > botParsers = new List < IBotParserAbstract >
113
113
{
114
114
new BotParser ( )
115
115
} ;
@@ -228,11 +228,24 @@ public void SkipBotDetection(bool skip = true)
228
228
public bool IsBot ( )
229
229
{
230
230
if ( ! IsParsed ( ) )
231
- throw new AccessViolationException ( "You need to call Parse method before use IsMobile method." ) ;
231
+ throw new AccessViolationException ( "You need to call Parse method before use IsBot method." ) ;
232
232
233
233
return bot . Success ;
234
234
}
235
235
236
+ /// <summary>
237
+ /// Returns if the parsed UA was identified as a Device Console
238
+ /// @see consoles.yml for a list of detected consoles
239
+ /// </summary>
240
+ /// <returns></returns>
241
+ public bool IsConsole ( )
242
+ {
243
+ if ( ! IsParsed ( ) )
244
+ throw new AccessViolationException ( "You need to call Parse method before use IsConsole method." ) ;
245
+
246
+ return device . HasValue && device . Value == DeviceType . DEVICE_TYPE_CONSOLE ;
247
+ }
248
+
236
249
/// <summary>
237
250
/// Returns if the parsed UA was identified as a touch enabled device
238
251
/// Note: That only applies to windows 8 tablets
You can’t perform that action at this time.
0 commit comments