public bool Serialize(IJsmlSerializationContext context)
 {
     if (context.Data is EntityRef)
     {
         context.XmlWriter.WriteElementString(context.Name, ((EntityRef)context.Data).Serialize());
         return(true);
     }
     return(false);
 }
		public bool Serialize(IJsmlSerializationContext context)
		{
			if (context.Data is EntityRef)
			{
				context.XmlWriter.WriteElementString(context.Name, ((EntityRef)context.Data).Serialize());
				return true;
			}
			return false;
		}
			bool IJsmlSerializerHook.Serialize(IJsmlSerializationContext context)
			{
				var data = context.Data;
				if (data != null)
				{
					// if we have an attribute, write out the contract ID as an XML attribute
					var a = AttributeUtils.GetAttribute<ImageServerExternalRequestTypeAttribute>(data.GetType());
					if (a != null)
					{
						context.Attributes.Add("contract", a.ContractId);
						return false;
					}
				}

				return _editHook.Serialize(context);
			}
        bool IJsmlSerializerHook.Serialize(IJsmlSerializationContext context)
        {
            var data = context.Data;

            if (data != null)
            {
                // if we have an attribute, write out the contract ID as an XML attribute
                var a = AttributeUtils.GetAttribute <T>(data.GetType());
                if (a != null)
                {
                    context.Attributes.Add("contract", a.ContractId);
                }
            }

            // always return false - we don't handle serialization ourselves
            return(false);
        }
            bool IJsmlSerializerHook.Serialize(IJsmlSerializationContext context)
            {
                var data = context.Data;

                if (data != null)
                {
                    // if we have an attribute, write out the contract ID as an XML attribute
                    var a = AttributeUtils.GetAttribute <ImageServerExternalRequestTypeAttribute>(data.GetType());
                    if (a != null)
                    {
                        context.Attributes.Add("contract", a.ContractId);
                        return(false);
                    }
                }

                return(_editHook.Serialize(context));
            }
        public bool SetDataType(IJsmlSerializationContext context)
        {
            var data = context.Data;

            if (data != null)
            {
                var dataType = data.GetType();
                // if we have an attribute, write out the contract ID as an XML attribute
                var b = AttributeUtils.GetAttribute <EditTypeAttribute>(dataType);
                if (b != null)
                {
                    context.Attributes.Add("contract", b.ContractId);
                    return(true);
                }

                if (TypeHelper.GetKnownAttributeValueTypes().Contains(dataType))
                {
                    context.Attributes.Add("attributeType", dataType.Name);
                    return(true);
                }
            }

            return(false);
        }
		public bool SetDataType(IJsmlSerializationContext context)
		{
			var data = context.Data;
			if (data != null)
			{
				var dataType = data.GetType();
				// if we have an attribute, write out the contract ID as an XML attribute
				var b = AttributeUtils.GetAttribute<EditTypeAttribute>(dataType);
				if (b != null)
				{
					context.Attributes.Add("contract", b.ContractId);
					return true;
				}
				
				if (TypeHelper.GetKnownAttributeValueTypes().Contains(dataType))
				{
					context.Attributes.Add("attributeType", dataType.Name);
					return true;
				}
			}

			return false;
		}
		bool IJsmlSerializerHook.Serialize(IJsmlSerializationContext context)
		{
			SetDataType(context);
			return false;
		}
Exemple #9
0
 public bool Serialize(IJsmlSerializationContext context)
 {
     return(false);
 }
 bool IJsmlSerializerHook.Serialize(IJsmlSerializationContext context)
 {
     SetDataType(context);
     return(false);
 }