C# MethodInfo IsPublic

Description

MethodInfo IsPublic Gets a value indicating whether this is a public method.

Syntax

MethodInfo.IsPublic has the following syntax.


public bool IsPublic { get; }

Example


using System;// ww  w  .ja  va2 s . c o  m
using System.Reflection;
class methodbase
{
    public static int Main(string[] args)
    {
        Type MyType = Type.GetType("System.MulticastDelegate");
        MethodBase Mymethodbase = MyType.GetMethod("RemoveImpl", BindingFlags.NonPublic);
        Console.Write(Mymethodbase);

        Console.Write(Mymethodbase.IsPublic);
        return 0;
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Reflection »




EventInfo
FieldInfo
MemberInfo
MethodInfo
ParameterInfo
TypeInfo