Export (0) Print
Expand All

Type.GetNestedType Method (String)

.NET Framework 1.1

Searches for the nested type with the specified name.

[Visual Basic]
Overloads Public Function GetNestedType( _
   ByVal name As String _
) As Type
[C#]
public Type GetNestedType(
 string name
);
[C++]
public: Type* GetNestedType(
 String* name
);
[JScript]
public function GetNestedType(
   name : String
) : Type;

Parameters

name
The string containing the name of the nested type to get, specified as nested.

Return Value

A Type object representing the nested type with the specified name, if found; otherwise, a null reference (Nothing in Visual Basic).

Exceptions

Exception Type Condition
ArgumentNullException name is a null reference (Nothing in Visual Basic).

Remarks

The search for name is case-sensitive.

The following table shows what members of a base class are returned by the Get methods when reflecting on a type.

Member Type Static Non-Static
Constructor No No
Field No Yes. A field is always hide-by-name-and-signature.
Event Not applicable The common type system rule is that the inheritance is the same as that of the methods that implement the property. Reflection treats properties as hide-by-name-and-signature. See note 2 below.
Method No Yes. A method (both virtual and non-virtual) can be hide-by-name or hide-by-name-and-signature.
Nested Type No No
Property Not applicable The common type system rule is that the inheritance is the same as that of the methods that implement the property. Reflection treats properties as hide-by-name-and-signature. See note 2 below.
  1. Hide-by-name-and-signature considers all of the parts of the signature, including custom modifiers, return types, parameter types, sentinels, and unmanaged calling conventions. This is a binary comparison.
  2. For reflection, properties and events are hide-by-name-and-signature. If you have a property with both a get and a set accessor in the base class, but the derived class has only a get accessor, the derived class property hides the base class property, and you will not be able to access the setter on the base class.
  3. Custom attributes are not part of the common type system.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Common Language Infrastructure (CLI) Standard

.NET Framework Security: 

See Also

Type Class | Type Members | System Namespace | Type.GetNestedType Overload List | String | DefaultBinder | GetNestedTypes

Show:
© 2014 Microsoft