C# Class FiftyOne.Foundation.Mobile.Detection.Provider

Represents all device data and capabilities.
Inheritance: FiftyOne.Foundation.Mobile.Detection.BaseProvider
Show file Open project: 51Degrees/dotNET-Device-Detection Class Usage Examples

Public Properties

Property Type Description
DataSet DataSet
MethodCounts long>.SortedList
RecordDetectionTime bool

Private Properties

Property Type Description
GetMatchingHeaderProfile Profile
Match MatchResult
MatchForHeaders MatchState>.Dictionary
MatchNoCache void

Public Methods

Method Description
CreateMatch ( ) : Match

Creates a new FiftyOne.Foundation.Mobile.Detection.Match object to be used for matching.

Dispose ( ) : void

Disposes of the User-Agent cache if one was created.

Match ( NameValueCollection headers ) : Match

For a given collection of HTTP headers returns a match containing information about the capabilities of the device and it's components.

Match ( NameValueCollection headers, Match match ) : Match

Resets the FiftyOne.Foundation.Mobile.Detection.Match object provided and performs the detection using that object rather than creating a new match.

Match ( string targetUserAgent ) : Match

For a given User-Agent returns a match containing information about the capabilities of the device and it's components.

Match ( string targetUserAgent, Match match ) : Match

Resets the FiftyOne.Foundation.Mobile.Detection.Match object provided and performs the detection using that object rather than creating a new match.

MatchForDeviceId ( IList profileIds ) : Match

Returns the result of a match based on the device Id returned from a previous match operation.

MatchForDeviceId ( IList profileIds, Match match ) : Match

Returns the result of a match based on the device Id returned from a previous match operation.

MatchForDeviceId ( byte deviceIdArray ) : Match

Returns the result of a match based on the device Id returned from a previous match operation.

MatchForDeviceId ( byte deviceIdArray, Match match ) : Match

Returns the result of a match based on the device Id returned from a previous match operation.

MatchForDeviceId ( string deviceId ) : Match

Returns the result of a match based on the device Id returned from a previous match operation.

MatchForDeviceId ( string deviceId, Match match ) : Match

Returns the result of a match based on the device Id returned from a previous match operation.

Provider ( DataSet dataSet ) : System

Constructs a new provider using the data set.

Provider ( DataSet dataSet, bool recordDetectionTime, int cacheSize ) : System

Constructs a new provided using the data set.

Provider ( DataSet dataSet, int cacheSize ) : System

Constructs a new provider using the data set.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Disposes of the User-Agent cache if one was created.

Private Methods

Method Description
GetMatchingHeaderProfile ( MatchState state, MatchState>.Dictionary matches, Component component ) : Profile

See if any of the headers can be used for this components profile. As soon as one matches then stop and don't look at any more. They are ordered in preferred sequence such that the first item is the most preferred.

Match ( string targetUserAgent, MatchState state ) : MatchResult

Resets the match object provided and performs the detection using that object rather than creating a new match.

MatchForHeaders ( Match match, NameValueCollection headers, IEnumerable importantHeaders ) : MatchState>.Dictionary

For each of the important HTTP headers provides a mapping to a match result.

MatchNoCache ( string targetUserAgent, MatchState state ) : void

Matches the User-Agent setting the state without using a cache.

Method Details

CreateMatch() public method

Creates a new FiftyOne.Foundation.Mobile.Detection.Match object to be used for matching.
public CreateMatch ( ) : Match
return System.Text.RegularExpressions.Match

Dispose() public method

Disposes of the User-Agent cache if one was created.
public Dispose ( ) : void
return void

Dispose() protected method

Disposes of the User-Agent cache if one was created.
protected Dispose ( bool disposing ) : void
disposing bool /// True if the calling method is Dispose, false for the finaliser. ///
return void

Match() public method

For a given collection of HTTP headers returns a match containing information about the capabilities of the device and it's components.
public Match ( NameValueCollection headers ) : Match
headers System.Collections.Specialized.NameValueCollection /// List of HTTP headers to use for the detection ///
return System.Text.RegularExpressions.Match

Match() public method

Resets the FiftyOne.Foundation.Mobile.Detection.Match object provided and performs the detection using that object rather than creating a new match.
public Match ( NameValueCollection headers, Match match ) : Match
headers System.Collections.Specialized.NameValueCollection /// List of HTTP headers to use for the detection ///
match System.Text.RegularExpressions.Match /// A /// object created by a previous match, or via the /// method. ///
return System.Text.RegularExpressions.Match

Match() public method

For a given User-Agent returns a match containing information about the capabilities of the device and it's components.
public Match ( string targetUserAgent ) : Match
targetUserAgent string /// The User-Agent string to use as the target ///
return System.Text.RegularExpressions.Match

Match() public method

Resets the FiftyOne.Foundation.Mobile.Detection.Match object provided and performs the detection using that object rather than creating a new match.
public Match ( string targetUserAgent, Match match ) : Match
targetUserAgent string /// The User-Agent string to use as the target ///
match System.Text.RegularExpressions.Match /// A /// object created by a previous match, or via the /// method. ///
return System.Text.RegularExpressions.Match

MatchForDeviceId() public method

Returns the result of a match based on the device Id returned from a previous match operation.
public MatchForDeviceId ( IList profileIds ) : Match
profileIds IList List of profile ids as integers
return System.Text.RegularExpressions.Match

MatchForDeviceId() public method

Returns the result of a match based on the device Id returned from a previous match operation.
public MatchForDeviceId ( IList profileIds, Match match ) : Match
profileIds IList List of profile ids as integers
match System.Text.RegularExpressions.Match /// A /// object created by a previous match, or via the /// method. ///
return System.Text.RegularExpressions.Match

MatchForDeviceId() public method

Returns the result of a match based on the device Id returned from a previous match operation.
public MatchForDeviceId ( byte deviceIdArray ) : Match
deviceIdArray byte Byte array representation of the device Id
return System.Text.RegularExpressions.Match

MatchForDeviceId() public method

Returns the result of a match based on the device Id returned from a previous match operation.
public MatchForDeviceId ( byte deviceIdArray, Match match ) : Match
deviceIdArray byte Byte array representation of the device Id
match System.Text.RegularExpressions.Match /// A /// object created by a previous match, or via the /// method. ///
return System.Text.RegularExpressions.Match

MatchForDeviceId() public method

Returns the result of a match based on the device Id returned from a previous match operation.
public MatchForDeviceId ( string deviceId ) : Match
deviceId string String representation of the device Id
return System.Text.RegularExpressions.Match

MatchForDeviceId() public method

Returns the result of a match based on the device Id returned from a previous match operation.
public MatchForDeviceId ( string deviceId, Match match ) : Match
deviceId string String representation of the device Id
match System.Text.RegularExpressions.Match /// A /// object created by a previous match, or via the /// method. ///
return System.Text.RegularExpressions.Match

Provider() public method

Constructs a new provider using the data set.
public Provider ( DataSet dataSet ) : System
dataSet DataSet Data set to use for device detection
return System

Provider() public method

Constructs a new provided using the data set.
public Provider ( DataSet dataSet, bool recordDetectionTime, int cacheSize ) : System
dataSet DataSet Data set to use for device detection
recordDetectionTime bool True if the detection time should be recorded
cacheSize int Size of the cache used with the provider
return System

Provider() public method

Constructs a new provider using the data set.
public Provider ( DataSet dataSet, int cacheSize ) : System
dataSet DataSet Data set to use for device detection
cacheSize int Size of the cache used with the provider
return System

Property Details

DataSet public property

The data set associated with the provider.
public DataSet DataSet
return DataSet

MethodCounts public property

The number of detections performed using the method.
public SortedList MethodCounts
return long>.SortedList

RecordDetectionTime public property

True if the detection time should be recorded in the Elapsed property of the DetectionMatch object.
public bool RecordDetectionTime
return bool