Fix Properties of SearchPreference didn't work 81/135681/2
authorchanywa <cbible.kim@samsung.com>
Mon, 26 Jun 2017 00:49:52 +0000 (09:49 +0900)
committerchanywa <cbible.kim@samsung.com>
Mon, 26 Jun 2017 00:56:57 +0000 (09:56 +0900)
Change-Id: I172590eff8b2f8397d656fbb432f3b13d5d3af17

Tizen.Maps/Tizen.Maps/SearchPreference.cs

index 731358f..ca57349 100755 (executable)
@@ -25,7 +25,7 @@ namespace Tizen.Maps
     public class SearchPreference : IGeocodePreference, IPlaceSearchPreference, IRouteSearchPreference, IDisposable
     {
         internal Interop.PreferenceHandle handle;
-        private IReadOnlyDictionary<string, string> _properties = new Dictionary<string, string>();
+        private IDictionary<string, string> _properties = new Dictionary<string, string>();
 
         /// <summary>
         /// Constructors a new search preference.
@@ -117,12 +117,21 @@ namespace Tizen.Maps
         {
             get
             {
-                return _properties;
+                Action<string, string> action = (key, value) =>
+                {
+                    _properties[key] = value;
+                };
+
+                handle.ForeachProperty(action);
+                return (IReadOnlyDictionary<string, string>)_properties;
             }
             set
             {
-                Log.Info(string.Format("Properties is changed from {0} to {1}", Properties.ToString(), value.ToString()));
-                _properties = value;
+                foreach (var prop in value)
+                {
+                    handle.SetProperty(prop.Key, prop.Value);
+                    Log.Info(string.Format("Properties is changed to [{0}, {1}]", prop.Key, prop.Value));
+                }
             }
         }