public static bool SetTypeFromFieldInfo(FieldInfo info, IHasTypeName hasType) { var usedTypeAttr = info.GetCustomAttributes(true) .OfType <UsedTypeAttribute>() .FirstOrDefault(_a => _a != null); if (usedTypeAttr == null) { return(false); } usedTypeAttr.SetType(hasType); return(true); }
public void SetType(IHasTypeName typeName) { typeName.HasType = UsedType; }