Src/Black.Beard.ComponentModel/ComponentModel/MethodDiscoveryAssembly.cs
/// <summary>
/// Permet de retourner la liste des methodes d'evaluation disponibles dans les types fournis.
/// </summary>
/// <param name="types"></param>
/// <returns></returns>
Permet de retourner la liste des methodes d'evaluation disponibles dans les types fournis.
Permet de retourner la liste des methodes d ' evaluation disponibles dans les types fournis .
private IEnumerable<(Type, ExposeClassAttribute, ExposeMethodAttribute, MethodInfo)> GetActions_Impl(BindingFlags bindings, params Type[] types)
        {
            var _result = new List<(Type, ExposeClassAttribute, ExposeMethodAttribute, MethodInfo)>();
            var _types = new ExposedTypes()
               .GetTypes()
               .Where(c => types.Contains(c.Key))
               .ToList();
            foreach (var u in _types)
            {
                var type = u.Key;
                foreach (ExposeClassAttribute attribute in u.Value)
                    if (attribute.Context == Context)
                    {
                        var items = MethodDiscovery.GetMethods(type, bindings, returnType, methodSign);
                        foreach (var method in items)
                        {
                            var attribute2 = method.GetCustomAttribute<ExposeMethodAttribute>();
                            if (attribute2 != null && (string.IsNullOrEmpty(Context) || attribute2.Context == Context))
                                _result.Add((u.Key, attribute, attribute2, method));
                        }
                    }
            }
            return _result;
        }
private IEnumerable < ( Type , ExposeClassAttribute , ExposeMethodAttribute , MethodInfo ) > GetActions_Impl ( BindingFlags bindings , params Type [ ] types ) { var _result = new List < ( Type , ExposeClassAttribute , ExposeMethodAttribute , MethodInfo ) > ( ) ; var _types = new ExposedTypes ( ) . GetTypes ( ) . Where ( c => types . Contains ( c . Key ) ) . ToList ( ) ; foreach ( var u in _types ) { var type = u . Key ; foreach ( ExposeClassAttribute attribute in u . Value ) if ( attribute . Context == Context ) { var items = MethodDiscovery . GetMethods ( type , bindings , returnType , methodSign ) ; foreach ( var method in items ) { var attribute2 = method . GetCustomAttribute < ExposeMethodAttribute > ( ) ; if ( attribute2 != null && ( string . IsNullOrEmpty ( Context ) || attribute2 . Context == Context ) ) _result . Add ( ( u . Key , attribute , attribute2 , method ) ) ; } } } return _result ; }
Permet de retourner la liste des methodes d'evaluation disponibles dans les types fournis.
Permet de retourner la liste des methodes d ' evaluation disponibles dans les types fournis .
None
bindings
BindingFlags
types
None