[Mono-list] RegistrationException

Lluis Sanchez lluis@ideary.com
Thu, 6 Feb 2003 21:07:04 +0100


Hi!,

You can simply and the whole array to SerializationInfo, like this:

public override void GetObjectData (SerializationInfo info, StreamingContext
ctx)
{
    base.GetObjectData (info,ctx);
    info.AddValue ("ErrorInfo",errorInfo);
}

The formater will take care of serializing the contents of the array.
You should also write a serialization constructor like this:

private RegistrationException (SerializationInfo info, StreamingContext
ctx): base (info,ctx)
{
    errorInfo = (RegistrationErrorInfo[]) info.GetValue ("ErrorInfo", typeof
(RegistrationErrorInfo[]));
}

This will deserialize the info.

Regards,
Lluis.


----- Original Message -----
From: "Alexander Chan" <alexc2649@nyc.rr.com>
To: "Lluis Sanchez" <lluis@ideary.com>; <mono-list@lists.ximian.com>
Sent: Thursday, February 06, 2003 8:50 PM
Subject: Re: [Mono-list] RegistrationException


> lluis,
> i have implemented the GetObjectData() functionality in
RegistrationException.
> I am not sure i am doing it right. this is my first time doing something
> like this. i am wondering if i am doing it right. i have attched the
> class in this email. any help would greatly be appreciated.
>
> alexander chan
>