December 2001
Intermediate to advanced
416 pages
8h 16m
English
As it happens, the string class has five properties, only two of which are public. By default, the Get methods retrieve only public instance members—both inherited members and those declared in the class. We can use a BindingFlags enum object to override the default retrieval policy to retrieve both static and nonpublic members or to suppress retrieval of inherited members.
The BindingFlags enumerators provide instructions to the retrieval algorithm as to what members to consider. The default pair of BindingFlags enumerators consists of Public and Instance. If we want to retrieve the nonpublic members as well, we pass in the NonPublic enumerator.[1] The following, however, does not work:
[1] Provided ...
Read now
Unlock full access