Check out the latest documentation.

Constants - Version 2

Constants and Compiler Flags

The following constants can be used to alter the behaviour of Foundation for your specific requirements. The section title indicates the source code file the constant is contained within, and the bold text shows the name of the content followed by its description.

BinaryConstants.cs - controls the functionality of the binary data reader

  • EmbeddedDataResourceName The name of the embedded resource containing the Lite device data compiled into the assembly.
  • FormatVersion The format version of the binary data contained in the file header. This much match with the data file for the file to be read.

Constants.cs - general constants

  • AzureStorageName Name for Azure cloud storage
  • ConfigFilenames Array of file locations to check for configuration information.

DetectionConstants.cs - controls the operation of the detection module

  • AutoUpdateDelayedStart The length of time to wait before starting the auto update process. Set to zero to disable auto update.
  • AutoUpdateUrl The URL to use to get the latest device data from if a Premium licence key is provided.
  • AutoUpdateWait The length of time to wait before checking for a newer version of the device data file.
  • CompressedFileExtensions Extensions to indicate a file is compressed.
  • DefaultBinaryFilePath The default path to use for the binary data file.
  • DefaultPropertyValues An array of default values for properties where they can't be found and a value must be provided.
  • DetectionTimeProperty The length of time taken to locate the device returned. This property is set in the MobileCapabilities class and is not part of the Providers.
  • DeviceId The name of the unique property key used to return the device id.
  • ExcludePropertiesFromAllProperties A list of properties to exclude from the AllProperties results.
  • FiftyOneDegreesProperties The key used to identify the list of 51Degrees.mobi properties in the capabilities collection of the HttpBrowserCapabilities class.
  • ForceSingleProcessor Forces the useragent matcher to use a single thread if multiple processors are available.
  • LicenceKeyFileName The preferred name of the licence key file.
  • LicenceKeyValidationRegex A regular expression used to valid licence key formats.
  • NewDeviceDetail The detail that should be provided relating to new devices.
  • NewDevicesUrl The URL device information should be sent to. Set to an empty string to disable usage data sharing.
  • NewUrlTimeOut Length of time in ms the new devices thread should wait for a response from the web server used to record new device information.
  • PremiumLicenceKey If premium data is being used with Foundation the licence key can be provided in the following constant or in a file with the extension .lic in the bin folder.
  • ProfileSeperator The character used to seperate profile integer values in the device id.
  • StoreSegmentResults Improves performance of segment handlers by storing the results of useragent segment matches to improve performance at the expense of memory consumption. Set this to false to reduce memory consumption.
  • TranscoderUserAgentHeaders Array of transcoder HTTP headers that represent the useragent string of the mobile device rather than the desktop browser.
  • UserAgentHeader The Http header field that contains the user agent.
  • UserAgentProfiles The name of the property which contains the user agent profile.
  • ValueSeperator The character used to seperate property values when concatenated as a single string.

RedirectionConstants.cs - controls the operation of the redirection module

  • AlreadyAccessedCookieName Used to indicate the device has already accessed the web site.
  • ExpiryTime Set the UTC date and time that details of the device should be removed from all storage mechanisims.
  • LocationUrlKey The key in the Items collection of the requesting context used to store the home page Url for a possible redirection.
  • MobilePages Full type names of classes representing mobile page handlers.
  • OriginalUrlKey The key in the Items collection of the requesting context used to store the Url originally requested by the browser.
  • OriginalUrlSpecialProperty The property name to use to access the original Url for the request.
  • Pages Full type names of classes representing standard page handlers.

RetailerConstants.cs - configures the default operation of functionality related to affiliate and reseller implementations

  • RetailerName The default name of the retailer.
  • RetailerUrl The default url to send customers to when they want to find out more and purchase.

UIConstants.cs - configures the information displayed in the UserControls and UI data provider

  • Browser List of properties associated with the browser.
  • Content List of properties associated wtih the type of content the browser/device can display.
  • Hardware List of properties which are associated with the physical hardware.
  • Logo The 51Degrees.mobi thumbnail logo.
  • Software List of properties associated with the operating system or software.

Compiler Flags

  • VER2 Compiles the Foundation using .NET 2.
  • REMOVE_OVERRIDE_BROWSER The Foundation will no longer override the Request.Browser object.