System. reflection. Missing. Value and type. Missing

Source: Internet
Author: User

Indicates the missing value in the type information. The field is read-only.

UseMissingThe field is called through reflection to obtain the default value of the parameter. If you specifyMissingField, and the parameter does not have the default value, an exception is thrown.

Type. Missing is defined:
Public static readonly object missing;
This field is initialized in the type class constructor,CodeIs:
Type. Missing = missing. value;

system. reflection. the missing class is defined as:
Public sealed class missing
{< br> static missing () {missing. value = new missing () ;}< br> internal missing ();
Public static readonly missing value;
}< br> therefore, they are equivalent, all are system. reflection. missing type.
although type. missing is defined as an object, but in the static constructor of the type class, system. reflection. missing. value is assigned to it, So type. the missing type is changed to system. reflecton. missing.
you can run the following code for detection:
MessageBox. show (system. reflection. missing. value. getType (). tostring ();
MessageBox. show (system. type. missing. getType (). tostring ();

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.