void ActionOnExecuted(object sender, ActionBaseEventArgs actionBaseEventArgs) {
            ValidationTargetObjectSelector deleteSelector = new ActionExecuteContextTargetObjectSelector();
            SubscribeSelectorEvents(deleteSelector);
            var selectedObjects = ((SimpleActionExecuteEventArgs) actionBaseEventArgs).SelectedObjects;
            var context = actionBaseEventArgs.Action.Id;

            var deleteContextArgs = new ContextValidatingEventArgs(context, new ArrayList(selectedObjects));
            OnContextValidating(deleteContextArgs);
            Validator.RuleSet.ValidateAll(deleteContextArgs.TargetObjects, context, CustomizeDeleteValidationException);
        }
 void ActionOnExecuted(object sender, ActionBaseEventArgs actionBaseEventArgs) {
     if (View.ObjectTypeInfo.Type != typeof(ValidationResults)) {
         ValidationTargetObjectSelector deleteSelector = new ActionExecuteContextTargetObjectSelector();
         SubscribeSelectorEvents(deleteSelector);
         var selectedObjects = ((SimpleActionExecuteEventArgs)actionBaseEventArgs).SelectedObjects;
         var context = actionBaseEventArgs.Action.Id;
         var contextValidatingEventArgs = new ContextValidatingEventArgs(context, new ArrayList(selectedObjects));
         OnContextValidating(contextValidatingEventArgs);
         if (CanAccessDeletedObjects(context))
             Validator.RuleSet.ValidateAll(contextValidatingEventArgs.TargetObjects, context, CustomizeDeleteValidationException);
     }
 }
Beispiel #3
0
 void ActionOnExecuted(object sender, ActionBaseEventArgs actionBaseEventArgs)
 {
     if (View.ObjectTypeInfo.Type != typeof(ValidationResults))
     {
         ValidationTargetObjectSelector deleteSelector = new ActionExecuteContextTargetObjectSelector();
         SubscribeSelectorEvents(deleteSelector);
         var selectedObjects            = ((SimpleActionExecuteEventArgs)actionBaseEventArgs).SelectedObjects;
         var context                    = actionBaseEventArgs.Action.Id;
         var contextValidatingEventArgs = new ContextValidatingEventArgs(context, new ArrayList(selectedObjects));
         OnContextValidating(contextValidatingEventArgs);
         if (CanAccessDeletedObjects(context))
         {
             Validator.RuleSet.ValidateAll(contextValidatingEventArgs.TargetObjects, context, CustomizeDeleteValidationException);
         }
     }
 }