/// <summary>
        /// Converts object value from public to internal format.
        /// </summary>
        /// <param name="value">an object in public format to convert</param>
        /// <returns>converted object in internal format</returns>
        protected virtual AnyValueMap ConvertFromPublic(T value)
        {
            var json = JsonConverter.ToJson(value);
            var map  = new AnyValueMap(MapConverter.ToMap(JsonConverter.FromJson(json)));

            return(map);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Creates a new instance of the map and assigns its value.
 /// </summary>
 /// <param name="value">(optional) values to initialize this map.</param>
 public StringValueMap(object value)
     : base(StringComparer.OrdinalIgnoreCase)
 {
     Append(MapConverter.ToMap(value));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Sets a new value for this array element
 /// </summary>
 /// <param name="value">the new object value.</param>
 public void SetAsObject(object value)
 {
     Clear();
     Append(MapConverter.ToMap(value));
 }
 public void SetAsObject(object value)
 {
     Clear();
     Append((IDictionary)MapConverter.ToMap(value));
 }