We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Subclassing TreeNodeAdv and Serialization

Thread ID:

Created:

Updated:

Platform:

Replies:

31858 Jul 15,2005 03:15 PM Jul 22,2005 11:42 AM Windows Forms 3
loading
Tags: Tools
Mathew Gower
Asked On July 15, 2005 03:15 PM

I''ve run into a problem that I''m not quite sure how to resolve. I want to subclass the TreeNodeAdv class, but doing so appears to create problems when copying/pasting an instance of the subclass. The TreeNodeAdv class is serializable, and can be retrieved from the clipboard without a problem. Subclasses of the TreeNodeAdv class can be placed on the clipboard easily enough, but can only be retrieved from the clipboard as an instance of a TreeNodeAdv, not as an instance of the subclass. I''m guessing that my subclass would need to implement the constructor and method for the ISerializable interface, but the TreeNodeAdv class doesn''t seem to make this possible, since it already implements ISerializable, and doesn''t expose the constructor or the method of the interface to subclasses. Any idea where to go from here?

Administrator [Syncfusion]
Replied On July 19, 2005 05:58 PM

Hi Mathew, You can still implement ISerializable in your subclass, since C# allows you to reimplement an interface. All TreeNodeAdv saves in GetDataObject is NodeStyle and ChildStyle, which you can do yourself. Regards, Gregory Austin Syncfusion Inc.

Mathew Gower
Replied On July 20, 2005 07:14 AM

> You can still implement ISerializable in your subclass, since C# allows you to reimplement an interface. All TreeNodeAdv saves in GetDataObject is NodeStyle and ChildStyle, which you can do yourself. > Thank you for the reply. Unfortunately, this solution won''t work for us. We''re using VB.NET, which prevents you from re-implementing an interface. We''re working around the problem by associating our data with the tree node, and placing the data on the clipboard. We then reconstruct the tree node when the data is pasted, re-associating the data. Not a perfect solution, but it works. It would be nice if the serializable methods were protected rather than private in future versions to make extended the classes easier in VB.NET.

Administrator [Syncfusion]
Replied On July 22, 2005 11:42 AM

Hi Mathew, I have entered this as Feature Request #291. Regards, Gregory Austin Syncfusion Inc.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;