Use reflector to parse windows metadata to view winrt APIs

Source: Internet
Author: User
Tags reflector

Why do I like to use reflector to browse APIs? Because reflector only displays members of each type, its members include new members defined by itself and members modified from the parent class, however, if it is a Member that only inherits from the parent class and is not rewritten, It is not displayed under the subclass. In this way, the class hierarchy is clear, and the members (that is, the added function) of each class are clear to the parent class. Msdn does not. On the contrary, it always displays all the inherited members of the type, although such members will display information such as inherited from the parent class, but a lengthy page will make you lose patience immediately ...... (But msdn, as an official API, may have to do the same .)

 

So I like to use reflector to look at the hierarchy of the class, and check the corresponding msdn explanation for the specific member meanings.

 

But what about the latest winrt API?

 

The current reflector does not seem to support automatic parsing of winrt assembly in the pre-defined list, and may be added in the future.

 

However, Windows 8 winrt (Windows runtime) uses Windows metadata (Windows metadata) to allow APIs to be called in multiple languages. Therefore,. Net does not need to call a dedicated platform (P/invoke) Like Win32. The format of this Windows metadata. net uses the same format, are ECMA-335 standards. You can enable reflector, ilspy, and ildasm.

 

The Windows metadata of Windows 8 is in the C: \ windows \ system32 \ winmetadata directory. Windows metadata all uses winmd as the extension.

 

So we can directly open this winmd and use reflector to parse winrt APIs.

 

For example, I'm viewing the AppBar type in Metro application development, it inherits from contentcontrol, And the msdn page is very lengthy (http://msdn.microsoft.com/en-us/library/windows/apps/hh701927.aspx), and I want to see its unique member definition right away, view the type namespace definition on the msdn page: You can see that it is in windows. UI. XAML. in the controls namespace.

 

In the Windows 8 windows metadata directory, find windows. UI. XAML. Controls. winmd, open it with reflector, and find the AppBar type, for example:

 

As you can see, msdn has written a lot. In fact, it only adds a few attributes (relative to the parent class contentcontrol), so you can study these attributes, if there is a problem, it is very efficient to query msdn by name. (Of course, these are based on your understanding of its parent class and its parent class (all parent classes .)

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.