public override RuleAction Clone()
        {
            RuleStatementAction newAction = (RuleStatementAction)this.MemberwiseClone();

            newAction.codeDomStatement = CodeDomStatementWalker.Clone(codeDomStatement);
            return(newAction);
        }
        public override bool Equals(object obj)
        {
#pragma warning disable 56506
            RuleStatementAction other = obj as RuleStatementAction;
            return((other != null) && (CodeDomStatementWalker.Match(CodeDomStatement, other.CodeDomStatement)));

#pragma warning restore 56506
        }
 public override void Execute(RuleExecution context)
 {
     if (codeDomStatement == null)
     {
         throw new InvalidOperationException(Messages.NullStatement);
     }
     CodeDomStatementWalker.Execute(context, codeDomStatement);
 }
        public override ICollection <string> GetSideEffects(RuleValidation validation)
        {
            RuleAnalysis analysis = new RuleAnalysis(validation, true);

            if (codeDomStatement != null)
            {
                CodeDomStatementWalker.AnalyzeUsage(analysis, codeDomStatement);
            }
            return(analysis.GetSymbols());
        }
        public override string ToString()
        {
            if (codeDomStatement == null)
            {
                return("");
            }

            StringBuilder decompilation = new StringBuilder();

            CodeDomStatementWalker.Decompile(decompilation, codeDomStatement);
            return(decompilation.ToString());
        }
        public override bool Validate(RuleValidation validator)
        {
            if (validator == null)
            {
                throw new ArgumentNullException("validator");
            }

            if (codeDomStatement == null)
            {
                ValidationError error = new ValidationError(Messages.NullStatement, ErrorNumbers.Error_ParameterNotSet);
                error.UserData[RuleUserDataKeys.ErrorObject] = this;
                validator.AddError(error);
                return(false);
            }
            else
            {
                return(CodeDomStatementWalker.Validate(validator, codeDomStatement));
            }
        }