Is Readable Property - CSharp System.Reflection

CSharp examples for System.Reflection:PropertyInfo

Description

Is Readable Property

Demo Code


using System.Reflection;
using System.Linq;
using System.Collections.Generic;
using System;/*from   w w w  .  j a va  2  s .  c o m*/

public class Main{
        public static bool IsReadable(this PropertyInfo propertyInfo)
        {
            return propertyInfo.CanRead && propertyInfo.GetGetMethod(false) != null;
        }
}

Related Tutorials