示例#1
0
        /// <summary>
        /// The check statement.
        /// </summary>
        /// <param name="statement">
        /// The statement.
        /// </param>
        /// <param name="level">
        /// The level.
        /// </param>
        public void CheckStatement(Statement statement, CheckLevelEnum level)
        {
            LogicalControlException ex = null;

            foreach (var checkStatement in checkStatements.Where(x => x.Level == level))
            {
                try
                {
                    if (checkStatement.CheckRequired)
                    {
                        checkStatement.CheckObject(statement);
                    }
                }
                catch (LogicalControlException exception)
                {
                    if (ex == null)
                    {
                        ex = exception;
                    }
                    else
                    {
                        ex.AddException(exception);
                    }
                }
            }

            if (ex != null)
            {
                throw ex;
            }
        }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Check"/> class.
 /// </summary>
 /// <param name="level">
 /// The level.
 /// </param>
 /// <param name="sessionFactory">
 /// The session factory.
 /// </param>
 /// <param name="expression">
 /// The expression.
 /// </param>
 protected Check(
     CheckLevelEnum level,
     ISessionFactory sessionFactory,
     Expression <Func <Statement, object> > expression)
     : this(level, sessionFactory)
 {
     Expression = expression;
 }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Check"/> class.
 /// </summary>
 /// <param name="level">
 /// The level.
 /// </param>
 /// <param name="sessionFactory">
 /// The session factory.
 /// </param>
 protected Check(CheckLevelEnum level, ISessionFactory sessionFactory)
 {
     SessionFactory = sessionFactory;
     Level          = level;
 }