-
Inheriting ListViewItem Serialize/Deserialize Problem
I'm trying to derive a class from System.Windows.Forms.ListViewItem rather than use the Tag property. It has to be able to serialize and deserialize. It compiles OK and appears to serialize OK (using BinaryFormatter), but I get a SerializationException when deserializing, with the message that I don't have an appropriate constructor for my class. From perusing the docs on custom serialization (http://msdn.microsoft.com/library/de...ialization.asp) it appears my class needs to have the signature MyObject(SerializationInfo info, StreamingContext context). And I can't implement that because ListViewItem's constructor of that signature is private.
So is it possible to derive from ListViewItem and do serialization? MSDN implies it is. For example, there are protected Serialize/Deserialize methods that have a note to inheritors (http://msdn.microsoft.com/library/de...alizetopic.asp). But I don't understand how to use them. They are not part of the ISerializable interface, and ListViewItem doesn't even implement the GetObjectData that ISerializable calls for.
I have tried implementing an empty MyObject() constructor and also just implement the Serialize and Deserialize methods (calling the base ListViewItem ones), but I keep getting the same exception from the Deserialize.
Any ideas or should I just use Tag?
Raj
Similar Threads
-
By Irina in forum ASP.NET
Replies: 0
Last Post: 11-29-2002, 10:47 PM
-
Replies: 0
Last Post: 12-13-2001, 12:06 PM
-
By Roseta in forum VB Classic
Replies: 0
Last Post: 11-14-2001, 03:24 AM
-
By Ayman in forum VB Classic
Replies: 0
Last Post: 04-03-2000, 01:08 AM
-
By Jason Bock in forum VB Classic
Replies: 0
Last Post: 03-21-2000, 06:48 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks