internal bool GetStaticPropertyOrField(string id, out HybInstance value, AccessLevel accessLevel) { SSPropertyInfo property = GetProperty(id); if (property != null) { if (property.AccessModifier.IsAcceesible(accessLevel) == false) { throw new SemanticViolationException($"Invalid access: {id}"); } value = property.GetMethod.Invoke(null, new HybInstance[] { }); return(true); } SSFieldInfo field = GetField(id); if (field != null) { if (field.AccessModifier.IsAcceesible(accessLevel) == false) { throw new SemanticViolationException($"Invalid access: {id}"); } value = field.GetValue(null); return(true); } value = null; return(false); }
public bool TryGetProperty(string id, out SSPropertyInfo property) { property = null; if (HasProperty(id) == false) { return(false); } property = Properties[id]; return(true); }
public SSPropertyInfo GetProperty(string id) { SSPropertyInfo property = null; if (_Properties == null) { _Properties = new Dictionary <string, SSPropertyInfo>(); } if (_Properties.ContainsKey(id)) { property = _Properties[id]; } else { property = _GetProperty(id); if (property != null) { _Properties[id] = property; } } return(property); }