Пример #1
0
        public Aspect(
            Type type,
            AspectScope scope,
            AspectActivation activation,
            IAspectConstruction construction,
            ICrosscutting crosscutting,
            IEnumerable <Advice> advices,
            IEnumerable <MemberImport> memberImports,
            IEnumerable <MemberIntroduction> memberIntroductions)
        {
            ArgumentUtility.CheckNotNull("type", type);
            ArgumentUtility.CheckNotNull("construction", construction);
            ArgumentUtility.CheckNotNull("crosscutting", crosscutting);
            ArgumentUtility.CheckNotNull("advices", advices);
            ArgumentUtility.CheckNotNull("memberImports", memberImports);
            ArgumentUtility.CheckNotNull("memberIntroductions", memberIntroductions);

            _type                = type;
            _scope               = scope;
            _activation          = activation;
            _construction        = construction;
            _crosscutting        = crosscutting;
            _advices             = advices;
            _memberImports       = memberImports;
            _memberIntroductions = memberIntroductions;
        }
Пример #2
0
        protected AspectAttributeBase(AspectScope scope, string role = StandardRoles.Unspecified)
        {
            ArgumentUtility.CheckNotNullOrEmpty("role", role);

            _scope = scope;
            _role  = role;
        }
Пример #3
0
        public AspectAttribute(AspectActivation activation, AspectScope scope, string role = StandardRoles.Unspecified)
        {
            ArgumentUtility.CheckNotNullOrEmpty("role", role);

            _activation = activation;
            _scope      = scope;
            _role       = role;
        }
Пример #4
0
        public static AspectScope GetAspectScope(AspectScope scope = (AspectScope)0)
        {
            if (scope != 0)
            {
                return(scope);
            }

            return(AspectScope.Factory);
        }
Пример #5
0
        public static Aspect GetAspect(
            Type type                                      = null,
            AspectScope scope                              = (AspectScope)0,
            AspectActivation activation                    = (AspectActivation)0,
            IAspectConstruction construction               = null,
            ICrosscutting crosscutting                     = null,
            IEnumerable <Advice> advices                   = null,
            IEnumerable <MemberImport> imports             = null,
            IEnumerable <MemberIntroduction> introductions = null)
        {
            type          = type ?? typeof(UnspecifiedAspect);
            scope         = GetAspectScope(scope);
            activation    = GetAspectActivation(activation);
            construction  = construction ?? GetConstruction();
            crosscutting  = crosscutting ?? GetCrosscutting();
            advices       = advices ?? GetMultiple(() => GetAdvice());
            imports       = imports ?? new MemberImport[0];
            introductions = introductions ?? new MemberIntroduction[0];

            return(new Aspect(type, scope, activation, construction, crosscutting, advices, imports, introductions));
        }
 protected MethodInterceptionAttributeBase(AspectScope scope, string role = StandardRoles.Unspecified)
     : base(scope, role)
 {
 }
Пример #7
0
 public AspectScopeAttribute(AspectScope scope)
 {
     Scope = scope;
 }