public string[] GetProperties(string[] propertyNames)
{
// Checks if the array is populated.
if (propertyNames == null)
return null;
// Cycles through the array and replaces the property string with the resulting property string.
for (int i = 0; i < propertyNames.Length; i++)
{
// First looks for a 51Degrees.mobi property name.
if (Context.Request.Browser[propertyNames[i]] != null)
propertyNames[i] = Context.Request.Browser[propertyNames[i]];
// Then tries a .NET property name.
else if (Context.Request.Browser.Capabilities[propertyNames[i]] != null)
propertyNames[i] = Context.Request.Browser.Capabilities[propertyNames[i]].ToString();
// Property name not found, give null instead.
else
propertyNames[i] = null;
}
return propertyNames;
}