Example #1
0
        /// <summary>
        /// Executes decorator
        /// </summary>
        /// <param name="context">Specify the service call context object.</param>
        /// <param name="case"></param>
        /// <param name="localDecorators">Specify decorators of the contract.</param>
        public void Execute(ServiceCallContext context, InvocationCase @case, IEnumerable <DecoratorAttribute> localDecorators)
        {
            switch (@case)
            {
            case InvocationCase.Before:
                /*Invoke first global decorators and then local decorators*/
                if (GlobalDecorators != null && GlobalDecorators.Count > 0)
                {
                    BeforeInvoce(context, GlobalDecorators);
                }
                if (localDecorators != null)
                {
                    BeforeInvoce(context, localDecorators);
                }
                break;

            case InvocationCase.After:
                /*Invoke first global decorators and then local decorators*/
                if (GlobalDecorators != null && GlobalDecorators.Count > 0)
                {
                    AfterInvoke(context, GlobalDecorators);
                }
                if (localDecorators != null)
                {
                    AfterInvoke(context, localDecorators);
                }
                break;
            }
        }
 private void InvokeDecorator(ServiceCallContext context, InvocationCase @case, IEnumerable <DecoratorAttribute> localDecorators)
 {
     DecoratorManager.Execute(context, @case, localDecorators);
 }