using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
namespace Apewer.Models
{
/// 属性信息。
public class Property
{
/// 对象实例。
public object Instance { get; set; }
/// 所属类型。
public Type Type { get; set; }
/// 属性信息。
public PropertyInfo Information { get; set; }
/// 属性的 Get 方法,不存在时为 NULL 值。
public MethodInfo Getter { get; set; }
/// 属性的 Get 方法,不存在时为 NULL 值。
public MethodInfo Setter { get; set; }
/// 属性包含 Get 方法。
public bool HasGet { get { return Getter != null; } }
/// 属性包含 Set 方法。
public bool HasSet { get { return Setter != null; } }
/// 静态属性。
public bool IsStatic
{
get
{
if (Getter != null) return Getter.IsStatic;
if (Setter != null) return Getter.IsStatic;
return false;
}
}
}
}