コード例 #1
0
ファイル: Application.cs プロジェクト: tylike/Excess
        public static __Scope Load(IEnumerable <Assembly> assemblies)
        {
            var result = new __Scope(default(__Scope));

            foreach (var assembly in assemblies)
            {
                foreach (var type in assembly.GetTypes())
                {
                    if (type
                        .CustomAttributes
                        .Any(attr => attr.AttributeType == typeof(AutoInit)))
                    {
                        type.GetMethod("__init")
                        ?.Invoke(null, new object[] { result });
                    }
                }
            }

            return(result);
        }
コード例 #2
0
ファイル: Scope.cs プロジェクト: tylike/Excess
 public __Scope(__Scope parent)
 {
     _parent = parent;
 }