I tried the following code example. It works fine using the Microsoft
Csharp-Compiler, but doesn't under Mono
----------------------------------------
using System;
using System.Xml;
using System.Xml.Serialization;
using System.IO;
namespace TestSerialisation
{
/// <summary>
/// Zusammenfassung f�r Class1.
/// </summary>
public class Class1
{
/// <summary>
/// Der Haupteinstiegspunkt f�r die Anwendung.
/// </summary>
[STAThread]
static void Main(string[] args)
{
TestNS.ExponentialDistribution expDist = new
TestNS.ExponentialDistribution();
TestNS.ElementAttributeMatrix2 attrib = new
TestNS.ElementAttributeMatrix2();
TestNS.Distribution attrib2 = new TestNS.Distribution();
// dosn't work
attrib.SetValue(0, expDist);
// work
//attrib.SetValue(0, attrib2);
// error while serialisation
XmlSerializer ser2 = new
XmlSerializer(typeof(TestNS.ElementAttributeMatrix2));
TextWriter writer2 = new StreamWriter("class2.xml");
ser2.Serialize(writer2, attrib);
writer2.Close();
Console.WriteLine("Return-Taste dr�cken ...");
Console.ReadLine();
}
}
}
namespace TestNS
{
[Serializable()]
public class Distribution
{
public Distribution() { }
}
[Serializable()]
public class ExponentialDistribution : TestNS.Distribution
{
private double m_Lambda = double.NaN;
public ExponentialDistribution()
{
}
public double Lambda
{
set { this.m_Lambda = value; }
get { return this.m_Lambda; }
}
}
[Serializable]
public class ElementAttributeMatrix2
{
private object[] m_Values2;
#region constructors
public ElementAttributeMatrix2()
{
}
#endregion
//public void SetValue(int x, TestNS.ExponentialDistribution2 _Dist)
public void SetValue(int x, object _Dist)
{
this.m_Values2 = new object[1];
((object[]) this.m_Values2)[0] = new object[1];
((object[]) ((object[]) this.m_Values2)[0])[0] = new object[x
+ 1];
((object[]) ((object[]) ((object[]) this.m_Values2)[0])[0])[0]
= _Dist;
}
[XmlArrayItem(typeof(object))]
[XmlArrayItem(typeof(object[]))]
[XmlArrayItem(typeof(TestNS.Distribution))]
[XmlArrayItem(typeof(TestNS.Distribution[]))]
[XmlArrayItem(typeof(TestNS.ExponentialDistribution))]
[XmlArrayItem(typeof(TestNS.ExponentialDistribution[]))]
public object[] MatrixValues
{
set { this.m_Values2 = value; }
get { return this.m_Values2; }
}
}
}
----------------------------------------
Can you help me?
with friendly reguards
Michael Kaempf
_______________________________________
Michael Kaempf
Email: [EMAIL PROTECTED]
[EMAIL PROTECTED]
Tel.: 0175/7909349
0371/9097234
_______________________________________________
Mono-list maillist - [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list