Update of /cvsroot/netreflector/NetReflector/src/NetReflector/attributes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10450/src/NetReflector/attributes Modified Files: ReflectorArrayAttribute.cs ReflectorCollectionAttribute.cs ReflectorHashAttribute.cs ReflectorPropertyAttribute.cs Log Message: NETREF-5: adding support for customisable serialisation. attributes use DefaultSerialiserFactory by default -- however clients can override for more control over serialisation process. Index: ReflectorArrayAttribute.cs =================================================================== RCS file: /cvsroot/netreflector/NetReflector/src/NetReflector/attributes/ReflectorArrayAttribute.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ReflectorArrayAttribute.cs 15 Nov 2004 05:13:03 -0000 1.4 --- ReflectorArrayAttribute.cs 8 Sep 2005 01:07:47 -0000 1.5 *************** *** 1,4 **** using System; - using System.Reflection; namespace Exortech.NetReflector --- 1,3 ---- *************** *** 8,18 **** { public ReflectorArrayAttribute(string name) : base(name) ! { ! } ! ! public override IXmlSerialiser CreateSerialiser(MemberInfo member) ! { ! return new XmlArraySerialiser(member, this); ! } } ! } --- 7,11 ---- { public ReflectorArrayAttribute(string name) : base(name) ! {} } ! } \ No newline at end of file Index: ReflectorHashAttribute.cs =================================================================== RCS file: /cvsroot/netreflector/NetReflector/src/NetReflector/attributes/ReflectorHashAttribute.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ReflectorHashAttribute.cs 15 Nov 2004 05:13:03 -0000 1.5 --- ReflectorHashAttribute.cs 8 Sep 2005 01:07:47 -0000 1.6 *************** *** 1,4 **** using System; ! using System.Reflection; namespace Exortech.NetReflector --- 1,4 ---- using System; ! using Exortech.NetReflector.Util; namespace Exortech.NetReflector *************** *** 10,15 **** public ReflectorHashAttribute(string name) : base(name) ! { ! } public ReflectorHashAttribute(string name, string key) : this(name) --- 10,14 ---- public ReflectorHashAttribute(string name) : base(name) ! {} public ReflectorHashAttribute(string name, string key) : this(name) *************** *** 24,31 **** } ! public override IXmlSerialiser CreateSerialiser(MemberInfo member) { return new XmlDictionarySerialiser(member, this); } } ! } --- 23,30 ---- } ! public override IXmlSerialiser CreateSerialiser(ReflectorMember member) { return new XmlDictionarySerialiser(member, this); } } ! } \ No newline at end of file Index: ReflectorPropertyAttribute.cs =================================================================== RCS file: /cvsroot/netreflector/NetReflector/src/NetReflector/attributes/ReflectorPropertyAttribute.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ReflectorPropertyAttribute.cs 7 Apr 2005 04:30:40 -0000 1.6 --- ReflectorPropertyAttribute.cs 8 Sep 2005 01:07:47 -0000 1.7 *************** *** 1,4 **** --- 1,5 ---- using System; using System.Reflection; + using Exortech.NetReflector.Util; namespace Exortech.NetReflector *************** *** 12,15 **** --- 13,17 ---- private Type instanceType; private string instanceTypeKey; + private ISerialiserFactory factory = new DefaultSerialiserFactory(); public ReflectorPropertyAttribute(string name) *************** *** 48,54 **** } ! public virtual IXmlSerialiser CreateSerialiser(MemberInfo member) { ! return new XmlMemberSerialiser(member, this); } --- 50,56 ---- } ! public virtual IXmlSerialiser CreateSerialiser(ReflectorMember member) { ! return factory.Create(member, this); } *************** *** 58,61 **** --- 60,68 ---- return (attributes.Length == 0) ? null : (ReflectorPropertyAttribute)attributes[0]; } + + public ISerialiserFactory SerialiserFactory + { + set { factory = value; } + } } } \ No newline at end of file Index: ReflectorCollectionAttribute.cs =================================================================== RCS file: /cvsroot/netreflector/NetReflector/src/NetReflector/attributes/ReflectorCollectionAttribute.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ReflectorCollectionAttribute.cs 15 Nov 2004 05:13:03 -0000 1.5 --- ReflectorCollectionAttribute.cs 8 Sep 2005 01:07:47 -0000 1.6 *************** *** 1,4 **** using System; - using System.Reflection; namespace Exortech.NetReflector --- 1,3 ---- *************** *** 8,18 **** { public ReflectorCollectionAttribute(string name) : base(name) ! { ! } ! ! public override IXmlSerialiser CreateSerialiser(MemberInfo member) ! { ! return new XmlCollectionSerialiser(member, this); ! } } ! } --- 7,11 ---- { public ReflectorCollectionAttribute(string name) : base(name) ! {} } ! } \ No newline at end of file |