//private RougeType type;
        public RougeDataWrapper(Object value)
        {
            if (value is IDictionary<object, object>)
            {
                this.value = new RougeObject((IDictionary<object, object>) value);
            }
            else if (value is IDictionary<string, object>)
            {
                this.value = new RougeObject((IDictionary<string, object>) value);
            }
            else if (value is List<object> || value is JArray)
            {
                this.value = new RougeArray((IList<object>)value);
            }
            else if (value is JObject)
            {
                RougeObject rougeObject = new RougeObject();

                foreach ( KeyValuePair<string, JToken> keyPair in ((JObject)value) )
                {
                    rougeObject.put(keyPair.Key, keyPair.Value);
                }

                this.value = rougeObject;
            }
            else if (value is JArray)
            {
                RougeArray rougeArray = new RougeArray();

                foreach (JToken jToken in ((JArray)value))
                {
                    rougeArray.add(value);
                }

                this.value = rougeArray;
            }
            else
            {
                this.value = value;
            }
        }
Exemple #2
0
 public void putRougeArray(string key, RougeArray value)
 {
     this.content.Add(key, new RougeDataWrapper(value));
 }
Exemple #3
0
 public void addRougeArray(RougeArray value)
 {
     this.content.Add(new RougeDataWrapper(value));
 }