public override void OnCommandExecuting(ICommandExecutingContext commandContext)
        {
            var session = commandContext.Session as MyAppSession;

            //If the session is not logged in, cancel the executing of the command
            if (!session.IsLoggedIn)
                commandContext.Cancel = true;
        }
Пример #2
0
        public override void OnCommandExecuting(ICommandExecutingContext commandContext)
        {
            var session = commandContext.Session as MyAppSession;

            //If the session is not logged in, cancel the executing of the command
            if (!session.IsLoggedIn)
            {
                commandContext.Cancel = true;
            }
        }
Пример #3
0
        public override void OnCommandExecuted(ICommandExecutingContext commandContext)
        {
            var session   = commandContext.Session;
            var startTime = session.Items.GetValue <DateTime>("StartTime");
            var ts        = DateTime.Now.Subtract(startTime);

            if (ts.TotalSeconds > 5 && session.Logger.IsInfoEnabled)
            {
                session.Logger.InfoFormat("A command '{0}' took {1} seconds!", commandContext.CurrentCommand.Name, ts.ToString());
            }
        }
Пример #4
0
        public override void OnCommandExecuted(ICommandExecutingContext commandContext)
        {
            var session = commandContext.Session;
            var startTime = session.Items.GetValue<DateTime>("StartTime");
            var ts = DateTime.Now.Subtract(startTime);

            if (ts.TotalSeconds > 5 && session.Logger.IsInfoEnabled)
            {
                session.Logger.InfoFormat("A command '{0}' took {1} seconds!", commandContext.CurrentCommand.Name, ts.ToString());
            }
        }
Пример #5
0
 public override void OnCommandExecuted(ICommandExecutingContext commandContext)
 {
     Interlocked.Increment(ref m_Total);
 }
Пример #6
0
        public override void OnCommandExecuting(ICommandExecutingContext commandContext)
        {

        }
Пример #7
0
 public override void OnCommandExecuting(ICommandExecutingContext commandContext)
 {
     commandContext.Session.Items["StartTime"] = DateTime.Now;
 }
 /// <summary>
 /// Called when [command executed].
 /// </summary>
 /// <param name="commandContext">The command context.</param>
 public abstract void OnCommandExecuted(ICommandExecutingContext commandContext);
Пример #9
0
 public override void OnCommandExecuting(ICommandExecutingContext commandContext)
 {
     commandContext.Session.Items["StartTime"] = DateTime.Now;
 }
Пример #10
0
 public override void OnCommandExecuted(ICommandExecutingContext commandContext)
 {
     Interlocked.Increment(ref m_Total);
 }
Пример #11
0
 public override void OnCommandExecuting(ICommandExecutingContext commandContext)
 {
 }
Пример #12
0
 /// <summary>
 /// Called when [command executed].
 /// </summary>
 /// <param name="commandContext">The command context.</param>
 public abstract void OnCommandExecuted(ICommandExecutingContext commandContext);