private SSMethodInfo[] _GetMethods() { if (IsCompiledType) { return(CompiledType.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.FlattenHierarchy) .Where(x => x.IsPrivate == false) .Select(x => new SSMethodInfo(x) { Id = x.Name, IsStatic = x.IsStatic, AccessModifier = AccessModifierParser.Get(x) }) .ToArray()); } else { if (Parent == null) { return(InterpretKlass.GetMethods()); } return(Parent.GetMethods() .Concat(InterpretKlass.GetMethods()) .GroupBy(x => x.Signature) .Select(x => x.Last()) .ToArray()); } }
private SSFieldInfo _GetField(string id) { if (IsCompiledType) { var field = CompiledType.GetFields(BindingFlags.Static | BindingFlags.Public) .Where(x => x.Name == id) .FirstOrDefault(); if (field != null) { return(new SSCompiledFieldInfo(field)); } } else { if (InterpretKlass.HasField(id)) { return(InterpretKlass.GetField(id)); } if (Parent != null) { return(Parent.GetField(id)); } } return(null); }
private SSPropertyInfo _GetProperty(string id) { if (IsCompiledType) { var property = CompiledType.GetProperties(BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy) .Where(x => x.Name == id) .FirstOrDefault(); if (property != null) { return(new SSCompiledPropertyInfo(property)); } } else { if (InterpretKlass.HasProperty(id)) { return(InterpretKlass.GetProperty(id)); } if (Parent != null) { return(Parent.GetProperty(id)); } } return(null); }
public override int GetHashCode() { if (IsCompiledType) { return(CompiledType.GetHashCode()); } return(InterpretKlass.GetHashCode()); }
private SSMethodInfo[] _GetStaticMethods() { if (IsCompiledType) { return(CompiledType.GetMethods(BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy) .Select(x => new SSCompiledMethodInfo(x)) .ToArray()); } else { if (Parent == null) { return(InterpretKlass.GetMethods()); } return(InterpretKlass.GetMethods() .Concat(Parent.GetStaticMethods()) .ToArray()); } }
private SSMethodInfo[] _GetStaticMethods() { if (IsCompiledType) { return(CompiledType.GetMethods(BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy) .Select(x => new SSMethodInfo(x) { Id = x.Name, IsStatic = x.IsStatic, AccessModifier = AccessModifierParser.Get(x) }) .ToArray()); } else { if (Parent == null) { return(InterpretKlass.GetMethods()); } return(InterpretKlass.GetMethods() .Concat(Parent.GetStaticMethods()) .ToArray()); } }