private MemberInfo GetMember(Type type, ScriptAccessType accesstype) { foreach (MemberInfo member in type.GetMembers(BindingFlags.Public | BindingFlags.Instance)) { foreach (ScriptableAttribute attribute in member.GetCustomAttributes(typeof(ScriptableAttribute), false)) { if ((attribute.Name ?? member.Name) != membername) { continue; } if ((attribute.AccessType & accesstype) != accesstype) { continue; } return(member); } } throw new ApplicationException(); }
private MemberInfo GetMember(Type type,ScriptAccessType accesstype) { foreach (MemberInfo member in type.GetMembers(BindingFlags.Public | BindingFlags.Instance)) { foreach (ScriptableAttribute attribute in member.GetCustomAttributes(typeof(ScriptableAttribute),false)) { if ((attribute.Name ?? member.Name) != membername) continue; if ((attribute.AccessType & accesstype) != accesstype) continue; return member; } } throw new ApplicationException(); }
public ScriptableAttribute(ScriptAccessType accesstype) { this.accesstype = accesstype; this.name = null; }