Exemplo n.º 1
0
 /// <summary>
 /// Adds a surrogate for the type specified in the XmlSerializationForAttribute.
 /// </summary>
 /// <param name="attr">The attribute used to describe the type this surrogate is intended for.</param>
 /// <param name="surrogate">The surrogate used to serialize/deserialize the type.</param>
 public void AddSurrogate(XmlSerializationSurrogateForAttribute attr, IXmlSerializationSurrogate surrogate)
 {
     if (null != attr.SerializationType)
     {
         AddSurrogate(attr.SerializationType, attr.Version, surrogate);
     }
     else
     {
         AddSurrogate(attr.AssemblyName, attr.TypeName, attr.Version, surrogate);
     }
 }
Exemplo n.º 2
0
		/// <summary>
		/// Adds a surrogate for the type specified in the XmlSerializationForAttribute.
		/// </summary>
		/// <param name="attr">The attribute used to describe the type this surrogate is intended for.</param>
		/// <param name="surrogate">The surrogate used to serialize/deserialize the type.</param>
		public void AddSurrogate(XmlSerializationSurrogateForAttribute attr, IXmlSerializationSurrogate surrogate)
		{
			if (null != attr.SerializationType)
				AddSurrogate(attr.SerializationType, attr.Version, surrogate);
			else
				AddSurrogate(attr.AssemblyName, attr.TypeName, attr.Version, surrogate);
		}