\r\n

51Degrees Device Detection .NET  4.4

Device detection services for 51Degrees Pipeline

FiftyOne.DeviceDetection.Examples.ExampleUtils Class Reference

Static Public Member Functions

static string  FindFile (string filename)
Uses a background task to search for the specified filename within the working directory. More...
static DataFileInfo  GetDataFileInfo (string dataFile, DeviceDetectionHashEngineBuilder engineBuilder)
Get information about the specified data file More...
static DataFileInfo  GetDataFileInfo (DeviceDetectionHashEngine engine)
Get information about the data file used by the specified engine More...
static void  CheckDataFile (IPipeline pipeline, ILogger logger)
Display information about the data file and log warnings if specific requirements are not met. More...
static void  CheckDataFile (DeviceDetectionHashEngine engine, ILogger logger)
Display information about the data file and log warnings if specific requirements are not met. More...
static void  LogDataFileInfo (DataFileInfo info, ILogger logger)
Display information about the data file and log warnings if specific requirements are not met. More...
static void  LogDataFileStandardWarnings (DataFileInfo info, ILogger logger)
Display information about the data file and log warnings if specific requirements are not met. More...
static bool  IsInvalidKey (string key)
Checks if the supplied 51Degrees resource key / license key is invalid. More...

Public Attributes

const string  RESOURCE_KEY_ENV_VAR = "51D_RESOURCE_KEY"
The default environment variable used to get the resource key to use when running examples. More...
const int  DataFileAgeWarning = 30
If data file is older than this number of days then a warning will be displayed. More...

Static Public Attributes

static readonly List< Dictionary< string, object > >  EvidenceValues
This collection contains the various input values that will be passed to the device detection algorithm when running examples More...

Member Function Documentation

◆ CheckDataFile() [1/2]

static void FiftyOne.DeviceDetection.Examples.ExampleUtils.CheckDataFile ( IPipeline   pipeline,
ILogger   logger  
)
static

Display information about the data file and log warnings if specific requirements are not met.

Parameters
pipeline -
logger -

◆ CheckDataFile() [2/2]

static void FiftyOne.DeviceDetection.Examples.ExampleUtils.CheckDataFile ( DeviceDetectionHashEngine   engine,
ILogger   logger  
)
static

Display information about the data file and log warnings if specific requirements are not met.

Parameters
engine -
logger -

◆ FindFile()

static string FiftyOne.DeviceDetection.Examples.ExampleUtils.FindFile ( string   filename )
static

Uses a background task to search for the specified filename within the working directory.

If the file cannot be found, the algorithm will move to the parent directory and repeat the process. This continues until the file is found or a timeout is triggered.

Parameters
filename -
Returns

◆ GetDataFileInfo() [1/2]

static DataFileInfo FiftyOne.DeviceDetection.Examples.ExampleUtils.GetDataFileInfo ( string   dataFile,
DeviceDetectionHashEngineBuilder   engineBuilder  
)
static

Get information about the specified data file

Parameters
dataFile -
engineBuilder -

◆ GetDataFileInfo() [2/2]

static DataFileInfo FiftyOne.DeviceDetection.Examples.ExampleUtils.GetDataFileInfo ( DeviceDetectionHashEngine   engine )
static

Get information about the data file used by the specified engine

Parameters
engine -

◆ IsInvalidKey()

static bool FiftyOne.DeviceDetection.Examples.ExampleUtils.IsInvalidKey ( string   key )
static

Checks if the supplied 51Degrees resource key / license key is invalid.

Note that this cannot determine if the key is definitely valid, just whether it is definitely invalid.

Parameters
key - The key to check.
Returns

◆ LogDataFileInfo()

static void FiftyOne.DeviceDetection.Examples.ExampleUtils.LogDataFileInfo ( DataFileInfo   info,
ILogger   logger  
)
static

Display information about the data file and log warnings if specific requirements are not met.

Parameters
engine -
logger -

◆ LogDataFileStandardWarnings()

static void FiftyOne.DeviceDetection.Examples.ExampleUtils.LogDataFileStandardWarnings ( DataFileInfo   info,
ILogger   logger  
)
static

Display information about the data file and log warnings if specific requirements are not met.

Parameters
engine -
logger -

Member Data Documentation

◆ DataFileAgeWarning

const int FiftyOne.DeviceDetection.Examples.ExampleUtils.DataFileAgeWarning = 30

If data file is older than this number of days then a warning will be displayed.

◆ EvidenceValues

readonly List<Dictionary<string, object> > FiftyOne.DeviceDetection.Examples.ExampleUtils.EvidenceValues
static

This collection contains the various input values that will be passed to the device detection algorithm when running examples

◆ RESOURCE_KEY_ENV_VAR

const string FiftyOne.DeviceDetection.Examples.ExampleUtils.RESOURCE_KEY_ENV_VAR = "51D_RESOURCE_KEY"

The default environment variable used to get the resource key to use when running examples.