示例#1
0
        public void Execute(C context)
        {
            var currentPrincipal = Thread.CurrentPrincipal;

            try {
                Thread.CurrentPrincipal = PrincipalProvider.Provide(context);
                UnderlyingOperation.Execute(context);
            } finally {
                Thread.CurrentPrincipal = currentPrincipal;
            }
        }
示例#2
0
        public void Execute(C context)
        {
            IDictionary contextDict = context as IDictionary;

            if (contextDict == null && context != null)
            {
                ITypeConverter conv = ConvertManager.FindConverter(context.GetType(), typeof(IDictionary));
                if (conv != null)
                {
                    contextDict = conv.Convert(context, typeof(IDictionary)) as IDictionary;
                }
            }
            if (contextDict == null)
            {
                contextDict = new Hashtable();
                contextDict[DefaultContextKey] = context;
            }
            UnderlyingOperation.Execute(contextDict);
        }
示例#3
0
 public void Execute(C context)
 {
     if (Begin != null)
     {
         Begin.Execute(context);
     }
     try {
         UnderlyingOperation.Execute(context);
         if (Commit != null)
         {
             Commit.Execute(context);
         }
     } catch (Exception ex) {
         if (Abort != null)
         {
             Abort.Execute(context);
         }
         throw new Exception(ex.Message, ex);
     }
 }