The DeviceAtlas DeviceApi documentation
Public Member Functions | Public Attributes | Properties | List of all members
Mobi.Mtld.DA.Device.Config Class Reference

DeviceApi Configurations. To change the default configs of the DeviceAtlas DeviceApi create an instance of this class, set your preferred configs and pass the instance to the constructor of a DeviceApi or DeviceApiWeb. Note that you may change the configs even after the Config instance has been passed to the DeviceApi. More...

Inheritance diagram for Mobi.Mtld.DA.Device.Config:

Public Member Functions

object Clone ()
 

Public Attributes

const string DEFAULT_COOKIE_NAME = "DAPROPS"
 The default cookie name that the client side properties would be set to. When using the GetProperties() or GetProperty() of class DeviceApiWeb, the detection would automatically use the contents of this cookie if it exists. If you want the client side properties to be used add the DeviceAtlas client side component (JS lib) to your web-site pages. More...
 
const bool DEFAULT_INCLUDE_UA_PROPS = true
 The default config value for GetProperties() or GetProperty() to include User-Agent dynamic properties. More...
 
const bool DEFAULT_INCLUDE_LANG_PROPS = true
 The default config value for GetProperties(HEADERS), GetProperty(HEADERS), GetProperties(REQUEST) or GetProperty(REQUEST) to check the Accept-Language header and include properties to the property set for getting client's language and locale preferences. More...
 
const bool DEFAULT_INCLUDE_MATCH_INFO = false
 The default config value for GetProperties() or GetProperty() to include the matched and unmatched parts of the User-Agent to the property set. More...
 
const bool DEFAULT_RETURN_NULL_WHEN_NO_PROPERTIES = false
 The default config value for GetProperties() return value when there was no properties. true = if no properties return null, false = if no property return an instance of Properties with no Property inside it. More...
 
const int DEFAULT_MAX_CACHE_ENTRIES = 4096
 The default config value for result (Properties object) caching. Depending on the repeat and distance factor of your user-agents or headers passed to the API for detection the result cache may increase performance by preventing repeated lookups. More...
 

Properties

virtual string CookieName [get, set]
 To change the cookie name that the client side properties would be set to. When using the GetProperties() or GetProperty() of class DeviceApiWeb, the detection would automatically use the contents of this cookie if it exists. If you want the client side properties to be used add the DeviceAtlas client side component (JS lib) to your web-site pages.
When the user-agent or HTTP headers are set manually to GetProperties() or GetProperty(), the client side properties (probably the value set to the cookie) can be manually passed to this methods as the second argument, note that this config is only used for GetProperties(REQUEST-OBJECT) or GetProperty(REQUEST-OBJECT). More...
 
virtual bool IncludeUaProps [get, set]
 To disable or enable GetProperties() or GetProperty() including User-Agent dynamic properties. Some properties cannot be known before runtime and can change from User-Agent to User-Agent. The most common of these are the OS Version and the Browser Version. The DeviceApi is able to dynamically detect these changing properties with a small overhead. If you do not use this properties you can set this config to false to make the detection a little bit faster. More...
 
virtual bool IncludeLangProps [get, set]
 To disable or enable GetProperties(HEADERS), GetProperty(HEADERS), GetProperties(REQUEST) or GetProperty(REQUEST) including language and locale properties. To check the Accept-Language header and include properties to the property set for getting client's language and locale preferences set to true. If you do not use this properties you can set this config to false to make the detection marginally faster. More...
 
virtual bool IncludeMatchInfo [get, set]
 To disable or enable GetProperties() or GetProperty() including the matched and unmatched parts of the User-Agent to the property set. More...
 
virtual bool ReturnNullWhenNoProperties [get, set]
 Set if the value returned by GetProperties() should be null when there are no properties to return or an instance of Properties that has no Property inside it should be returned. More...
 
virtual int MaxCacheEntries [get, set]
 Set the max number of results to be cached. Depending on the repeat and distance factor of your user-agents or headers passed to the API for detection, increasing the result cache may increase performance by preventing repeated lookups. For a tight set of inputs (i.e. an almost unique set of user-agents) set to lower numbers or o to disable. More...
 

Detailed Description

DeviceApi Configurations. To change the default configs of the DeviceAtlas DeviceApi create an instance of this class, set your preferred configs and pass the instance to the constructor of a DeviceApi or DeviceApiWeb. Note that you may change the configs even after the Config instance has been passed to the DeviceApi.

Author
DeviceAtlas Limited

Member Data Documentation

◆ DEFAULT_COOKIE_NAME

const string Mobi.Mtld.DA.Device.Config.DEFAULT_COOKIE_NAME = "DAPROPS"

The default cookie name that the client side properties would be set to. When using the GetProperties() or GetProperty() of class DeviceApiWeb, the detection would automatically use the contents of this cookie if it exists. If you want the client side properties to be used add the DeviceAtlas client side component (JS lib) to your web-site pages.

◆ DEFAULT_INCLUDE_LANG_PROPS

const bool Mobi.Mtld.DA.Device.Config.DEFAULT_INCLUDE_LANG_PROPS = true

The default config value for GetProperties(HEADERS), GetProperty(HEADERS), GetProperties(REQUEST) or GetProperty(REQUEST) to check the Accept-Language header and include properties to the property set for getting client's language and locale preferences.

◆ DEFAULT_INCLUDE_MATCH_INFO

const bool Mobi.Mtld.DA.Device.Config.DEFAULT_INCLUDE_MATCH_INFO = false

The default config value for GetProperties() or GetProperty() to include the matched and unmatched parts of the User-Agent to the property set.

◆ DEFAULT_INCLUDE_UA_PROPS

const bool Mobi.Mtld.DA.Device.Config.DEFAULT_INCLUDE_UA_PROPS = true

The default config value for GetProperties() or GetProperty() to include User-Agent dynamic properties.

◆ DEFAULT_MAX_CACHE_ENTRIES

const int Mobi.Mtld.DA.Device.Config.DEFAULT_MAX_CACHE_ENTRIES = 4096

The default config value for result (Properties object) caching. Depending on the repeat and distance factor of your user-agents or headers passed to the API for detection the result cache may increase performance by preventing repeated lookups.

◆ DEFAULT_RETURN_NULL_WHEN_NO_PROPERTIES

const bool Mobi.Mtld.DA.Device.Config.DEFAULT_RETURN_NULL_WHEN_NO_PROPERTIES = false

The default config value for GetProperties() return value when there was no properties. true = if no properties return null, false = if no property return an instance of Properties with no Property inside it.

Property Documentation

◆ CookieName

virtual string Mobi.Mtld.DA.Device.Config.CookieName
getset

To change the cookie name that the client side properties would be set to. When using the GetProperties() or GetProperty() of class DeviceApiWeb, the detection would automatically use the contents of this cookie if it exists. If you want the client side properties to be used add the DeviceAtlas client side component (JS lib) to your web-site pages.
When the user-agent or HTTP headers are set manually to GetProperties() or GetProperty(), the client side properties (probably the value set to the cookie) can be manually passed to this methods as the second argument, note that this config is only used for GetProperties(REQUEST-OBJECT) or GetProperty(REQUEST-OBJECT).

Parameters
cookieNameThe cookie name which the client side properties are set to Set to null to turn off using client-side properties.

◆ IncludeLangProps

virtual bool Mobi.Mtld.DA.Device.Config.IncludeLangProps
getset

To disable or enable GetProperties(HEADERS), GetProperty(HEADERS), GetProperties(REQUEST) or GetProperty(REQUEST) including language and locale properties. To check the Accept-Language header and include properties to the property set for getting client's language and locale preferences set to true. If you do not use this properties you can set this config to false to make the detection marginally faster.

Parameters
includeLangPropstrue=include

◆ IncludeMatchInfo

virtual bool Mobi.Mtld.DA.Device.Config.IncludeMatchInfo
getset

To disable or enable GetProperties() or GetProperty() including the matched and unmatched parts of the User-Agent to the property set.

Parameters
includeMatchInfotrue=include

◆ IncludeUaProps

virtual bool Mobi.Mtld.DA.Device.Config.IncludeUaProps
getset

To disable or enable GetProperties() or GetProperty() including User-Agent dynamic properties. Some properties cannot be known before runtime and can change from User-Agent to User-Agent. The most common of these are the OS Version and the Browser Version. The DeviceApi is able to dynamically detect these changing properties with a small overhead. If you do not use this properties you can set this config to false to make the detection a little bit faster.

Parameters
includeUaPropsTrue=include

◆ MaxCacheEntries

virtual int Mobi.Mtld.DA.Device.Config.MaxCacheEntries
getset

Set the max number of results to be cached. Depending on the repeat and distance factor of your user-agents or headers passed to the API for detection, increasing the result cache may increase performance by preventing repeated lookups. For a tight set of inputs (i.e. an almost unique set of user-agents) set to lower numbers or o to disable.

Parameters
maxCacheEntriesmax number of cache entries

◆ ReturnNullWhenNoProperties

virtual bool Mobi.Mtld.DA.Device.Config.ReturnNullWhenNoProperties
getset

Set if the value returned by GetProperties() should be null when there are no properties to return or an instance of Properties that has no Property inside it should be returned.

Parameters
returnNullWhenNoPropertytrue = return null on empty

The documentation for this class was generated from the following file: