var safeMode = new SafeMode(other) { WMode = "majority" };
I saw this form several time in http://www.mongodb.org/display/DOCS/CSharp+Driver+Tutorial#CSharpDriverTutorial-C%23Driverversionv1.4.x
The { WMode = "majority" } is what I am not familiar with. Is it a code, a collection initializer, or what?
What it does is calling a constructor of SafeMode. I wasn’t aware that you can add bracket stuffs after that. Is that a “code” or what?
The syntax is called Object Initializers.
the equivalent vb.net code could be this full code
or using object initializer syntax.
http://blogs.msdn.com/b/wriju/archive/2008/02/05/vb-net-9-0-object-and-array-initializers.aspx