// The delegate should have a single param argument. // Usually, Advanced Inspector pass the instance and the value as argument. // Other attribute may pass extra argument, such as Regex or the attribute properties. private static bool Inspect(InspectAttribute inspect, object instance, object value) { AIExample39_DynamicStatic example = instance as AIExample39_DynamicStatic; if (example == null) { return(false); } return(example.displayItem); }
public MemberInfoAndInspectAttr(MemberInfo info, Type realType, InspectAttribute inspectAttribute) { if (info == null) { throw new ArgumentNullException("info"); } if (inspectAttribute == null) { throw new ArgumentNullException("inspectAttribute"); } Info = info; RealType = realType; InspectAttribute = inspectAttribute; }
public FieldInfoAndInspectAttr(FieldInfo info, InspectAttribute inspectAttribute) : base(info, info.FieldType, inspectAttribute) { }
public FieldInspectionInfo(FieldInfo info, InspectAttribute inspectAttribute) { Info = info ?? throw new ArgumentNullException(nameof(info)); RealType = info.FieldType ?? throw new ArgumentException("Is null.", nameof(info.FieldType)); InspectAttribute = inspectAttribute ?? throw new ArgumentNullException(nameof(inspectAttribute)); }
public PropertyInfoAndInspectAttr(PropertyInfo info, InspectAttribute inspectAttribute) : base(info, info.PropertyType, inspectAttribute) { }