S
Sahil Malik
Well, the problem is pretty simple.
I have a class that inherits from CollectionBase, but Implements
ISerializable. The name of this class is UsageLogs .. so now my UsageLogs
can contain multiple UsageLog.
Now when I try to serialize this class it works
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("InnerList", InnerList) ;
}
But when I try to deserialize it,
public UsageLogs(SerializationInfo info, StreamingContext context)
{
ArrayList innerList = (ArrayList) info.GetValue("InnerList",
typeof(ArrayList)) ;
foreach(UsageLog log in innerList)
{
List.Add(log) ;
}
// this.InnerList.AddRange((ArrayList) info.GetValue("InnerList",
typeof(ArrayList))) ;
}
I have gotten mixed results viz -
a) List is readonly.
b) It won't let me add the parameters manually.
c) it just wouldn't get any parameters at all ....
Please Help !!!!
PS: I cannot get away with <Serializable()> since I have public delegates in
this class.
- Sahil Malik
Independent Consultant
You can reach me thru my blog - http://dotnetjunkies.com/WebLog/sahilmalik/
I have a class that inherits from CollectionBase, but Implements
ISerializable. The name of this class is UsageLogs .. so now my UsageLogs
can contain multiple UsageLog.
Now when I try to serialize this class it works
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("InnerList", InnerList) ;
}
But when I try to deserialize it,
public UsageLogs(SerializationInfo info, StreamingContext context)
{
ArrayList innerList = (ArrayList) info.GetValue("InnerList",
typeof(ArrayList)) ;
foreach(UsageLog log in innerList)
{
List.Add(log) ;
}
// this.InnerList.AddRange((ArrayList) info.GetValue("InnerList",
typeof(ArrayList))) ;
}
I have gotten mixed results viz -
a) List is readonly.
b) It won't let me add the parameters manually.
c) it just wouldn't get any parameters at all ....
Please Help !!!!
PS: I cannot get away with <Serializable()> since I have public delegates in
this class.
- Sahil Malik
Independent Consultant
You can reach me thru my blog - http://dotnetjunkies.com/WebLog/sahilmalik/