C# Type IsNotPublic
Description
Type IsNotPublic
gets a value indicating whether the
Type is not declared public.
Syntax
Type.IsNotPublic
has the following syntax.
public bool IsNotPublic { get; }
Example
This example shows the use of IsNotPublic to get the visibility of the type.
// w ww . j ava 2s. co m
using System;
using System.IO;
using System.Reflection;
class MyMemberInfo
{
public static void Main(string[] args)
{
Type MyType =Type.GetType("System.IO.File");
MemberInfo[] Mymemberinfoarray = MyType.GetMembers();
Console.WriteLine(MyType.IsNotPublic.ToString());
}
}
The code above generates the following result.