コード例 #1
0
ファイル: BridgeType.cs プロジェクト: bematech/Bridge
        public static void EnsureModule(BridgeType type)
        {
            var def = type.Type.GetDefinition();

            if (def != null && type.Module == null)
            {
                if (def.Attributes.Count > 0)
                {
                    var attr = def.Attributes.FirstOrDefault(a => a.AttributeType.FullName == "Bridge.ModuleAttribute");

                    if (attr != null)
                    {
                        BridgeTypes.ReadModuleFromAttribute(type, attr);
                    }
                }

                if (type.Module == null)
                {
                    var asm = def.ParentAssembly;

                    if (asm.AssemblyAttributes.Count > 0)
                    {
                        var attr = asm.AssemblyAttributes.FirstOrDefault(a => a.AttributeType.FullName == "Bridge.ModuleAttribute");

                        if (attr != null)
                        {
                            BridgeTypes.ReadModuleFromAttribute(type, attr);
                        }
                    }
                }
            }
        }