on 03-23-2015 9:03 AM
Hi :o),
I'm using PowerDesigner 15 and I would like the code generated for each serializable class contains the "[XmlInclude(typeof (CHILD_OBJ))]" attribute that describes child objects.
How could I do, please ?
Best Regards,
Cyrille
Would there an alternate solution better than using either "partial classes", or a custom xml-serializer-overrides, please ?
Regards,
Cyrille
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
Here is a sample of what I'd like the generator to produce (it's OK to produce the [Serializable] attribute, but not for the [XmlInclude(...)] attribute) :
using System;
using System.Xml.Serialization;
namespace Generated
{
/// <summary>
/// Classe de base d'une information
/// </summary>
[Serializable]
[XmlInclude(typeof(SubClassA))]
[XmlInclude(typeof(SubClassB))]
[XmlInclude(typeof(SubClassC))]
[XmlInclude(typeof(SubClassD))]
public abstract partial class MyClass : IInterface1
{
private string m_Label;
private int m_Number;
private long m_Id;
public long Id
{
get { return m_Id; }
set { m_Id = value; }
}
public string Label
{
get { return m_Label; }
set { m_Label = value; }
}
public int Number
{
get { return m_Number; }
set { m_Number = value; }
}
}
}
And here's a context (it's OK to produce that below) :
namespace Generated
{
[Serializable]
public partial class SubClassA : MyClass , IInterface2, IInterface3
{...}
}
etc.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.