bool IJsmlSerializerHook.Deserialize(IJsmlDeserializationContext context)
		{
			var type = GetDataType(context);
			if (type != null)
				context.DataType = type;

			return false;
		}
 public bool Deserialize(IJsmlDeserializationContext context)
 {
     if (context.DataType == typeof(EntityRef))
     {
         context.Data = new EntityRef(context.XmlElement.InnerText);
         return(true);
     }
     return(false);
 }
		public bool Deserialize(IJsmlDeserializationContext context)
		{
			if (context.DataType == typeof(EntityRef))
			{
				context.Data = new EntityRef(context.XmlElement.InnerText);
				return true;
			}
			return false;
		}
        bool IJsmlSerializerHook.Deserialize(IJsmlDeserializationContext context)
        {
            var type = GetDataType(context);

            if (type != null)
            {
                context.DataType = type;
            }

            return(false);
        }
        bool IJsmlSerializerHook.Deserialize(IJsmlDeserializationContext context)
        {
            // if we have an XML attribute for the contract ID, change the data type to use the correct contract
            var contract = context.XmlElement.GetAttribute("contract");

            if (!string.IsNullOrEmpty(contract))
            {
                // constrain the data type by the contract id
                context.DataType = GetDataContract(contract);
            }

            // always return false - we don't handle serialization ourselves
            return(false);
        }
			bool IJsmlSerializerHook.Deserialize(IJsmlDeserializationContext context)
			{
				// if we have an XML attribute for the contract ID, change the data type to use the correct contract
				var contract = context.XmlElement.GetAttribute("contract");
				if (!string.IsNullOrEmpty(contract))
				{
					Type contractType;
					if (_contractMap.TryGetValue(contract, out contractType))
					{
						context.DataType = contractType;
						return false;
					}

					//Let the edit hook throw if the contract ID is invalid
				}

				return _editHook.Deserialize(context);
			}
            bool IJsmlSerializerHook.Deserialize(IJsmlDeserializationContext context)
            {
                // if we have an XML attribute for the contract ID, change the data type to use the correct contract
                var contract = context.XmlElement.GetAttribute("contract");

                if (!string.IsNullOrEmpty(contract))
                {
                    Type contractType;
                    if (_contractMap.TryGetValue(contract, out contractType))
                    {
                        context.DataType = contractType;
                        return(false);
                    }

                    //Let the edit hook throw if the contract ID is invalid
                }

                return(_editHook.Deserialize(context));
            }
		public Type GetDataType(IJsmlDeserializationContext context)
		{
			// if we have an XML attribute for the contract ID, change the data type to use the correct contract
			var contract = context.XmlElement.GetAttribute("contract");
			if (!string.IsNullOrEmpty(contract))
			{
				// constrain the data type by the contract id
				return GetDataContract(contract);
			}

			contract = context.XmlElement.GetAttribute("attributeType");
			if (!String.IsNullOrEmpty(contract))
			{
				var type = TypeHelper.GetKnownAttributeValueTypes().FirstOrDefault(t => t.Name == contract);
				if (type != null)
					return type;
			}

			return null;
		}
        public Type GetDataType(IJsmlDeserializationContext context)
        {
            // if we have an XML attribute for the contract ID, change the data type to use the correct contract
            var contract = context.XmlElement.GetAttribute("contract");

            if (!string.IsNullOrEmpty(contract))
            {
                // constrain the data type by the contract id
                return(GetDataContract(contract));
            }

            contract = context.XmlElement.GetAttribute("attributeType");
            if (!String.IsNullOrEmpty(contract))
            {
                var type = TypeHelper.GetKnownAttributeValueTypes().FirstOrDefault(t => t.Name == contract);
                if (type != null)
                {
                    return(type);
                }
            }

            return(null);
        }
Example #10
0
 public bool Deserialize(IJsmlDeserializationContext context)
 {
     return(false);
 }