Exemplo n.º 1
0
        public TargetClassDefinition Build(ClassContext classContext)
        {
            ArgumentUtility.CheckNotNull("classContext", classContext);

            if (classContext.Type.ContainsGenericParameters)
            {
                string message = string.Format("The base class {0} contains generic parameters. This is not supported.", classContext.Type.FullName);
                throw new ConfigurationException(message);
            }

            var classDefinition = new TargetClassDefinition(classContext);

            var membersBuilder = new MemberDefinitionBuilder(classDefinition, ReflectionUtility.IsPublicOrProtectedOrExplicit);

            membersBuilder.Apply(classDefinition.Type);

            var attributesBuilder = new AttributeDefinitionBuilder(classDefinition);

            attributesBuilder.Apply(classDefinition.Type);

            ApplyComposedInterfaces(classDefinition, classContext);
            ApplyMixins(classDefinition, classContext);
            ApplyMethodRequirements(classDefinition);

            AnalyzeOverrides(classDefinition);
            AnalyzeAttributeIntroductions(classDefinition);
            AnalyzeMemberAttributeIntroductions(classDefinition);
            return(classDefinition);
        }
Exemplo n.º 2
0
        private void AnalyzeMembers(MixinDefinition mixin)
        {
            var membersBuilder = new MemberDefinitionBuilder(mixin, IsVisibleToInheritorsOrExplicitInterfaceImpl);

            membersBuilder.Apply(mixin.Type);
        }