Exemplo n.º 1
0
        protected void Validate(Type type)
        {
            this.m_RuleValidation = new System.Workflow.Activities.Rules.RuleValidation(type, null);
            this.m_RuleSet.Validate(this.m_RuleValidation);

            System.Workflow.ComponentModel.Compiler.ValidationErrorCollection errors = this.m_RuleValidation.Errors;
            if (errors.Count > 0)
            {
                throw new Exception("There were Errors in the validation");
            }
        }
Exemplo n.º 2
0
        public static void ExecuteRuleSet(System.Workflow.Activities.Rules.RuleSet ruleSet, object thisObject)
        {
            System.Workflow.Activities.Rules.RuleValidation validation = new System.Workflow.Activities.Rules.RuleValidation(thisObject.GetType(), null);
            ruleSet.Validate(validation);

            System.Workflow.ComponentModel.Compiler.ValidationErrorCollection errors = validation.Errors;
            if (errors.Count > 0)
            {
                System.Windows.MessageBox.Show("There were Errors in the validation");
            }

            System.Workflow.Activities.Rules.RuleExecution execution = new System.Workflow.Activities.Rules.RuleExecution(validation, thisObject);
            ruleSet.Execute(execution);
        }
Exemplo n.º 3
0
        public static void ExecuteRuleSet(System.Workflow.Activities.Rules.RuleSet ruleSet, object thisObject)
        {
            System.Workflow.Activities.Rules.RuleValidation validation = new System.Workflow.Activities.Rules.RuleValidation(thisObject.GetType(), null);
            ruleSet.Validate(validation);

            System.Workflow.ComponentModel.Compiler.ValidationErrorCollection errors = validation.Errors;
            if (errors.Count > 0)
            {
                System.Windows.MessageBox.Show("There were Errors in the validation");
            }

            System.Workflow.Activities.Rules.RuleExecution execution = new System.Workflow.Activities.Rules.RuleExecution(validation, thisObject);
            ruleSet.Execute(execution);
        }
Exemplo n.º 4
0
        protected void Validate(Type type)
        {
            this.m_RuleValidation = new System.Workflow.Activities.Rules.RuleValidation(type, null);
            this.m_RuleSet.Validate(this.m_RuleValidation);

            System.Workflow.ComponentModel.Compiler.ValidationErrorCollection errors = this.m_RuleValidation.Errors;
            if (errors.Count > 0)
            {
                throw new Exception("There were Errors in the validation");
            }
        }