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" <[EMAIL PROTECTED]>
To: "Lluis Sanchez" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
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
>

_______________________________________________
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to