ConstructorInfo.MemberType Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets a MemberTypes value indicating that this member is a constructor.
Assembly: mscorlib (in mscorlib.dll)
Property Value
Type: System.Reflection.MemberTypesA value that indicates that this member is a constructor.
This property overrides MemberType. Therefore, when you examine a set of MemberInfo objects — for example, the array returned by Type.GetMembers — the MemberType property returns MemberTypes.Constructor only when a given member is a constructor.
The following example uses the MemberType property to identify a MemberInfo object as a constructor.
Note: |
|---|
To run this example, see Building examples that have static TextBlock controls for Windows Phone 8. |
using System; using System.Reflection; class Example { public static void Demo(System.Windows.Controls.TextBlock outputBlock) { // Get the Type and MemberInfo. Type MyType = typeof(System.Threading.Thread); // Display the MemberType and the member. outputBlock.Text += String.Format("There are {0} members in {1}:\n", MyType.GetMembers().Length, MyType.FullName); foreach (MemberInfo mi in MyType.GetMembers()) { outputBlock.Text += String.Format(" {0} - {1}\n", mi.MemberType, mi); } } }
Note: