chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1183321 - /chemistry/dotcmis/trunk/DotCMIS/binding/converter.cs
Date Fri, 14 Oct 2011 12:08:57 GMT
Author: fmui
Date: Fri Oct 14 12:08:56 2011
New Revision: 1183321

URL: http://svn.apache.org/viewvc?rev=1183321&view=rev
Log:
fixed choices deserialization 

Modified:
    chemistry/dotcmis/trunk/DotCMIS/binding/converter.cs

Modified: chemistry/dotcmis/trunk/DotCMIS/binding/converter.cs
URL: http://svn.apache.org/viewvc/chemistry/dotcmis/trunk/DotCMIS/binding/converter.cs?rev=1183321&r1=1183320&r2=1183321&view=diff
==============================================================================
--- chemistry/dotcmis/trunk/DotCMIS/binding/converter.cs (original)
+++ chemistry/dotcmis/trunk/DotCMIS/binding/converter.cs Fri Oct 14 12:08:56 2011
@@ -79,6 +79,15 @@ namespace DotCMIS.Binding
         }
 
         /// <summary>
+        /// Deserializes a decimal.
+        /// </summary>
+        private static decimal? DeserializeDecimal(XmlElement element)
+        {
+            string s = DeserializeString(element);
+            return s == null ? (decimal?)null : Decimal.Parse(s);
+        }
+
+        /// <summary>
         /// Deserializes a boolean.
         /// </summary>
         private static Boolean DeserializeBoolean(XmlElement element)
@@ -487,11 +496,11 @@ namespace DotCMIS.Binding
                     }
                     else if (element.LocalName.Equals("maxValue"))
                     {
-                        pd.MaxValue = DeserializeInteger(element);
+                        pd.MaxValue = DeserializeDecimal(element);
                     }
                     else if (element.LocalName.Equals("minValue"))
                     {
-                        pd.MinValue = DeserializeInteger(element);
+                        pd.MinValue = DeserializeDecimal(element);
                     }
                     else if (element.LocalName.Equals("precision"))
                     {
@@ -626,6 +635,14 @@ namespace DotCMIS.Binding
                             pd.Choices.Add(ConvertChoice(choice));
                         }
                     }
+                    else if (element.LocalName.Equals("maxValue"))
+                    {
+                        pd.MaxValue = DeserializeInteger(element);
+                    }
+                    else if (element.LocalName.Equals("minValue"))
+                    {
+                        pd.MinValue = DeserializeInteger(element);
+                    }
                 });
 
                 result = pd;



Mime
View raw message