Exemple #1
0
        public override IDictionary <string, object> Serialize(object obj, JavaScriptSerializer serializer)
        {
            Dictionary <string, object> dictionary           = new Dictionary <string, object>();
            ClientSchemaPropertyValue   clientSchemaProperty = (ClientSchemaPropertyValue)obj;

            dictionary.Add("PropertyFormID", clientSchemaProperty.PropertyFormID);
            dictionary.Add("Properties", clientSchemaProperty.Properties);

            return(dictionary);
        }
		public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
		{
			ClientSchemaPropertyValue clientSchemaProperty = new ClientSchemaPropertyValue();
			clientSchemaProperty.PropertyFormID = DictionaryHelper.GetValue(dictionary, "PropertyFormID", string.Empty);

			if (dictionary.ContainsKey("Properties") == true)
			{
				PropertyValueCollection propCollection = JSONSerializerExecute.Deserialize<PropertyValueCollection>(dictionary["Properties"]);
				clientSchemaProperty.Properties = new PropertyValueCollection();
				clientSchemaProperty.Properties.CopyFrom(propCollection);
			}

			return clientSchemaProperty;
		}
Exemple #3
0
        public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            ClientSchemaPropertyValue clientSchemaProperty = new ClientSchemaPropertyValue();

            clientSchemaProperty.PropertyFormID = DictionaryHelper.GetValue(dictionary, "PropertyFormID", string.Empty);

            if (dictionary.ContainsKey("Properties") == true)
            {
                PropertyValueCollection propCollection = JSONSerializerExecute.Deserialize <PropertyValueCollection>(dictionary["Properties"]);
                clientSchemaProperty.Properties = new PropertyValueCollection();
                clientSchemaProperty.Properties.CopyFrom(propCollection);
            }

            return(clientSchemaProperty);
        }