using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Utility
{
public class wurfl
{
private static string[] mc_devices = { "current device", "Mozilla/5.0 (iPhone;", "NokiaN92-2", "SAMSUNG-SGH-i900/1.0", "Nokia6600" };
public static string[] capabilities
{
get
{
return Enum.GetNames(typeof(Capabilities));
}
}
public static string[] devices
{
get
{
return mc_devices;
}
}
/// <summary>
/// The capability names used by WURFL.
/// see: http://wurfl.sourceforge.net/help_doc.php
/// These values must be included in the web application web.config file,
/// if any values are added to configuration/redcircle.framework/capabilitiesWhiteList,
/// in the format: <add capabilityName="mobile_browser"/>
/// </summary>
public enum Capabilities
{
// product_info
mobile_browser,
// xhtml_ui
xhtml_support_level,
xhtml_honors_bgcolor,
xhtml_supports_forms_in_table,
xhtml_support_wml2_namespace,
xhtml_autoexpand_select,
xhtml_select_as_dropdown,
xhtml_select_as_radiobutton,
xhtml_select_as_popup,
xhtml_display_accesskey,
xhtml_supports_invisible_text,
xhtml_supports_inline_input,
xhtml_supports_monospace_font,
xhtml_supports_table_for_layout,
xhtml_supports_css_cell_table_coloring,
xhtml_format_as_css_property,
xhtml_format_as_attribute,
xhtml_nowrap_mode,
xhtml_marquee_as_css_property,
xhtml_readable_background_color1,
xhtml_readable_background_color2,
xhtml_allows_disabled_form_elements,
xhtml_document_title_support,
xhtml_preferred_charset,
opwv_xhtml_extensions_support,
xhtml_make_phone_call_string,
xhtmlmp_preferred_mime_type,
xhtml_table_support,
xhtml_supports_file_upload,
xhtml_send_sms_string,
xhtml_send_mms_string,
xhtml_file_upload,
xhtml_support_iframe,
cookie_support,
accept_third_party_cookie,
// css
css_supports_width_as_percentage,
// ajax
ajax_support_javascript,
ajax_support_getelementbyid,
ajax_xhr_type,
ajax_support_inner_html,
ajax_manipulate_dom,
ajax_manipulate_css,
ajax_support_events,
ajax_support_event_listener,
// display
resolution_width,
resolution_height,
columns,
rows,
max_image_width,
max_image_height
}
public enum Implementation
{
RED_CIRCLE,
MARGE,
WURFL_API
}
public static string formatLog(double vi_ellapsed, string vs_userAgent, string vs_capability)
{
return vi_ellapsed + " ms - " + vs_userAgent.Split(' ')[0] + "." + vs_capability;
}
}
}