You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devicemap.apache.org by bd...@apache.org on 2012/10/02 15:34:35 UTC

svn commit: r1392912 [2/8] - in /incubator/devicemap/trunk/openddr/csharp: ./ DDR-Simple-API/ DDR-Simple-API/Exceptions/ DDR-Simple-API/Models/ DDR-Simple-API/Properties/ DDR-Simple-API/Simple/ OpenDDR-CSharp/ OpenDDR-CSharp/Builders/ OpenDDR-CSharp/Bu...

Added: incubator/devicemap/trunk/openddr/csharp/DDR-Simple-API/Simple/IPropertyValue.cs
URL: http://svn.apache.org/viewvc/incubator/devicemap/trunk/openddr/csharp/DDR-Simple-API/Simple/IPropertyValue.cs?rev=1392912&view=auto
==============================================================================
--- incubator/devicemap/trunk/openddr/csharp/DDR-Simple-API/Simple/IPropertyValue.cs (added)
+++ incubator/devicemap/trunk/openddr/csharp/DDR-Simple-API/Simple/IPropertyValue.cs Tue Oct  2 13:34:31 2012
@@ -0,0 +1,77 @@
+/**
+ * Copyright 2011 OpenDDR LLC
+ * This software is distributed under the terms of the GNU Lesser General Public License.
+ *
+ *
+ * This file is part of OpenDDR Simple APIs.
+ * OpenDDR Simple APIs is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3 of the License.
+ *
+ * OpenDDR Simple APIs is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Simple APIs.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace W3c.Ddr.Simple
+{
+    /// <summary>
+    /// PropertyValue models a PropertyRef together with its value
+    /// </summary>
+    /// <remarks>
+    /// Values may be empty, in which case the method exists returns false. An attempt to query an empty value causes a ValueException as does an attempt to query a value with an incompatible accessor method (string as float, for example). For the getString method implementations must return an implementation dependent String representation if the type of the value is not natively String. For other methods if the underlying type of the data does not match the method signature then a ValueException must be thrown.
+    /// </remarks>
+    public interface IPropertyValue
+    {
+        /// <summary>Value Retrieval</summary>
+        /// <exception cref="ValueException">Throws when query an empty value or attempt to query a value with an incompatible type</exception>
+        double GetDouble();
+
+        /// <summary>Value Retrieval</summary>
+        /// <exception cref="ValueException">Throws when query an empty value or attempt to query a value with an incompatible type</exception>
+        long GetLong();
+
+        /// <summary>Value Retrieval</summary>
+        /// <exception cref="ValueException">Throws when query an empty value or attempt to query a value with an incompatible type</exception>
+        bool GetBoolean();
+
+        /// <summary>Value Retrieval</summary>
+        /// <exception cref="ValueException">Throws when query an empty value or attempt to query a value with an incompatible type</exception>
+        int GetInteger();
+
+        /// <summary>Value Retrieval</summary>
+        /// <exception cref="ValueException">Throws when query an empty value or attempt to query a value with an incompatible type</exception>
+        String[] GetEnumeration();
+
+        /// <summary>Value Retrieval</summary>
+        /// <exception cref="ValueException">Throws when query an empty value or attempt to query a value with an incompatible type</exception>
+        float GetFloat();
+
+        /// <summary>
+        /// Property Reference
+        /// </summary>
+        /// <returns>The PropertyRef that this PropertyValue refers to.</returns>
+        IPropertyRef PropertyRef();
+
+        /// <summary>Value Retrieval</summary>
+        /// <exception cref="ValueException">Throws when query an empty value or attempt to query a value with an incompatible type</exception>
+        String GetString();
+
+        /// <summary>
+        /// Existence
+        /// </summary>
+        /// <returns>True if a value is available, false otherwise.</returns>
+        bool Exists();
+    }
+}

Added: incubator/devicemap/trunk/openddr/csharp/DDR-Simple-API/Simple/IPropertyValues.cs
URL: http://svn.apache.org/viewvc/incubator/devicemap/trunk/openddr/csharp/DDR-Simple-API/Simple/IPropertyValues.cs?rev=1392912&view=auto
==============================================================================
--- incubator/devicemap/trunk/openddr/csharp/DDR-Simple-API/Simple/IPropertyValues.cs (added)
+++ incubator/devicemap/trunk/openddr/csharp/DDR-Simple-API/Simple/IPropertyValues.cs Tue Oct  2 13:34:31 2012
@@ -0,0 +1,47 @@
+/**
+ * Copyright 2011 OpenDDR LLC
+ * This software is distributed under the terms of the GNU Lesser General Public License.
+ *
+ *
+ * This file is part of OpenDDR Simple APIs.
+ * OpenDDR Simple APIs is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3 of the License.
+ *
+ * OpenDDR Simple APIs is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Simple APIs.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace W3c.Ddr.Simple
+{
+    /// <summary>
+    /// A set of PropertyValues.
+    /// </summary>
+    public interface IPropertyValues
+    {
+        /// <summary>
+        /// Get All Properties in the Set
+        /// </summary>
+        /// <returns>Return an array of IPropertyValue</returns>
+        IPropertyValue[] GetAll();
+
+        /// <summary>
+        /// Get the Named Property
+        /// </summary>
+        /// <returns>Return the IPropertyValue associated to the requested IPropertyRef </returns>
+        /// <exception cref="NameException">Throws when...</exception>
+        IPropertyValue GetValue(IPropertyRef pr);
+    }
+}

Added: incubator/devicemap/trunk/openddr/csharp/DDR-Simple-API/Simple/IService.cs
URL: http://svn.apache.org/viewvc/incubator/devicemap/trunk/openddr/csharp/DDR-Simple-API/Simple/IService.cs?rev=1392912&view=auto
==============================================================================
--- incubator/devicemap/trunk/openddr/csharp/DDR-Simple-API/Simple/IService.cs (added)
+++ incubator/devicemap/trunk/openddr/csharp/DDR-Simple-API/Simple/IService.cs Tue Oct  2 13:34:31 2012
@@ -0,0 +1,200 @@
+/**
+ * Copyright 2011 OpenDDR LLC
+ * This software is distributed under the terms of the GNU Lesser General Public License.
+ *
+ *
+ * This file is part of OpenDDR Simple APIs.
+ * OpenDDR Simple APIs is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3 of the License.
+ *
+ * OpenDDR Simple APIs is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Simple APIs.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using W3c.Ddr.Models;
+
+namespace W3c.Ddr.Simple
+{
+    /// <summary>
+    /// The Service interface is the core of the DDR Simple API
+    /// </summary>
+    /// <remarks>
+    /// Using methods of Service the caller supplies Evidence representing the Delivery Context and an indication of the Properties of interest. These methods return PropertyValue objects which can then be queried to reveal the values of the Properties of interest.
+    /// The Service may be instantiated by a supplied factory class.
+    /// The class invokes the initialize method to establish a Default Vocabulary and to pass implementation specific settings.
+    /// Whether or not the underlying implementation combines more than one source of data is opaque to the user of the API. The API makes no assumptions about the number of sources of data.
+    /// All implementations are required to support Evidence consisting of name/value pairs of HTTP headers.
+    /// The methods of the Service interface fall into the following categories: Factory Methods, Query Methods, Information Methods, Initialization.
+    /// The "Factory" methods provide a means of instantiating objects that support the interfaces defined in the Recommendation that is consistent between implementations. Implementations may provide other means of instantiating the interfaces.
+    /// Query methods return values for Properties of the Delivery Context represented by the supplied Evidence.
+    /// Information methods return information about the implementation.
+    /// Initialization method initialize the library.
+    /// </remarks>
+    public interface IService
+    {   
+        /// <summary>
+        /// Initialize the Library. Called by the ServiceFactory Class to initialize the implementation. Implementation specific initialization parameters may be passed using the props parameter.
+        /// </summary>
+        /// <exception cref="NameException">Throws when...</exception>
+        /// <exception cref="InitializationException">Throws when...</exception>
+        void Initialize(String defaultVocabularyIRI, Properties prprts);
+
+        /// <summary>
+        /// Get Implementation Version.
+        /// </summary>
+        /// <returns>Returns information about the implementation of the API including the current version. This may be used for diagnostic purposes, particularly where the implementation language does not already provide a means for obtaining such information.</returns>
+        String GetAPIVersion();
+
+        /// <summary>
+        /// Get Data Version
+        /// </summary>
+        /// <returns>Returns information about the underlying data (values for Properties) if the implementation has a versioning system for that information.</returns>
+        String GetDataVersion();
+
+        /// <summary>
+        /// List Properties
+        /// </summary>
+        /// <returns>Lists the combination of all known Properties and Aspects in all Vocabularies that can be used without causing a NameException to be thrown. The order in which Properties are listed is not significant.</returns>
+        IPropertyRef[] ListPropertyRefs();
+
+        /// <summary>
+        /// Return the value of a specific Property
+        /// </summary>
+        /// <param name="evdnc">The specified IEvidence</param>
+        /// <param name="pr">The supplied Property</param>
+        /// <returns>Return the value of a specific Property</returns>
+        /// <exception cref="NameException">Throws when...</exception>
+        IPropertyValue GetPropertyValue(IEvidence evdnc, IPropertyRef pr);
+
+        /// <summary>
+        /// Return the value of a specific Property in its Default Aspect in the Vocabulary specified by propertyName
+        /// </summary>
+        /// <param name="evdnc">The specified IEvidence</param>
+        /// <param name="pn">The IPropertyName for the property</param>
+        /// <returns>Return the value of a specific Property in its Default Aspect in the Vocabulary specified by propertyName</returns>
+        IPropertyValue GetPropertyValue(IEvidence evdnc, IPropertyName pn);
+
+        /// <summary>
+        /// Return the value of a specific Property in its Default Aspect in the Default Vocabulary
+        /// </summary>
+        /// <param name="evdnc">The specified IEvidence</param>
+        /// <param name="localPropertyName">The name of the property</param>
+        /// <returns>Return the value of a specific Property in its Default Aspect in the Default Vocabulary</returns>
+        /// <exception cref="NameException">Throws when...</exception>
+        IPropertyValue GetPropertyValue(IEvidence evdnc, String localPropertyName);
+
+        /// <summary>
+        /// Return the value of a specific Property with a specific Aspect in a specific Vocabulary.
+        /// </summary>
+        /// <param name="evdnc">The specified IEvidence</param>
+        /// <param name="localPropertyName">The name of the property</param>
+        /// <param name="localAspectName">The aspect of the property</param>
+        /// <param name="vocabularyIRI">The vocabulary of the property</param>
+        /// <returns>Return the value of a specific Property with a specific Aspect in a specific Vocabulary.</returns>
+        /// <exception cref="NameException">Throws when...</exception>
+        IPropertyValue GetPropertyValue(IEvidence evdnc, String localPropertyName, String localAspectName, String vocabularyIRI);
+
+        /// <summary>
+        /// Return all available Property values for all the Aspects and Vocabularies known by an implementation of the DDR Simple API
+        /// </summary>
+        /// <param name="evdnc">The specified IEvidence</param>
+        /// <returns>Return all available Property values for all the Aspects and Vocabularies</returns>
+        /// <exception cref="NameException">Throws when...</exception>
+        IPropertyValues GetPropertyValues(IEvidence evdnc);
+
+        /// <summary>
+        /// Return values for all the supplied Properties, returning empty values for those that are not known. An "unknown value" is distinguished by the PropertyValue exists() method returning false.
+        /// </summary>
+        /// <param name="evdnc">The specified IEvidence</param>
+        /// <param name="prs">The supplied Properties</param>
+        /// <returns>Return values for all the supplied Properties</returns>
+        /// <exception cref="NameException">Throws when...</exception>
+        IPropertyValues GetPropertyValues(IEvidence evdnc, IPropertyRef[] prs);
+
+        /// <summary>
+        /// Return all known values for the given Aspect of the Default Vocabulary
+        /// </summary>
+        /// <param name="evdnc">The specified IEvidence</param>
+        /// <param name="localAspectName">The specified Aspect</param>
+        /// <returns>Return all known values for the given Aspect of the Default Vocabulary</returns>
+        /// <exception cref="NameException">Throws when...</exception>
+        IPropertyValues GetPropertyValues(IEvidence evdnc, String localAspectName);
+
+        /// <summary>
+        /// Return all known values for an Aspect of a specified Vocabulary
+        /// </summary>
+        /// <param name="evdnc">The specified IEvidence</param>
+        /// <param name="localAspectName">The specified Aspect</param>
+        /// <param name="vocabularyIRI">The specified Namespace</param>
+        /// <returns>Return all known values for an Aspect of a specified Vocabulary</returns>
+        /// <exception cref="NameException">Throws when...</exception>
+        IPropertyValues GetPropertyValues(IEvidence evdnc, String localAspectName, String vocabularyIRI);
+
+        /// <summary>
+        /// Create PropertyName using Default Vocabulary
+        /// </summary>
+        /// <param name="localPropertyName">The name of the property.</param>
+        /// <returns>Return the IPropertyName</returns>
+        /// <exception cref="NameException">Throws when the localPropertyName is not defined in the Default Vacabulary</exception>
+        IPropertyName NewPropertyName(String localPropertyName);
+
+        /// <summary>
+        /// Create PropertyName with specified Vocabulary
+        /// </summary>
+        /// <param name="localPropertyName">The name of the property.</param>
+        /// <param name="vocabularyIRI">The Vocabulary namespace.</param>
+        /// <returns>Return the IPropertyName</returns>
+        /// <exception cref="NameException">Throws when the localPropertyName is not defined in the Vacabulary identified by vocabularyIRI</exception>
+        IPropertyName NewPropertyName(String localPropertyName, String vocabularyIRI);
+
+        /// <summary>
+        /// Create PropertyRef using Default Vocabulary and Aspect
+        /// </summary>
+        /// <param name="localPropertyName">The name of the property.</param>
+        /// <returns>Return the IPropertyRef</returns>
+        /// <exception cref="NameException">Throws when the localPropertyName is not defined in the Default Vacabulary</exception>
+        IPropertyRef NewPropertyRef(String localPropertyName);
+
+        /// <summary>
+        /// Create PropertyRef from PropertyName using Default Aspect. The Aspect of the PropertyRef created is the default Aspect of the Property in the Vocabulary determined by the propertyName parameter.
+        /// </summary>
+        /// <param name="pn">The IPropertyName for the property</param>
+        /// <returns>Return the IPropertyRef</returns>
+        /// <exception cref="NameException">Throws when the pn is not defined</exception>
+        IPropertyRef NewPropertyRef(IPropertyName pn);
+
+        /// <summary>
+        /// Create PropertyRef from PropertyName in Named Aspect. The namespace associated with the Aspect localAspectName is associated with the namespace of the propertyName parameter.
+        /// </summary>
+        /// <param name="pn">The IPropertyName for the property</param>
+        /// <param name="localAspectName">The aspect of the property</param>
+        /// <returns>Return the IPropertyRef</returns>
+        /// <exception cref="NameException">Throws when the pn and the localAspectName are not defined</exception>
+        IPropertyRef NewPropertyRef(IPropertyName pn, String localAspectName);
+
+        /// <summary>
+        /// Create Empty HTTP Evidence
+        /// </summary>
+        /// <returns>Return an empty Evidence</returns>
+        IEvidence NewHTTPEvidence();
+
+        /// <summary>
+        /// Create HTTP Evidence from Map
+        /// </summary>
+        /// <param name="map">The Map parameter contains name/value pairs representing HTTP Header names and values.</param>
+        /// <returns>Return an Evidence filled with map</returns>
+        IEvidence NewHTTPEvidence(Dictionary<String, String> map);
+    }
+}

Added: incubator/devicemap/trunk/openddr/csharp/DDR-Simple-API/Simple/ServiceFactory.cs
URL: http://svn.apache.org/viewvc/incubator/devicemap/trunk/openddr/csharp/DDR-Simple-API/Simple/ServiceFactory.cs?rev=1392912&view=auto
==============================================================================
--- incubator/devicemap/trunk/openddr/csharp/DDR-Simple-API/Simple/ServiceFactory.cs (added)
+++ incubator/devicemap/trunk/openddr/csharp/DDR-Simple-API/Simple/ServiceFactory.cs Tue Oct  2 13:34:31 2012
@@ -0,0 +1,88 @@
+/**
+ * Copyright 2011 OpenDDR LLC
+ * This software is distributed under the terms of the GNU Lesser General Public License.
+ *
+ *
+ * This file is part of OpenDDR Simple APIs.
+ * OpenDDR Simple APIs is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3 of the License.
+ *
+ * OpenDDR Simple APIs is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Simple APIs.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using W3c.Ddr.Models;
+using W3c.Ddr.Exceptions;
+using System.Reflection;
+
+namespace W3c.Ddr.Simple
+{
+    /// <summary>
+    /// Defines a factory for instantiating Service with the supplied default namespace and configuration.
+    /// </summary>
+    public class ServiceFactory
+    {
+        
+        //public static IService newService(String clazz, String defaultVocabulary, Properties configuration)
+        /// <summary>
+        /// Instantiates an instance of the Type serviceType establishing the Default Vocabulary to be the one specified and with implementation specific values passed as Properties.
+        /// </summary>
+        /// <param name="serviceType">The interface implementation</param>
+        /// <param name="defaultVocabulary">The default vocabulary</param>
+        /// <param name="configuration">The Property</param>
+        /// <returns>Return the service instance</returns>
+        /// <exception cref="InitializationException">Throws when...</exception>
+        /// <exception cref="NameException">Throws when...</exception>
+        public static IService newService(Type serviceType, String defaultVocabulary, Properties configuration)
+        {
+
+		    IService theService = null;
+
+            if (serviceType == null)
+            {
+                throw new W3c.Ddr.Exceptions.SystemException(W3c.Ddr.Exceptions.SystemException.ILLEGAL_ARGUMENT, "Service class cannot be null");
+		    }
+
+		    if (defaultVocabulary == null)
+            {
+                throw new W3c.Ddr.Exceptions.SystemException(W3c.Ddr.Exceptions.SystemException.ILLEGAL_ARGUMENT, "Default vocabulary cannot be null");
+		    }
+
+            try
+            {
+                // Instantiation
+                //Type serviceType = Type.GetType(clazz, true);
+                theService = (IService)Activator.CreateInstance(serviceType);
+            }
+            catch (TargetInvocationException e)
+            {
+                throw new InitializationException(InitializationException.INITIALIZATION_ERROR, e);
+            }
+            catch (ArgumentException e)
+            {
+                throw new InitializationException(InitializationException.INITIALIZATION_ERROR, e);
+            }
+            catch (Exception thr)
+            {
+                throw new W3c.Ddr.Exceptions.SystemException(W3c.Ddr.Exceptions.SystemException.CANNOT_PROCEED, thr);
+            }
+
+		    // Initialization
+		    theService.Initialize(defaultVocabulary, configuration);
+
+		    return theService;
+	    }
+    }
+}

Added: incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp.sln
URL: http://svn.apache.org/viewvc/incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp.sln?rev=1392912&view=auto
==============================================================================
--- incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp.sln (added)
+++ incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp.sln Tue Oct  2 13:34:31 2012
@@ -0,0 +1,57 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual C# Express 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenDDR-CSharp", "OpenDDR-CSharp\OpenDDR-CSharp.csproj", "{67A3A231-64F0-49F2-BD02-316995E7A737}"
+	ProjectSection(ProjectDependencies) = postProject
+		{F802E34F-10F1-4334-9099-3F1579DC4F06} = {F802E34F-10F1-4334-9099-3F1579DC4F06}
+	EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DDR-Simple-API", "DDR-Simple-API\DDR-Simple-API.csproj", "{F802E34F-10F1-4334-9099-3F1579DC4F06}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenDDRTest", "OpenDDRTest\OpenDDRTest.csproj", "{C1ECDE8F-0B77-422D-B4B6-0CF2239C7FA2}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Debug|Mixed Platforms = Debug|Mixed Platforms
+		Debug|x86 = Debug|x86
+		Release|Any CPU = Release|Any CPU
+		Release|Mixed Platforms = Release|Mixed Platforms
+		Release|x86 = Release|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{67A3A231-64F0-49F2-BD02-316995E7A737}.Debug|Any CPU.ActiveCfg = Debug|x86
+		{67A3A231-64F0-49F2-BD02-316995E7A737}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+		{67A3A231-64F0-49F2-BD02-316995E7A737}.Debug|Mixed Platforms.Build.0 = Debug|x86
+		{67A3A231-64F0-49F2-BD02-316995E7A737}.Debug|x86.ActiveCfg = Debug|x86
+		{67A3A231-64F0-49F2-BD02-316995E7A737}.Debug|x86.Build.0 = Debug|x86
+		{67A3A231-64F0-49F2-BD02-316995E7A737}.Release|Any CPU.ActiveCfg = Release|x86
+		{67A3A231-64F0-49F2-BD02-316995E7A737}.Release|Mixed Platforms.ActiveCfg = Release|x86
+		{67A3A231-64F0-49F2-BD02-316995E7A737}.Release|Mixed Platforms.Build.0 = Release|x86
+		{67A3A231-64F0-49F2-BD02-316995E7A737}.Release|x86.ActiveCfg = Release|x86
+		{67A3A231-64F0-49F2-BD02-316995E7A737}.Release|x86.Build.0 = Release|x86
+		{F802E34F-10F1-4334-9099-3F1579DC4F06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{F802E34F-10F1-4334-9099-3F1579DC4F06}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{F802E34F-10F1-4334-9099-3F1579DC4F06}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+		{F802E34F-10F1-4334-9099-3F1579DC4F06}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+		{F802E34F-10F1-4334-9099-3F1579DC4F06}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{F802E34F-10F1-4334-9099-3F1579DC4F06}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{F802E34F-10F1-4334-9099-3F1579DC4F06}.Release|Any CPU.Build.0 = Release|Any CPU
+		{F802E34F-10F1-4334-9099-3F1579DC4F06}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+		{F802E34F-10F1-4334-9099-3F1579DC4F06}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+		{F802E34F-10F1-4334-9099-3F1579DC4F06}.Release|x86.ActiveCfg = Release|Any CPU
+		{C1ECDE8F-0B77-422D-B4B6-0CF2239C7FA2}.Debug|Any CPU.ActiveCfg = Debug|x86
+		{C1ECDE8F-0B77-422D-B4B6-0CF2239C7FA2}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+		{C1ECDE8F-0B77-422D-B4B6-0CF2239C7FA2}.Debug|Mixed Platforms.Build.0 = Debug|x86
+		{C1ECDE8F-0B77-422D-B4B6-0CF2239C7FA2}.Debug|x86.ActiveCfg = Debug|x86
+		{C1ECDE8F-0B77-422D-B4B6-0CF2239C7FA2}.Debug|x86.Build.0 = Debug|x86
+		{C1ECDE8F-0B77-422D-B4B6-0CF2239C7FA2}.Release|Any CPU.ActiveCfg = Release|x86
+		{C1ECDE8F-0B77-422D-B4B6-0CF2239C7FA2}.Release|Mixed Platforms.ActiveCfg = Release|x86
+		{C1ECDE8F-0B77-422D-B4B6-0CF2239C7FA2}.Release|Mixed Platforms.Build.0 = Release|x86
+		{C1ECDE8F-0B77-422D-B4B6-0CF2239C7FA2}.Release|x86.ActiveCfg = Release|x86
+		{C1ECDE8F-0B77-422D-B4B6-0CF2239C7FA2}.Release|x86.Build.0 = Release|x86
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

Added: incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp.suo
URL: http://svn.apache.org/viewvc/incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp.suo?rev=1392912&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp.suo
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/AndroidMobileBrowserBuilder.cs
URL: http://svn.apache.org/viewvc/incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/AndroidMobileBrowserBuilder.cs?rev=1392912&view=auto
==============================================================================
--- incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/AndroidMobileBrowserBuilder.cs (added)
+++ incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/AndroidMobileBrowserBuilder.cs Tue Oct  2 13:34:31 2012
@@ -0,0 +1,125 @@
+/**
+ * Copyright 2011 OpenDDR LLC
+ * This software is distributed under the terms of the GNU Lesser General Public License.
+ *
+ *
+ * This file is part of OpenDDR Simple APIs.
+ * OpenDDR Simple APIs is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3 of the License.
+ *
+ * OpenDDR Simple APIs is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Simple APIs.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Oddr.Models.Browsers;
+using Oddr.Models;
+using System.Text.RegularExpressions;
+
+namespace Oddr.Builders.Browsers
+{
+    public class AndroidMobileBrowserBuilder : LayoutEngineBrowserBuilder
+    {
+        private const String VERSION_REGEXP = ".*Version/([0-9\\.]+).*?";
+        private const String SAFARI_REGEXP = ".*Safari/([0-9\\.]+).*?";
+        private static Regex versionRegex = new Regex(VERSION_REGEXP, RegexOptions.Compiled);
+        private static Regex safariRegex = new Regex(SAFARI_REGEXP, RegexOptions.Compiled);
+
+        protected override Browser BuildBrowser(UserAgent userAgent, string layoutEngine, string layoutEngineVersion, int hintedWidth, int hintedHeight)
+        {            
+            if (!userAgent.containsAndroid || !userAgent.mozillaPattern || userAgent.completeUserAgent.Contains("Fennec"))
+            {
+                return null;
+            }
+
+            int confidence = 70;
+            Browser identified = new Browser();
+
+            identified.SetVendor("Google");
+            identified.SetModel("Android Browser");
+            
+            if (versionRegex.IsMatch(userAgent.completeUserAgent)) 
+            {
+                Match versionMatcher = versionRegex.Match(userAgent.completeUserAgent);
+                GroupCollection groups = versionMatcher.Groups;
+                if (groups[1] != null && groups[1].Value.Trim().Length > 0) {
+                    identified.SetVersion(groups[1].Value);
+                    string versionFullString = groups[1].Value;
+                    String[] version = versionFullString.Split(".".ToCharArray());
+
+                    if (version.Length > 0)
+                    {
+                        identified.majorRevision = version[0];
+                    }
+
+                    if (version.Length > 1)
+                    {
+                        identified.minorRevision = version[1];
+                        confidence += 10;
+                    }
+
+                    if (version.Length > 2)
+                    {
+                        identified.microRevision = version[2];
+                    }
+
+                    if (version.Length > 3)
+                    {
+                        identified.nanoRevision = version[3];
+                    }
+                }
+
+            } else
+            {
+                //fallback version
+                identified.SetVersion("1.0");
+                identified.majorRevision = "1";
+            }
+
+            if (layoutEngine != null)
+            {
+                identified.SetLayoutEngine(layoutEngine);
+                identified.SetLayoutEngineVersion(layoutEngineVersion);
+
+                if (layoutEngine.Equals(LayoutEngineBrowserBuilder.APPLEWEBKIT))
+                {
+                    confidence += 10;
+                }
+            }
+
+            if (safariRegex.IsMatch(userAgent.completeUserAgent))
+            {
+                Match safariMatch = safariRegex.Match(userAgent.completeUserAgent);
+                GroupCollection groups = safariMatch.Groups;
+                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
+                {
+                    identified.SetReferenceBrowser("Safari");
+                    identified.SetReferenceBrowserVersion(groups[1].Value);
+                    confidence += 10;
+                }
+            }
+
+            identified.SetDisplayWidth(hintedWidth);
+            identified.SetDisplayHeight(hintedHeight);
+            identified.confidence = confidence;
+
+            return identified;
+        }
+
+        public override bool CanBuild(UserAgent userAgent)
+        {
+            return userAgent.containsAndroid;
+        }
+    }
+}

Added: incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/BlackBerryBrowserBuilder.cs
URL: http://svn.apache.org/viewvc/incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/BlackBerryBrowserBuilder.cs?rev=1392912&view=auto
==============================================================================
--- incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/BlackBerryBrowserBuilder.cs (added)
+++ incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/BlackBerryBrowserBuilder.cs Tue Oct  2 13:34:31 2012
@@ -0,0 +1,126 @@
+/**
+ * Copyright 2011 OpenDDR LLC
+ * This software is distributed under the terms of the GNU Lesser General Public License.
+ *
+ *
+ * This file is part of OpenDDR Simple APIs.
+ * OpenDDR Simple APIs is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3 of the License.
+ *
+ * OpenDDR Simple APIs is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Simple APIs.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Oddr.Models.Browsers;
+using Oddr.Models;
+using System.Text.RegularExpressions;
+
+namespace Oddr.Builders.Browsers
+{
+    public class BlackBerryBrowserBuilder : LayoutEngineBrowserBuilder
+    {
+        private const String BLACKBERRY_VERSION_REGEXP = ".*(?:(?:Version)|(?:[Bb]lack.?[Bb]erry.?(?:[0-9a-z]+)))/([0-9\\.]+).*";//"(?:.*?Version.?([0-9\\.]+).*)|(?:.*?[Bb]lack.?[Bb]erry(?:\\d+)/([0-9\\.]+).*)";
+        private const String SAFARI_VERSION_REGEXP = ".*Safari/([0-9\\.]+).*";
+        private static Regex blackberryVersionRegex = new Regex(BLACKBERRY_VERSION_REGEXP, RegexOptions.Compiled);
+        private static Regex safariVersionRegex = new Regex(SAFARI_VERSION_REGEXP, RegexOptions.Compiled);
+
+        protected override Browser BuildBrowser(UserAgent userAgent, string layoutEngine, string layoutEngineVersion, int hintedWidth, int hintedHeight)
+        {
+            int confidence = 50;
+            Browser identified = new Browser();
+
+            identified.SetVendor("RIM");
+            identified.SetModel("BlackBerry");
+            identified.SetVersion("-");
+            identified.majorRevision = "-";
+
+            if (blackberryVersionRegex.IsMatch(userAgent.completeUserAgent))
+            {
+                Match blackberryBrowserMatcher = blackberryVersionRegex.Match(userAgent.completeUserAgent);
+                GroupCollection groups = blackberryBrowserMatcher.Groups;
+                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
+                {
+                    String totalVersion = groups[1].Value;
+
+                    if (totalVersion.Length > 0)
+                    {
+                        identified.SetVersion(totalVersion);
+                        String[] version = totalVersion.Split(".".ToCharArray());
+
+                        if (version.Length > 0)
+                        {
+                            identified.majorRevision = version[0];
+                            if (identified.majorRevision.Length == 0)
+                            {
+                                identified.majorRevision = "1";
+                            }
+                        }
+
+                        if (version.Length > 1)
+                        {
+                            identified.minorRevision = version[1];
+                            confidence += 10;
+                        }
+
+                        if (version.Length > 2)
+                        {
+                            identified.microRevision = version[2];
+                        }
+
+                        if (version.Length > 3)
+                        {
+                            identified.nanoRevision = version[3];
+                        }
+                    }
+                }
+
+            }
+
+            if (layoutEngine != null)
+            {
+                identified.SetLayoutEngine(layoutEngine);
+                identified.SetLayoutEngineVersion(layoutEngineVersion);
+                if (layoutEngine.Equals(LayoutEngineBrowserBuilder.APPLEWEBKIT))
+                {
+                    confidence += 10;
+                }
+            }
+
+            if (safariVersionRegex.IsMatch(userAgent.completeUserAgent))
+            {
+                Match safariMatcher = safariVersionRegex.Match(userAgent.completeUserAgent);
+                GroupCollection groups = safariMatcher.Groups;
+
+                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
+                {
+                    identified.SetReferenceBrowser("Safari");
+                    identified.SetReferenceBrowserVersion(groups[1].Value);
+                    confidence += 10;
+                }
+            }
+
+            identified.SetDisplayWidth(hintedWidth);
+            identified.SetDisplayHeight(hintedHeight);
+            identified.confidence = confidence;
+
+            return identified;
+        }
+
+        public override bool CanBuild(UserAgent userAgent)
+        {
+            return userAgent.completeUserAgent.Contains("BlackBerry");
+        }
+    }
+}

Added: incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/ChromeBrowserBuilder.cs
URL: http://svn.apache.org/viewvc/incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/ChromeBrowserBuilder.cs?rev=1392912&view=auto
==============================================================================
--- incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/ChromeBrowserBuilder.cs (added)
+++ incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/ChromeBrowserBuilder.cs Tue Oct  2 13:34:31 2012
@@ -0,0 +1,132 @@
+/**
+ * Copyright 2011 OpenDDR LLC
+ * This software is distributed under the terms of the GNU Lesser General Public License.
+ *
+ *
+ * This file is part of OpenDDR Simple APIs.
+ * OpenDDR Simple APIs is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3 of the License.
+ *
+ * OpenDDR Simple APIs is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Simple APIs.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Oddr.Models.Browsers;
+using Oddr.Models;
+using System.Text.RegularExpressions;
+
+namespace Oddr.Builders.Browsers
+{
+    public class ChromeBrowserBuilder : LayoutEngineBrowserBuilder
+    {
+        private const String CHROME_VERSION_REGEXP = ".*Chrome.([0-9a-z\\.b]+).*";
+        private const String SAFARI_REGEXP = ".*Safari/([0-9\\.]+).*?";
+        private static Regex chromeVersionRegex = new Regex(CHROME_VERSION_REGEXP, RegexOptions.Compiled);
+        private static Regex safariRegex = new Regex(SAFARI_REGEXP, RegexOptions.Compiled);
+
+        protected override Browser BuildBrowser(UserAgent userAgent, string layoutEngine, string layoutEngineVersion, int hintedWidth, int hintedHeight)
+        {
+            if (!(userAgent.mozillaPattern))
+            {
+                return null;
+            }
+
+            int confidence = 60;
+            Browser identified = new Browser();
+
+            identified.SetVendor("Google");
+            identified.SetModel("Chrome");
+            identified.SetVersion("-");
+            identified.majorRevision = "-";
+
+            if (chromeVersionRegex.IsMatch(userAgent.completeUserAgent))
+            {
+                Match chromeMatcher = chromeVersionRegex.Match(userAgent.completeUserAgent);
+                GroupCollection groups = chromeMatcher.Groups;
+                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
+                {
+                    string versionFullString = groups[1].Value;
+                    identified.SetVersion(versionFullString);
+                    String[] version = versionFullString.Split(".".ToCharArray());
+
+                    if (version.Length > 0)
+                    {
+                        identified.majorRevision = version[0];
+                        if (identified.majorRevision.Length == 0)
+                        {
+                            identified.majorRevision = "1";
+                        }
+                    }
+
+                    if (version.Length > 1)
+                    {
+                        identified.minorRevision = version[1];
+                        confidence += 10;
+                    }
+
+                    if (version.Length > 2)
+                    {
+                        identified.microRevision = version[2];
+                    }
+
+                    if (version.Length > 3)
+                    {
+                        identified.nanoRevision = version[3];
+                    }
+                }
+
+            }
+            else
+            {
+                //fallback version
+                identified.SetVersion("1.0");
+                identified.majorRevision = "1";
+            }
+
+            if (layoutEngine != null)
+            {
+                identified.SetLayoutEngine(layoutEngine);
+                identified.SetLayoutEngineVersion(layoutEngineVersion);
+                if (layoutEngine.Equals(LayoutEngineBrowserBuilder.KHML))
+                {
+                    confidence += 10;
+                }
+            }
+
+            if (safariRegex.IsMatch(userAgent.completeUserAgent))
+            {
+                Match safariMatcher = safariRegex.Match(userAgent.completeUserAgent);
+                GroupCollection groups = safariMatcher.Groups;
+                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
+                {
+                    identified.SetReferenceBrowser("Safari");
+                    identified.SetReferenceBrowserVersion(groups[1].Value);
+                    confidence += 10;
+                }
+            }
+
+            identified.SetDisplayWidth(hintedWidth);
+            identified.SetDisplayHeight(hintedHeight);
+            identified.confidence = confidence;
+
+            return identified;
+        }
+
+        public override bool CanBuild(UserAgent userAgent)
+        {
+            return userAgent.completeUserAgent.Contains("Chrome");
+        }
+    }
+}

Added: incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/ChromeMobileBrowserBuilder.cs
URL: http://svn.apache.org/viewvc/incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/ChromeMobileBrowserBuilder.cs?rev=1392912&view=auto
==============================================================================
--- incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/ChromeMobileBrowserBuilder.cs (added)
+++ incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/ChromeMobileBrowserBuilder.cs Tue Oct  2 13:34:31 2012
@@ -0,0 +1,153 @@
+/**
+ * Copyright 2011 OpenDDR LLC
+ * This software is distributed under the terms of the GNU Lesser General Public License.
+ *
+ *
+ * This file is part of OpenDDR Simple APIs.
+ * OpenDDR Simple APIs is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3 of the License.
+ *
+ * OpenDDR Simple APIs is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Simple APIs.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using Oddr.Models;
+using Oddr.Models.Browsers;
+
+namespace Oddr.Builders.Browsers
+{
+    class ChromeMobileBrowserBuilder : LayoutEngineBrowserBuilder
+    {
+        private const String VERSION_REGEXP = "(?:.*Chrome/([0-9\\.]+).*?)|(?:.*CriOS/([0-9\\.]+).*?)";
+        private const String SAFARI_REGEXP = ".*Safari/([0-9\\.]+).*?";
+        private static Regex versionRegex = new Regex(VERSION_REGEXP, RegexOptions.Compiled);
+        private static Regex safariRegex = new Regex(SAFARI_REGEXP, RegexOptions.Compiled);
+
+        protected override Browser BuildBrowser(UserAgent userAgent, string layoutEngine, string layoutEngineVersion, int hintedWidth, int hintedHeight)
+        {
+            if (!userAgent.mozillaPattern || !userAgent.completeUserAgent.Contains("Mobile"))
+            {
+                return null;
+            }
+
+            int confidence = 70;
+            Browser identified = new Browser();
+
+            identified.SetVendor("Google");
+            identified.SetModel("Chrome");
+
+            if (versionRegex.IsMatch(userAgent.completeUserAgent))
+            {
+                Match versionMatcher = versionRegex.Match(userAgent.completeUserAgent);
+                GroupCollection groups = versionMatcher.Groups;
+                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
+                {
+                    identified.SetVersion(groups[1].Value);
+                    string versionFullString = groups[1].Value;
+                    String[] version = versionFullString.Split(".".ToCharArray());
+
+                    if (version.Length > 0)
+                    {
+                        identified.majorRevision = version[0];
+                    }
+
+                    if (version.Length > 1)
+                    {
+                        identified.minorRevision = version[1];
+                        confidence += 10;
+                    }
+
+                    if (version.Length > 2)
+                    {
+                        identified.microRevision = version[2];
+                    }
+
+                    if (version.Length > 3)
+                    {
+                        identified.nanoRevision = version[3];
+                    }
+                }
+                else if (groups[2] != null && groups[2].Value.Trim().Length > 0)
+                {
+                    identified.SetVersion(groups[2].Value);
+                    string versionFullString = groups[2].Value;
+                    String[] version = versionFullString.Split(".".ToCharArray());
+
+                    if (version.Length > 0)
+                    {
+                        identified.majorRevision = version[0];
+                    }
+
+                    if (version.Length > 1)
+                    {
+                        identified.minorRevision = version[1];
+                        confidence += 10;
+                    }
+
+                    if (version.Length > 2)
+                    {
+                        identified.microRevision = version[2];
+                    }
+
+                    if (version.Length > 3)
+                    {
+                        identified.nanoRevision = version[3];
+                    }
+                }
+            }
+            else
+            {
+                //fallback version
+                identified.SetVersion("18.0");
+                identified.majorRevision = "18";
+            }
+
+            if (layoutEngine != null)
+            {
+                identified.SetLayoutEngine(layoutEngine);
+                identified.SetLayoutEngineVersion(layoutEngineVersion);
+
+                if (layoutEngine.Equals(LayoutEngineBrowserBuilder.APPLEWEBKIT))
+                {
+                    confidence += 10;
+                }
+            }
+
+            if (safariRegex.IsMatch(userAgent.completeUserAgent))
+            {
+                Match safariMatch = safariRegex.Match(userAgent.completeUserAgent);
+                GroupCollection groups = safariMatch.Groups;
+                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
+                {
+                    identified.SetReferenceBrowser("Safari");
+                    identified.SetReferenceBrowserVersion(groups[1].Value);
+                    confidence += 10;
+                }
+            }
+
+            identified.SetDisplayWidth(hintedWidth);
+            identified.SetDisplayHeight(hintedHeight);
+            identified.confidence = confidence;
+
+            return identified;
+        }
+
+        public override bool CanBuild(UserAgent userAgent)
+        {
+            return ((userAgent.containsAndroid || userAgent.containsIOSDevices) && (userAgent.completeUserAgent.Contains("Chrome") || userAgent.completeUserAgent.Contains("CriOS")));
+        }
+    }
+}

Added: incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/DefaultBrowserBuilder.cs
URL: http://svn.apache.org/viewvc/incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/DefaultBrowserBuilder.cs?rev=1392912&view=auto
==============================================================================
--- incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/DefaultBrowserBuilder.cs (added)
+++ incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/DefaultBrowserBuilder.cs Tue Oct  2 13:34:31 2012
@@ -0,0 +1,140 @@
+/**
+ * Copyright 2011 OpenDDR LLC
+ * This software is distributed under the terms of the GNU Lesser General Public License.
+ *
+ *
+ * This file is part of OpenDDR Simple APIs.
+ * OpenDDR Simple APIs is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3 of the License.
+ *
+ * OpenDDR Simple APIs is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Simple APIs.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Oddr.Models;
+using System.Runtime.CompilerServices;
+using Oddr.Models.Browsers;
+
+namespace Oddr.Builders.Browsers
+{
+    public class DefaultBrowserBuilder : IBuilder
+    {
+        private IBuilder[] builders;
+        private static volatile DefaultBrowserBuilder instance;
+        private static object syncRoot = new Object();
+
+        private DefaultBrowserBuilder()
+        {
+            builders = new IBuilder[]
+            {
+                new OperaMiniBrowserBuilder(),
+                new ChromeMobileBrowserBuilder(),
+                new FennecBrowserBuilder(),
+                new SafariMobileBrowserBuilder(),
+                new SilkBrowserBuilder(),
+                new AndroidMobileBrowserBuilder(),
+                new NetFrontBrowserBuilder(),
+                new UPBrowserBuilder(),
+                new OpenWaveBrowserBuilder(),
+                new SEMCBrowserBuilder(),
+                new DolfinBrowserBuilder(),
+                new JasmineBrowserBuilder(),
+                new PolarisBrowserBuilder(),
+                new ObigoBrowserBuilder(),
+                new OperaBrowserBuilder(),
+                new IEMobileBrowserBuilder(),
+                new NokiaBrowserBuilder(),
+                new BlackBerryBrowserBuilder(),
+                new WebOsBrowserBuilder(),
+                new InternetExplorerBrowserBuilder(),
+                new ChromeBrowserBuilder(),
+                new FirefoxBrowserBuilder(),
+                new SafariBrowserBuilder(),
+                new KonquerorBrowserBuilder(),
+            };
+        }
+
+        public static DefaultBrowserBuilder Instance
+        {
+            get
+            {
+                if (instance == null)
+                {
+                    lock (syncRoot)
+                    {
+                        if (instance == null)
+                        {
+                            instance = new DefaultBrowserBuilder();
+                        }
+                    }
+                }
+
+                return instance;
+            }
+        }
+
+        public bool CanBuild(UserAgent userAgent)
+        {
+            foreach (IBuilder browserBuilder in builders)
+            {
+                if (browserBuilder.CanBuild(userAgent))
+                {
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public BuiltObject Build(UserAgent userAgent, int confidenceTreshold)
+        {
+            List<Browser> founds = new List<Browser>();
+            Browser found = null;
+            foreach (IBuilder builder in builders)
+            {
+                if (builder.CanBuild(userAgent))
+                {
+                    Browser builded = (Browser)builder.Build(userAgent, confidenceTreshold);
+                    if (builded != null)
+                    {
+                        founds.Add(builded);
+                        if (builded.confidence >= confidenceTreshold)
+                        {
+                            found = builded;
+                            break;
+                        }
+                    }
+                }
+            }
+
+            if (found != null)
+            {
+                return found;
+
+            }
+            else
+            {
+                if (founds.Count == 0)
+                {
+                    return null;
+                }
+
+                founds.Sort();
+                founds.Reverse();
+
+                return founds[0];
+            }
+        }
+    }
+}

Added: incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/DolfinBrowserBuilder.cs
URL: http://svn.apache.org/viewvc/incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/DolfinBrowserBuilder.cs?rev=1392912&view=auto
==============================================================================
--- incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/DolfinBrowserBuilder.cs (added)
+++ incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/DolfinBrowserBuilder.cs Tue Oct  2 13:34:31 2012
@@ -0,0 +1,105 @@
+/**
+ * Copyright 2011 OpenDDR LLC
+ * This software is distributed under the terms of the GNU Lesser General Public License.
+ *
+ *
+ * This file is part of OpenDDR Simple APIs.
+ * OpenDDR Simple APIs is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3 of the License.
+ *
+ * OpenDDR Simple APIs is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Simple APIs.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Oddr.Models;
+using Oddr.Models.Browsers;
+using System.Text.RegularExpressions;
+
+namespace Oddr.Builders.Browsers
+{
+    public class DolfinBrowserBuilder : LayoutEngineBrowserBuilder
+    {
+        private const String VERSION_REGEXP = ".*?(?:(?:Dolfin/))([0-9\\.]+).*?";
+        private static Regex versionRegex = new Regex(VERSION_REGEXP, RegexOptions.Compiled);
+
+        protected override Browser BuildBrowser(UserAgent userAgent, string layoutEngine, string layoutEngineVersion, int hintedWidth, int hintedHeight)
+        {
+            String version = null;
+
+            if (!versionRegex.IsMatch(userAgent.completeUserAgent))
+            {
+                return null;
+
+            }
+            else
+            {
+                Match versionMatcher = versionRegex.Match(userAgent.completeUserAgent);
+                GroupCollection groups = versionMatcher.Groups;
+                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
+                {
+                    version = groups[1].Value;
+                }
+            }
+
+            int confidence = 60;
+            Browser identified = new Browser();
+
+            identified.SetVendor("Samsung");
+            identified.SetModel("Dolfin");
+
+            identified.SetVersion(version);
+            String[] versionEl = version.Split(".".ToCharArray());
+
+            if (versionEl.Length > 0)
+            {
+                identified.majorRevision = versionEl[0];
+            }
+
+            if (versionEl.Length > 1)
+            {
+                identified.minorRevision = versionEl[1];
+                confidence += 10;
+            }
+
+            if (versionEl.Length > 2)
+            {
+                identified.microRevision = versionEl[2];
+            }
+
+            if (versionEl.Length > 3)
+            {
+                identified.nanoRevision = versionEl[3];
+            }
+
+            identified.confidence = confidence;
+
+            if (layoutEngine != null)
+            {
+                identified.SetLayoutEngine(layoutEngine);
+                identified.SetLayoutEngineVersion(layoutEngineVersion);
+            }
+
+            identified.SetDisplayWidth(hintedWidth);
+            identified.SetDisplayHeight(hintedHeight);
+
+            return identified;
+        }
+
+        public override bool CanBuild(UserAgent userAgent)
+        {
+            return userAgent.completeUserAgent.Contains("Dolfin");
+        }
+    }
+}

Added: incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/FennecBrowserBuilder.cs
URL: http://svn.apache.org/viewvc/incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/FennecBrowserBuilder.cs?rev=1392912&view=auto
==============================================================================
--- incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/FennecBrowserBuilder.cs (added)
+++ incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/FennecBrowserBuilder.cs Tue Oct  2 13:34:31 2012
@@ -0,0 +1,171 @@
+/**
+ * Copyright 2011 OpenDDR LLC
+ * This software is distributed under the terms of the GNU Lesser General Public License.
+ *
+ *
+ * This file is part of OpenDDR Simple APIs.
+ * OpenDDR Simple APIs is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3 of the License.
+ *
+ * OpenDDR Simple APIs is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Simple APIs.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using Oddr.Models.Browsers;
+using Oddr.Models;
+
+namespace Oddr.Builders.Browsers
+{
+    public class FennecBrowserBuilder : LayoutEngineBrowserBuilder
+    {
+        private const String FENNEC_VERSION_REGEXP = ".*Fennec/([0-9a-z\\.\\-]+)";
+        private const String FIREFOX_VERSION_REGEXP = ".*Firefox.([0-9a-z\\.b]+).*";
+        private static Regex fennecVersionRegex = new Regex(FENNEC_VERSION_REGEXP, RegexOptions.Compiled);
+        private static Regex firefoxVersionRegex = new Regex(FIREFOX_VERSION_REGEXP, RegexOptions.Compiled);
+
+        protected override Browser BuildBrowser(UserAgent userAgent, string layoutEngine, string layoutEngineVersion, int hintedWidth, int hintedHeight)
+        {
+            if (!(userAgent.mozillaPattern))
+            {
+                return null;
+            }
+
+            int confidence = 60;
+            Browser identified = new Browser();
+
+            identified.SetVendor("Mozilla");
+            identified.SetModel("Firefox Mobile");
+            identified.SetVersion("-");
+            identified.majorRevision = "-";
+
+            if (fennecVersionRegex.IsMatch(userAgent.completeUserAgent))
+            {
+                Match fennecMatcher = fennecVersionRegex.Match(userAgent.completeUserAgent);
+                GroupCollection groups = fennecMatcher.Groups;
+                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
+                {
+                    identified.SetVersion(groups[1].Value);
+
+                    string versionFullString = groups[1].Value;
+                    String[] version = versionFullString.Split(".".ToCharArray());
+
+                    if (version.Length > 0)
+                    {
+                        identified.majorRevision = version[0];
+                        if (identified.majorRevision.Length == 0)
+                        {
+                            identified.majorRevision = "1";
+                        }
+                    }
+
+                    if (version.Length > 1)
+                    {
+                        identified.minorRevision = version[1];
+                        confidence += 10;
+                    }
+
+                    if (version.Length > 2)
+                    {
+                        identified.microRevision = version[2];
+                    }
+
+                    if (version.Length > 3)
+                    {
+                        identified.nanoRevision = version[3];
+                    }
+                }
+
+            }
+            else if (firefoxVersionRegex.IsMatch(userAgent.completeUserAgent))
+            {
+                Match firefoxMatcher = firefoxVersionRegex.Match(userAgent.completeUserAgent);
+                GroupCollection groups = firefoxMatcher.Groups;
+                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
+                {
+                    identified.SetVersion(groups[1].Value);
+
+                    string versionFullString = groups[1].Value;
+                    String[] version = versionFullString.Split(".".ToCharArray());
+
+                    if (version.Length > 0)
+                    {
+                        identified.majorRevision = version[0];
+                        if (identified.majorRevision.Length == 0)
+                        {
+                            identified.majorRevision = "1";
+                        }
+                    }
+
+                    if (version.Length > 1)
+                    {
+                        identified.minorRevision = version[1];
+                        confidence += 10;
+                    }
+
+                    if (version.Length > 2)
+                    {
+                        identified.microRevision = version[2];
+                    }
+
+                    if (version.Length > 3)
+                    {
+                        identified.nanoRevision = version[3];
+                    }
+                }
+            }
+            else
+            {
+                //fallback version
+                identified.SetVersion("1.0");
+                identified.majorRevision = "1";
+            }
+
+            if (layoutEngine != null)
+            {
+                identified.SetLayoutEngine(layoutEngine);
+                identified.SetLayoutEngineVersion(layoutEngineVersion);
+                if (layoutEngine.Equals(LayoutEngineBrowserBuilder.GECKO))
+                {
+                    confidence += 10;
+                }
+            }
+
+            if (firefoxVersionRegex.IsMatch(userAgent.completeUserAgent))
+            {
+                Match firefoxMatcher = firefoxVersionRegex.Match(userAgent.completeUserAgent);
+                GroupCollection groups = firefoxMatcher.Groups;
+
+                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
+                {
+                    identified.SetReferenceBrowser("Firefox");
+                    identified.SetReferenceBrowserVersion(groups[1].Value);
+                    confidence += 10;
+                }
+            }
+
+            identified.SetDisplayWidth(hintedWidth);
+            identified.SetDisplayHeight(hintedHeight);
+            identified.confidence = confidence;
+
+            return identified;
+        }
+
+        public override bool CanBuild(UserAgent userAgent)
+        {
+            return (userAgent.completeUserAgent.Contains("Fennec") || (userAgent.completeUserAgent.Contains("Firefox") && userAgent.completeUserAgent.Contains("Mobile")));
+        }
+    }
+}

Added: incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/FirefoxBrowserBuilder.cs
URL: http://svn.apache.org/viewvc/incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/FirefoxBrowserBuilder.cs?rev=1392912&view=auto
==============================================================================
--- incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/FirefoxBrowserBuilder.cs (added)
+++ incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/FirefoxBrowserBuilder.cs Tue Oct  2 13:34:31 2012
@@ -0,0 +1,125 @@
+/**
+ * Copyright 2011 OpenDDR LLC
+ * This software is distributed under the terms of the GNU Lesser General Public License.
+ *
+ *
+ * This file is part of OpenDDR Simple APIs.
+ * OpenDDR Simple APIs is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3 of the License.
+ *
+ * OpenDDR Simple APIs is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Simple APIs.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using Oddr.Models.Browsers;
+
+namespace Oddr.Builders.Browsers
+{
+    public class FirefoxBrowserBuilder : LayoutEngineBrowserBuilder
+    {
+        private const String FIREFOX_VERSION_REGEXP = ".*Firefox.([0-9a-z\\.b]+).*";
+        private static Regex firefoxVersionRegex = new Regex(FIREFOX_VERSION_REGEXP, RegexOptions.Compiled);
+
+        private const string GECKO_FIREFOX_REGEXP = ".*Gecko/([0-9]+).*Firefox.*";
+        private const string FENNEC_REGEXP = "Fennec";
+        private static Regex firefoxRegex = new Regex(GECKO_FIREFOX_REGEXP, RegexOptions.Compiled);
+        private static Regex fennecRegex = new Regex(FENNEC_REGEXP, RegexOptions.Compiled);
+
+        protected override Models.Browsers.Browser BuildBrowser(Models.UserAgent userAgent, string layoutEngine, string layoutEngineVersion, int hintedWidth, int hintedHeight)
+        {
+
+            if (!(userAgent.mozillaPattern) || !(firefoxRegex.IsMatch(userAgent.completeUserAgent)) || fennecRegex.IsMatch(userAgent.completeUserAgent))
+            {
+                return null;
+            }
+
+            int confidence = 60;
+            Browser identified = new Browser();
+
+            identified.SetVendor("Mozilla");
+            identified.SetModel("Firefox");
+            identified.SetVersion("-");
+            identified.majorRevision = "-";
+
+            if (firefoxVersionRegex.IsMatch(userAgent.completeUserAgent))
+            {
+                Match firefoxMatcher = firefoxVersionRegex.Match(userAgent.completeUserAgent);
+                GroupCollection groups = firefoxMatcher.Groups;
+
+                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
+                {
+                    identified.SetVersion(groups[1].Value);
+
+                    string versionFullString = groups[1].Value;
+                    String[] version = versionFullString.Split(".".ToCharArray());
+
+                    if (version.Length > 0)
+                    {
+                        identified.majorRevision = version[0];
+                        if (identified.majorRevision.Length == 0)
+                        {
+                            identified.majorRevision = "1";
+                        }
+                    }
+
+                    if (version.Length > 1)
+                    {
+                        identified.minorRevision = version[1];
+                        confidence += 10;
+                    }
+
+                    if (version.Length > 2)
+                    {
+                        identified.microRevision = version[2];
+                    }
+
+                    if (version.Length > 3)
+                    {
+                        identified.nanoRevision = version[3];
+                    }
+                }
+
+            }
+            else
+            {
+                //fallback version
+                identified.SetVersion("1.0");
+                identified.majorRevision = "1";
+            }
+
+            if (layoutEngine != null)
+            {
+                identified.SetLayoutEngine(layoutEngine);
+                identified.SetLayoutEngineVersion(layoutEngineVersion);
+                if (layoutEngine.Equals(LayoutEngineBrowserBuilder.GECKO))
+                {
+                    confidence += 10;
+                }
+            }
+
+            identified.SetDisplayWidth(hintedWidth);
+            identified.SetDisplayHeight(hintedHeight);
+            identified.confidence = confidence;
+
+            return identified;
+        }
+
+        public override bool CanBuild(Models.UserAgent userAgent)
+        {
+            return userAgent.completeUserAgent.Contains("Firefox");
+        }
+    }
+}

Added: incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/HintedResolutionBrowserBuilder.cs
URL: http://svn.apache.org/viewvc/incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/HintedResolutionBrowserBuilder.cs?rev=1392912&view=auto
==============================================================================
--- incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/HintedResolutionBrowserBuilder.cs (added)
+++ incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/HintedResolutionBrowserBuilder.cs Tue Oct  2 13:34:31 2012
@@ -0,0 +1,89 @@
+/**
+ * Copyright 2011 OpenDDR LLC
+ * This software is distributed under the terms of the GNU Lesser General Public License.
+ *
+ *
+ * This file is part of OpenDDR Simple APIs.
+ * OpenDDR Simple APIs is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3 of the License.
+ *
+ * OpenDDR Simple APIs is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Simple APIs.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using Oddr.Models;
+using Oddr.Models.Browsers;
+
+namespace Oddr.Builders.Browsers
+{
+    public abstract class HintedResolutionBrowserBuilder : IBuilder
+    {
+        private const String RESOLUTION_HINT_WXH_REGEXP = ".*([0-9][0-9][0-9]+)[*Xx]([0-9][0-9][0-9]+).*";
+        private const String RESOLUTION_HINT_FWVGA_REGEXP = ".*FWVGA.*";
+        private const String RESOLUTION_HINT_WVGA_REGEXP = ".*WVGA.*";
+        private const String RESOLUTION_HINT_WXGA_REGEXP = ".*WXGA.*";
+        private const String RESOLUTION_HINT_WQVGA_REGEXP = ".*WQVGA.*";
+        private static Regex resolutionHintWxHRegex = new Regex(RESOLUTION_HINT_WXH_REGEXP, RegexOptions.Compiled);
+        private static Regex resolutionHintFWVGARegex = new Regex(RESOLUTION_HINT_FWVGA_REGEXP, RegexOptions.Compiled);
+        private static Regex resolutionHintWVGARegex = new Regex(RESOLUTION_HINT_WVGA_REGEXP, RegexOptions.Compiled);
+        private static Regex resolutionHintWXGARegex = new Regex(RESOLUTION_HINT_WXGA_REGEXP, RegexOptions.Compiled);
+        private static Regex resolutionHintWQVGARegex = new Regex(RESOLUTION_HINT_WQVGA_REGEXP, RegexOptions.Compiled);
+
+
+        public BuiltObject Build(UserAgent userAgent, int confidenceTreshold)
+        {
+            int hintedWidth = -1;
+            int hintedHeight = -1;
+
+            if (resolutionHintWxHRegex.IsMatch(userAgent.completeUserAgent))
+            {
+                Match match = resolutionHintWxHRegex.Match(userAgent.completeUserAgent);
+                GroupCollection groups = match.Groups;
+                int.TryParse(groups[0].Value, out hintedWidth);
+                int.TryParse(groups[1].Value, out hintedHeight);
+            }
+            else if (userAgent.completeUserAgent.Contains("VGA") || userAgent.completeUserAgent.Contains("WXGA"))
+            {
+                if (resolutionHintFWVGARegex.IsMatch(userAgent.completeUserAgent))
+                {
+                    hintedWidth = 480;
+                    hintedHeight = 854;
+                }
+                else if (resolutionHintWVGARegex.IsMatch(userAgent.completeUserAgent))
+                {
+                    hintedWidth = 480;
+                    hintedHeight = 800;
+                }
+                else if (resolutionHintWXGARegex.IsMatch(userAgent.completeUserAgent))
+                {
+                    hintedWidth = 768;
+                    hintedHeight = 1280;
+                }
+                else if (resolutionHintWQVGARegex.IsMatch(userAgent.completeUserAgent))
+                {
+                    hintedWidth = 240;
+                    hintedHeight = 400;
+                }
+            }
+
+            return BuildBrowser(userAgent, hintedWidth, hintedHeight);
+        }
+
+        protected abstract Browser BuildBrowser(UserAgent userAgent, int hintedWidth, int hintedHeight);
+
+        public abstract bool CanBuild(UserAgent userAgent);
+    }
+}

Added: incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/IEMobileBrowserBuilder.cs
URL: http://svn.apache.org/viewvc/incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/IEMobileBrowserBuilder.cs?rev=1392912&view=auto
==============================================================================
--- incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/IEMobileBrowserBuilder.cs (added)
+++ incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/IEMobileBrowserBuilder.cs Tue Oct  2 13:34:31 2012
@@ -0,0 +1,161 @@
+/**
+ * Copyright 2011 OpenDDR LLC
+ * This software is distributed under the terms of the GNU Lesser General Public License.
+ *
+ *
+ * This file is part of OpenDDR Simple APIs.
+ * OpenDDR Simple APIs is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3 of the License.
+ *
+ * OpenDDR Simple APIs is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Simple APIs.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using Oddr.Models;
+using Oddr.Models.Browsers;
+
+namespace Oddr.Builders.Browsers
+{
+    class IEMobileBrowserBuilder : LayoutEngineBrowserBuilder
+    {
+        private const string VERSION_REGEXP = ".*[^MS]IEMobile.([0-9\\.]+).*?";
+        private const string MSIE_VERSION_REGEXP = ".*MSIE.([0-9\\.]+).*";
+        private const string MSIEMOBILE_VERSION_REGEXP = ".*MSIEMobile.([0-9\\.]+).*";
+        private static Regex versionRegex = new Regex(VERSION_REGEXP, RegexOptions.Compiled);
+        private static Regex msieVersionRegex = new Regex(MSIE_VERSION_REGEXP, RegexOptions.Compiled);
+        private static Regex msieMobileVersionRegex = new Regex(MSIEMOBILE_VERSION_REGEXP, RegexOptions.Compiled);
+
+        private const string WINDOWS_CE_PHONE_REGEXP = ".*Windows.?(?:(?:CE)|(?:Phone)).*";
+        private static Regex windowsCePhoneRegex = new Regex(WINDOWS_CE_PHONE_REGEXP, RegexOptions.Compiled);
+
+        protected override Browser BuildBrowser(UserAgent userAgent, string layoutEngine, string layoutEngineVersion, int hintedWidth, int hintedHeight)
+        {
+            if (!userAgent.containsWindowsPhone || !(windowsCePhoneRegex.IsMatch(userAgent.completeUserAgent)))
+            {
+                return null;
+            }
+
+            int confidence = 40;
+            Browser identified = new Browser();
+
+            identified.SetVendor("Microsoft");
+            identified.SetModel("IEMobile");
+
+            if (userAgent.completeUserAgent.Contains("MSIEMobile"))
+            {
+                confidence += 10;
+            }
+
+            if (userAgent.mozillaPattern)
+            {
+                confidence += 10;
+            }
+
+            if (versionRegex.IsMatch(userAgent.completeUserAgent))
+            {
+                Match versionMatcher = versionRegex.Match(userAgent.completeUserAgent);
+                GroupCollection groups = versionMatcher.Groups;
+
+                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
+                {
+                    identified.SetVersion(groups[1].Value);
+
+                    string versionFullString = groups[1].Value;
+                    String[] version = versionFullString.Split(".".ToCharArray());
+
+                    if (version.Length > 0)
+                    {
+                        identified.majorRevision = version[0];
+                        if (identified.majorRevision.Length == 0)
+                        {
+                            identified.majorRevision = "1";
+                        }
+                    }
+
+                    if (version.Length > 1)
+                    {
+                        identified.minorRevision = version[1];
+                        confidence += 10;
+                    }
+
+                    if (version.Length > 2)
+                    {
+                        identified.microRevision = version[2];
+                    }
+
+                    if (version.Length > 3)
+                    {
+                        identified.nanoRevision = version[3];
+                    }
+                }
+
+            }
+            else
+            {
+                //fallback version
+                identified.SetVersion("1.0");
+                identified.majorRevision = "1";
+            }
+
+            if (msieVersionRegex.IsMatch(userAgent.completeUserAgent))
+            {
+                Match msieMatcher = msieVersionRegex.Match(userAgent.completeUserAgent);
+                GroupCollection groups = msieMatcher.Groups;
+
+                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
+                {
+                    identified.SetReferenceBrowser("MSIE");
+                    identified.SetReferenceBrowserVersion(groups[1].Value);
+                    confidence += 10;
+                }
+            }
+
+            if (msieMobileVersionRegex.IsMatch(userAgent.completeUserAgent))
+            {
+                Match msieMobileMatcher = msieMobileVersionRegex.Match(userAgent.completeUserAgent);
+                GroupCollection groups = msieMobileMatcher.Groups;
+
+                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
+                {
+                    identified.SetLayoutEngine("MSIEMobile");
+                    identified.SetLayoutEngineVersion(groups[1].Value);
+                    confidence += 10;
+                }
+            }
+
+            if (layoutEngine != null)
+            {
+                identified.SetLayoutEngine(layoutEngine);
+                identified.SetLayoutEngineVersion(layoutEngineVersion);
+                if (layoutEngine.Equals(LayoutEngineBrowserBuilder.TRIDENT))
+                {
+                    confidence += 10;
+                }
+            }
+
+            identified.SetDisplayWidth(hintedWidth);
+            identified.SetDisplayHeight(hintedHeight);
+            identified.confidence = confidence;
+
+            return identified;
+        }
+
+        public override bool CanBuild(UserAgent userAgent)
+        {
+            return userAgent.containsWindowsPhone;
+        }
+    }
+}

Added: incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/InternetExplorerBrowserBuilder.cs
URL: http://svn.apache.org/viewvc/incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/InternetExplorerBrowserBuilder.cs?rev=1392912&view=auto
==============================================================================
--- incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/InternetExplorerBrowserBuilder.cs (added)
+++ incubator/devicemap/trunk/openddr/csharp/OpenDDR-CSharp/Builders/Browsers/InternetExplorerBrowserBuilder.cs Tue Oct  2 13:34:31 2012
@@ -0,0 +1,118 @@
+/**
+ * Copyright 2011 OpenDDR LLC
+ * This software is distributed under the terms of the GNU Lesser General Public License.
+ *
+ *
+ * This file is part of OpenDDR Simple APIs.
+ * OpenDDR Simple APIs is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, version 3 of the License.
+ *
+ * OpenDDR Simple APIs is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Simple APIs.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using Oddr.Models.Browsers;
+using Oddr.Models;
+
+namespace Oddr.Builders.Browsers
+{
+    public class InternetExplorerBrowserBuilder : LayoutEngineBrowserBuilder
+    {
+        private const String MSIE_VERSION_REGEXP = ".*MSIE.([0-9\\.b]+).*";
+        private const String DOT_NET_CLR_REGEXP = ".*\\.NET.CLR.*";
+        private static Regex msieVersionRegex = new Regex(MSIE_VERSION_REGEXP, RegexOptions.Compiled);
+        private static Regex dotNetClrRegex = new Regex(DOT_NET_CLR_REGEXP, RegexOptions.Compiled);
+
+        private const string WINDOWS_CE_PHONE = ".*Windows.?(?:(?:CE)|(?:Phone)).*";
+        private static Regex windowsCePhoneRegex = new Regex(WINDOWS_CE_PHONE, RegexOptions.Compiled);
+
+        protected override Browser BuildBrowser(UserAgent userAgent, string layoutEngine, string layoutEngineVersion, int hintedWidth, int hintedHeight)
+        {
+            if (!userAgent.containsMSIE || !userAgent.mozillaPattern || windowsCePhoneRegex.IsMatch(userAgent.completeUserAgent))
+            {
+                return null;
+            }
+
+            int confidence = 60;
+            Browser identified = new Browser();
+
+            identified.SetVendor("Microsoft");
+            identified.SetModel("Internet Explorer");
+
+            if (msieVersionRegex.IsMatch(userAgent.completeUserAgent))
+            {
+                Match msieMatcher = msieVersionRegex.Match(userAgent.completeUserAgent);
+                GroupCollection groups = msieMatcher.Groups;
+
+                if (groups[1] != null && groups[1].Value.Trim().Length > 0)
+                {
+                    identified.SetVersion(groups[1].Value);
+
+                    string versionFullString = groups[1].Value;
+                    String[] version = versionFullString.Split(".".ToCharArray());
+
+                    if (version.Length > 0)
+                    {
+                        identified.majorRevision = version[0];
+                        if (identified.majorRevision.Length == 0)
+                        {
+                            identified.majorRevision = "1";
+                        }
+                    }
+
+                    if (version.Length > 1)
+                    {
+                        identified.minorRevision = version[1];
+                        confidence += 10;
+                    }
+                }
+
+            }
+            else
+            {
+                //fallback version
+                identified.SetVersion("1.0");
+                identified.majorRevision = "1";
+            }
+
+            if (layoutEngine != null)
+            {
+                identified.SetLayoutEngine(layoutEngine);
+                identified.SetLayoutEngineVersion(layoutEngineVersion);
+                if (layoutEngine.Equals(LayoutEngineBrowserBuilder.TRIDENT))
+                {
+                    confidence += 10;
+                }
+            }
+
+            if (dotNetClrRegex.IsMatch(userAgent.completeUserAgent))
+            {
+                confidence += 10;
+            }
+
+            identified.SetDisplayWidth(hintedWidth);
+            identified.SetDisplayHeight(hintedHeight);
+            identified.confidence = confidence;
+
+            return identified;
+        }
+
+        public override bool CanBuild(UserAgent userAgent)
+        {
+            return userAgent.containsMSIE;
+        }
+    }
+}