public PropertySerializationInfo(PropertyInfo property) { Property = property; IsText = TypeHelper.IsXmlText(property); IsAttribute = TypeHelper.IsXmlAttribute(property) && !IsText; Invoker = EmitInvoker.Initialize(property, true); Default = TypeHelper.GetDefault(property); if (IsAttribute || IsText) { Serialazer = TypeHelper.GetValueSerializer(property); } Name = property.Name; }
public PropertySerializationInfo(PropertyInfo property, int order = -1) { Property = property; Name = property.Name; DataType = Property.PropertyType; var keys = PropertySerializationInfoKeys.None; if (TypeHelper.IsSerializeText(property)) { keys |= PropertySerializationInfoKeys.Text; } else if (TypeHelper.IsSerializeAttribute(property)) { keys |= PropertySerializationInfoKeys.Attribute; } if (TypeHelper.IsSerializeWriteable(property)) { keys |= PropertySerializationInfoKeys.Writeable; } if (TypeHelper.IsRequired(property)) { keys |= PropertySerializationInfoKeys.Required; } if (TypeHelper.IsJsonSynchronized(property)) { keys |= PropertySerializationInfoKeys.ChangeSensitive; } if (TypeHelper.IsReadOnly(property)) { keys |= PropertySerializationInfoKeys.ReadOnly; } Keys = keys; Order = TypeHelper.GetOrder(property, order); Invoker = EmitInvoker.Initialize(property, true); Default = TypeHelper.GetDefault(property); if (IsAttribute || IsText) { Serialazer = TypeHelper.GetValueSerializer(property); } }