コード例 #1
0
        public static IUsingBlockStatement Using(this IBlockStatementParent parent, ILocalDeclarationsStatement resourceAcquisition)
        {
            var usingStatement = new UsingBlockStatement(parent, resourceAcquisition);

            parent.Add(usingStatement);
            return(usingStatement);
        }
コード例 #2
0
        public static IThrowStatement Throw(this IBlockStatementParent parent, IExpression throwTarget)
        {
            var throwStatement = new ThrowStatement(parent, throwTarget);

            parent.Add(throwStatement);
            return(throwStatement);
        }
コード例 #3
0
        public static IUsingExpressionBlockStatement Using(this IBlockStatementParent parent, IExpression resourceAcquisition)
        {
            var usingStatement = new UsingExpressionBlockStatement(parent, resourceAcquisition);

            parent.Add(usingStatement);
            return(usingStatement);
        }
コード例 #4
0
        public static IYieldBreakStatement YieldBreak(this IBlockStatementParent blockParent)
        {
            var yieldResult = new YieldBreakStatement(blockParent);

            blockParent.Add(yieldResult);
            return(yieldResult);
        }
コード例 #5
0
        public static IYieldReturnStatement YieldReturn(this IBlockStatementParent blockParent, IExpression returnValue)
        {
            var yieldResult = new YieldReturnStatement(blockParent, returnValue);

            blockParent.Add(yieldResult);
            return(yieldResult);
        }
コード例 #6
0
        public static ILockStatement Lock(this IBlockStatementParent parent, IExpression monitorLock)
        {
            var lockStatement = new LockStatement(parent, monitorLock);

            parent.Add(lockStatement);
            return(lockStatement);
        }
コード例 #7
0
        public static IUsingBlockStatement Using(this IBlockStatementParent parent, ILocalMember resourceAcquisition, params ILocalMember[] siblings)
        {
            var decl           = resourceAcquisition.GetDeclarationStatement(siblings);
            var usingStatement = new UsingBlockStatement(parent, decl);

            parent.Add(usingStatement);
            return(usingStatement);
        }
コード例 #8
0
        public static ITryStatement TryFinally(this IBlockStatementParent parent)
        {
            var result = new TryStatement(parent);

            result.HasFinally = true;
            parent.Add(result);
            return(result);
        }
コード例 #9
0
        public static ITryStatement TryCatch(this IBlockStatementParent parent, TypedName exceptionType)
        {
            var result = new TryStatement(parent);

            result.Catch(exceptionType);
            parent.Add(result);
            return(result);
        }
コード例 #10
0
        public static ITryStatement TryCatch(this IBlockStatementParent parent)
        {
            var result = new TryStatement(parent);

            result.HasCatchAll = true;
            parent.Add(result);
            return(result);
        }
コード例 #11
0
        public static IExplicitStringLiteralStatement Literal(this IBlockStatementParent block, string literal)
        {
            IExplicitStringLiteralStatement result = new ExplicitStringLiteralStatement(block)
            {
                Literal = literal
            };

            block.Add(result);
            return(result);
        }