NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Getting the Default Members

There are two ways to get the default members of a class: through custom attributes and through a helper method on type.

As noted above, the default member data is stored in a custom attribute. This custom attribute can be found on a type using the normal custom attribute mechanism.

   DefaultMemberAttribute defMem = (DefaultMemberAttribute) t.GetCustomAttribute (typeof(DefaultMemberAttribute))[0];
   MemberInfo[] = t.GetMember (defMem.MemberName);

There is also a helper method on Type that should yield exactly the same result.

   MemberInfo[] = t.GetDefualtMembers ();

This method will throw an InvalidOperationException if there is more than one default member defined on this type.