On Monday, May 21, 2012 3:43:37 PM UTC-4, craiggwilson wrote:
> 1) So, this is fairly unrelated to the driver itself and really more
> dependent upon the GUI piece and what technology you are using. If you are
> using the built-in Windows Forms TreeView control, then there is a Tag
> property on each node. You can assign the BsonElement to this Tag property
> so that when the user edits it, you know exactly what to apply the changes
> to. A deletion would mean you'd need to move to the node's parent and
> remove the element referenced by the subnode's Tag. e.g.
> node.Parent.Tag.Remove(node.Tag).
> There are a gillion ways of doing this, and none really relate to the
> driver itself.
> 2) You are going to need a JSON parser to get the object into a form you
> can use. We have a JsonReader that can read a string of json and convert it
> into a document. This may take some work and some looking into as I'm
> unfamiliar with how to accomplish this yet. I'll try and follow up later
> with an example.
> On Monday, May 21, 2012 9:58:11 AM UTC-5, trypsin wrote:
>> I'm trying to offer some functions that allow the user to modify the
>> existing bsondocument through the GUI, currently I'm in this phase:
>> I show the whole hierarchy of the bsondocument in a treeview.
>> and my questions is :
>> 1. if I allow user to only to modify the node and its value that he
>> selects, how should I find the correponding bson element in the
>> bsondocument?
>> 2, if I offer some text edting GUI that allow user to modify any part of
>> the bsondocument, and my software should deal with both how bsondocument
>> converted into a well indented text format, and how read the modified text
>> back so that I can serialize it inversely as a updated bsondocument.