예제 #1
0
        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());
            }
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
 public override int GetHashCode()
 {
     if (IsCompiledType)
     {
         return(CompiledType.GetHashCode());
     }
     return(InterpretKlass.GetHashCode());
 }
예제 #5
0
 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());
     }
 }
예제 #6
0
 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());
     }
 }