Type::IsNested Property

 

Gets a value indicating whether the current Type object represents a type whose definition is nested inside the definition of another type.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

public:
property bool IsNested {
	bool get();
}

Property Value

Type: System::Boolean

true if the Type is nested inside another type; otherwise, false.

The IsNested property returns true for all nested types, regardless of visibility. To test for nesting and visibility at the same time, use the related properties IsNestedAssembly, IsNestedFamily, IsNestedFamANDAssem, IsNestedFamORAssem, IsNestedPrivate, or IsNestedPublic.

System_CAPS_noteNote

The VisibilityMask enumeration member selects the visibility attributes for a type.

The following example creates an outer class with a number of nested classes that have various types of visibility. It then retrieves the value of a number of visibility-related Type properties for the parent type and each of its nested types.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 4.0
Windows Phone Silverlight
Available since 7.1
Windows Phone
Available since 8.1
Return to top
Show: