Exemplo n.º 1
0
        /// <summary> Performs a shallow copy of a pre-initialized BRE, i.e. returns a new BRE
        /// containing a shallow copied rule context, ready to fire!
        /// </summary>
        public object Clone()
        {
            if (!initialized)
            {
                throw new BREException("Clone in not available if BRE is not initialized.");
            }

            BREImpl newBRE = new BREImpl();

            // pass the handlers
            newBRE.LogHandlers       += GetLogHandlers();
            newBRE.ExceptionHandlers += GetExceptionHandlers();
            newBRE.ResultHandlers    += GetResultHandlers();

            // pass a cloned context
            newBRE.RuleContext = (IBRERuleContext)ruleContext.Clone();

            // pass the loaded rule
            newBRE.Init(xmlDocument);

            return(newBRE);
        }
Exemplo n.º 2
0
        /// <summary> Performs a shallow copy of a pre-initialized BRE, i.e. returns a new BRE
        /// containing a shallow copied rule context, ready to fire!
        /// </summary>
        public object Clone()
        {
            if (!initialized)
                throw new BREException("Clone in not available if BRE is not initialized.");

            BREImpl newBRE = new BREImpl();

            // pass the handlers
            newBRE.LogHandlers += GetLogHandlers();
            newBRE.ExceptionHandlers += GetExceptionHandlers();
            newBRE.ResultHandlers += GetResultHandlers();

            // pass a cloned context
            newBRE.RuleContext = (IBRERuleContext)ruleContext.Clone();

            // pass the loaded rule
            newBRE.Init(xmlDocument);

            return newBRE;
        }