quote:Original post by Anonymous Poster
personaly i use
<access flags> <type>[] Name { get { return array; } }
I believe that is what Arild was suggesting. But this just really doesn''t solve the problem I am having. There would be little difference in this, and making the array public access in the class. If I use this, then a user of the code still ends up with complete write access to the entire tree structure in one go.
I wanted to limit the interface to nodes. Furthermore this takes away the power of the class which is returning the node, to determine which node to return. IE- if it is determined that there are only 3 main value types of the nodes ( and there are 100''s of nodes), then I would probably just have the 3 actual nodes, and a list of value type lookups for the rest of the nodes. Then whenever a user requested say: child[14] I would return the value type which child[14] referred to from the internal lookup table. This isn''t possible if I just create an array property, since I''m just returning the whole load of data in one go.