IKVM.Reflection.Type.GetMethods C# (CSharp) Метод

GetMethods() публичный Метод

public GetMethods ( ) : IKVM.Reflection.MethodInfo[]
Результат IKVM.Reflection.MethodInfo[]
        public MethodInfo[] GetMethods()
        {
            return GetMethods(BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance);
        }

Same methods

Type::GetMethods ( BindingFlags bindingAttr ) : IKVM.Reflection.MethodInfo[]

Usage Example

Пример #1
0
        private static bool HasCast(Type type, Type from, Type to, out MethodInfo op)
        {
#if WINRT
            System.Collections.Generic.List <MethodInfo> list = new System.Collections.Generic.List <MethodInfo>();
            foreach (var item in type.GetRuntimeMethods())
            {
                if (item.IsStatic)
                {
                    list.Add(item);
                }
            }
            MethodInfo[] found = list.ToArray();
#else
            const BindingFlags flags = BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
            MethodInfo[]       found = type.GetMethods(flags);
#endif
            for (int i = 0; i < found.Length; i++)
            {
                MethodInfo m = found[i];
                if ((m.Name != "op_Implicit" && m.Name != "op_Explicit") || m.ReturnType != to)
                {
                    continue;
                }
                ParameterInfo[] paramTypes = m.GetParameters();
                if (paramTypes.Length == 1 && paramTypes[0].ParameterType == from)
                {
                    op = m;
                    return(true);
                }
            }
            op = null;
            return(false);
        }
All Usage Examples Of IKVM.Reflection.Type::GetMethods