Example #1
0
        private CatchBlock GetCatchBlock(CatchBlockDto obj)
        {
            if (this.catchBlocks.ContainsKey(obj))
            {
                return(this.catchBlocks[obj]);
            }

            var res = Expression.Catch(obj.Test, Visit(obj.Body), Visit(obj.Filter));

            this.catchBlocks.Add(obj, res);
            return(res);
        }
        private CatchBlockDto GetCatchBlock(CatchBlock obj)
        {
            if (this.catchBlocks.ContainsKey(obj))
            {
                return(this.catchBlocks[obj]);
            }

            var res = new CatchBlockDto
            {
                Body     = Visit(obj.Body),
                Filter   = Visit(obj.Filter),
                Test     = obj.Test,
                Variable = Visit((Expression)obj.Variable) as ParameterExpressionDto
            };

            this.catchBlocks.Add(obj, res);
            return(res);
        }