예제 #1
0
		private bool BeforeCommandExecuted(CommandHandler commandHandler, string[] strings)
		{
			if (_authenticated)
				return true; // already authenticated - execute the command as normal

			// Check to see if the CommandHandler method or property has the SecureCommandHandler attribute on it
			bool isSecureCommandHandler =
				commandHandler.MemberInfo.GetCustomAttributes(typeof (SecureCommandHandlerAttribute), false).Length != 0;
			
			if (!isSecureCommandHandler)
				return true; // not a 'secured' command - execute the command as normal

			if (_commandSecurityPopup == null)
			{
				_commandSecurityPopup = new CommandSecurityPopup(this, commandHandler, strings);
			}
			return false; // prevent the command executing
		}
        private bool BeforeCommandExecuted(CommandHandler commandHandler, string[] strings)
        {
            if (_authenticated)
            {
                return(true);                // already authenticated - execute the command as normal
            }
            // Check to see if the CommandHandler method or property has the SecureCommandHandler attribute on it
            bool isSecureCommandHandler =
                commandHandler.MemberInfo.GetCustomAttributes(typeof(SecureCommandHandlerAttribute), false).Length != 0;

            if (!isSecureCommandHandler)
            {
                return(true);                // not a 'secured' command - execute the command as normal
            }
            if (_commandSecurityPopup == null)
            {
                _commandSecurityPopup = new CommandSecurityPopup(this, commandHandler, strings);
            }
            return(false);            // prevent the command executing
        }
 public void PopupClosed(bool authenticated)
 {
     _commandSecurityPopup = null;
     _authenticated        = authenticated;
 }
예제 #4
0
		public void PopupClosed(bool authenticated)
		{
			_commandSecurityPopup = null;
			_authenticated = authenticated;
		}