Documenting String Literals
The final point of interest regarding .NET metadata is the fact that each and every string literal in
your code base is documented under the User Strings token, for example:
User Strings
-------------------------------------------------------
70000001 : (11) L"Jamming {0}"
70000019 : (13) L"Quiet time..."
70000035 : (23) L"CarLibrary Version 2.0!"
70000065 : (14) L"Ramming speed!"
70000083 : (19) L"Faster is better..."
700000ab : (16) L"Time to call AAA"
700000cd : (16) L"Your car is dead"
Now, don’t be too concerned with the exact syntax of each and every piece of .NET metadata.
The bigger point to absorb is that .NET metadata is very descriptive and lists each internally defined
(and externally referenced) type found within a given code base.
The next question on your mind may be (in the best-case scenario) “How can I leverage this
information in my applications?” or (in the worst-case scenario) “Why should I care about meta-
data?” To address both points of view, allow me to introduce .NET reflection services. Be aware that
the usefulness of the topics presented over the pages that follow may be a bit of a head-scratcher
until this chapter’s endgame. So hang tight.
Do'stlaringiz bilan baham: |