Пример #1
0
 public MixinWeaveProcess(TypeDefinition target, AspectDefinition aspect, MixinEffect effect)
 {
     _target = target;
     _aspect = aspect;
     _effect = effect;
     _ts     = target.Module.GetTypeSystem();
 }
Пример #2
0
        public MixinWeaveProcess(ILogger log, IMemberDefinition target, AspectDefinition aspect, MixinEffect effect)
        {
            switch (target)
            {
            case TypeDefinition td: _target = td; break;

            case MethodDefinition md: _target = md.DeclaringType; break;

            case PropertyDefinition pd: _target = pd.DeclaringType; break;

            case EventDefinition ed: _target = ed.DeclaringType; break;

            default: log.Log(GeneralRules.UnexpectedCompilerBehaviour, _target, $"Unexpected mixin target '{target.ToString()}'"); break;
            }

            _aspect = aspect;
            _effect = effect;
        }