Exemplo n.º 1
0
        private void AnalyzeOverrides(TargetClassDefinition definition)
        {
            var mixinMethods   = definition.Mixins.SelectMany(m => m.Methods);
            var methodAnalyzer = new OverridesAnalyzer <MethodDefinition> (typeof(OverrideMixinAttribute), mixinMethods);

            foreach (var methodOverride in methodAnalyzer.Analyze(definition.Methods))
            {
                InitializeOverride(methodOverride.Overrider, methodOverride.BaseMember);
            }

            var mixinProperties  = definition.Mixins.SelectMany(m => m.Properties);
            var propertyAnalyzer = new OverridesAnalyzer <PropertyDefinition> (typeof(OverrideMixinAttribute), mixinProperties);

            foreach (var propertyOverride in propertyAnalyzer.Analyze(definition.Properties))
            {
                InitializeOverride(propertyOverride.Overrider, propertyOverride.BaseMember);
            }

            var mixinEvents   = definition.Mixins.SelectMany(m => m.Events);
            var eventAnalyzer = new OverridesAnalyzer <EventDefinition> (typeof(OverrideMixinAttribute), mixinEvents);

            foreach (var eventOverride in eventAnalyzer.Analyze(definition.Events))
            {
                InitializeOverride(eventOverride.Overrider, eventOverride.BaseMember);
            }
        }
Exemplo n.º 2
0
        private void AnalyzeOverrides(MixinDefinition mixin)
        {
            var methodAnalyzer = new OverridesAnalyzer <MethodDefinition> (typeof(OverrideTargetAttribute), _targetClass.Methods);

            foreach (var methodOverride in methodAnalyzer.Analyze(mixin.Methods))
            {
                InitializeOverride(methodOverride.Overrider, methodOverride.BaseMember);
            }

            var propertyAnalyzer = new OverridesAnalyzer <PropertyDefinition> (typeof(OverrideTargetAttribute), _targetClass.Properties);

            foreach (var propertyOverride in propertyAnalyzer.Analyze(mixin.Properties))
            {
                InitializeOverride(propertyOverride.Overrider, propertyOverride.BaseMember);
            }

            var eventAnalyzer = new OverridesAnalyzer <EventDefinition> (typeof(OverrideTargetAttribute), _targetClass.Events);

            foreach (var eventOverride in eventAnalyzer.Analyze(mixin.Events))
            {
                InitializeOverride(eventOverride.Overrider, eventOverride.BaseMember);
            }
        }