Click here to Skip to main content
15,927,699 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: TCP/IP vs. HTTP Pin
Tim Smith20-May-02 7:34
Tim Smith20-May-02 7:34 
GeneralRe: TCP/IP vs. HTTP Pin
Paul Watson27-May-02 9:29
sitebuilderPaul Watson27-May-02 9:29 
QuestionProject config out of date? Pin
Lunchy19-May-02 7:49
Lunchy19-May-02 7:49 
AnswerRe: Project config out of date? Pin
James T. Johnson21-May-02 6:10
James T. Johnson21-May-02 6:10 
GeneralRe: Project config out of date? Pin
Lunchy21-May-02 6:25
Lunchy21-May-02 6:25 
GeneralRe: Project config out of date? Pin
James T. Johnson21-May-02 6:27
James T. Johnson21-May-02 6:27 
GeneralRe: Project config out of date? Pin
Lunchy21-May-02 7:37
Lunchy21-May-02 7:37 
GeneralCustom Serialization Pin
Gluber17-May-02 9:58
Gluber17-May-02 9:58 
Hi there !

I have a tricky little problem. First I have to elaborate on my custom application architecture.

I am desigining a highly extensible game engine which gets almost all functionality out of plugins which are implemented as .NET assemblies.

I have a class called "Node" which wraps dynamically loaded classes via their object base class and supports invocation of methods via reflection as well as other things..

Nodes are organized in a hierarchy . Every Node contains a SortedList storing all child nodes, as well as a Node Reference pointing to the
Parent node of a given node, as well as an object reference pointing to the wrapped class ( which was imported from the plugin assembly )

Now i want to save the hierarchy to a file via serialization. However i only want to save parts of the hierarchy from a given node. However since there is a parent reference , always the whole hierarchy gets serialized since the serializer walks both ways automatcially.

So i want to restrict the serialization of the parent reference in certain cases dynamically. I can'T just add "Noserialze" attribute to the parent reference, since all classes are wrapped in Nodes and there can't be derived classes.

Because of that i want to support ISerialize on the Node class to control what gets serialized and stop at a given node.

However i do not seem to get that working. In particular how do i have to serialize the SortedList for the child nodes ?

This is what i have so far:

public void Node.GetObjectData( SerializationInfo info,StreamingContext context )
{
info.AddValue("Id",m_identifier ); // Store the node id

foreach( Node n in m_children.Values )
{
string name = n.Name;
info.AddValue ( "Name",name );
info.AddValue ( "Node",n );


}

if ( m_parentSerialize )
info.AddValue("Parent",n.Parent );
}

However this does not seem to work
I also tried calling GetObjectData for the child nodes..
Seems not to work either.. .

Any clues ?

GeneralRe: Custom Serialization Pin
James T. Johnson17-May-02 16:09
James T. Johnson17-May-02 16:09 
GeneralRe: Custom Serialization Pin
Gluber18-May-02 2:56
Gluber18-May-02 2:56 
GeneralRe: Custom Serialization Pin
James T. Johnson21-May-02 6:06
James T. Johnson21-May-02 6:06 
GeneralRe: Custom Serialization Pin
Neil Van Note21-May-02 19:21
Neil Van Note21-May-02 19:21 
QuestionPaste as plain text in VC7? Pin
Todd Smith16-May-02 12:21
Todd Smith16-May-02 12:21 
AnswerRe: Paste as plain text in VC7? Pin
Andres Manggini16-May-02 14:26
Andres Manggini16-May-02 14:26 
GeneralRe: Paste as plain text in VC7? Pin
Todd Smith16-May-02 14:42
Todd Smith16-May-02 14:42 
AnswerRe: Paste as plain text in VC7? Pin
James T. Johnson17-May-02 1:16
James T. Johnson17-May-02 1:16 
GeneralRe: Paste as plain text in VC7? Pin
Todd Smith20-May-02 10:50
Todd Smith20-May-02 10:50 
QuestionWhat is the min OS I can install .Net on? Pin
Srini Kella15-May-02 7:38
Srini Kella15-May-02 7:38 
AnswerRe: What is the min OS I can install .Net on? Pin
Mazdak15-May-02 8:14
Mazdak15-May-02 8:14 
AnswerRe: What is the min OS I can install .Net on? Pin
James T. Johnson15-May-02 8:17
James T. Johnson15-May-02 8:17 
GeneralRe: What is the min OS I can install .Net on? Pin
Kevin McFarlane27-May-02 9:55
Kevin McFarlane27-May-02 9:55 
QuestionWhat is your %PATH% after installing .NET? Pin
Todd Smith13-May-02 18:42
Todd Smith13-May-02 18:42 
AnswerRe: What is your %PATH% after installing .NET? Pin
James T. Johnson13-May-02 18:41
James T. Johnson13-May-02 18:41 
General.NET via C++ COM Pin
rkiesler13-May-02 8:44
rkiesler13-May-02 8:44 
GeneralRe: .NET via C++ COM Pin
Rama Krishna Vavilala16-May-02 14:49
Rama Krishna Vavilala16-May-02 14:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.