public static IUsingBlockStatement Using(this IBlockStatementParent parent, ILocalDeclarationsStatement resourceAcquisition) { var usingStatement = new UsingBlockStatement(parent, resourceAcquisition); parent.Add(usingStatement); return(usingStatement); }
public static IThrowStatement Throw(this IBlockStatementParent parent, IExpression throwTarget) { var throwStatement = new ThrowStatement(parent, throwTarget); parent.Add(throwStatement); return(throwStatement); }
public static IUsingExpressionBlockStatement Using(this IBlockStatementParent parent, IExpression resourceAcquisition) { var usingStatement = new UsingExpressionBlockStatement(parent, resourceAcquisition); parent.Add(usingStatement); return(usingStatement); }
public static IYieldBreakStatement YieldBreak(this IBlockStatementParent blockParent) { var yieldResult = new YieldBreakStatement(blockParent); blockParent.Add(yieldResult); return(yieldResult); }
public static IYieldReturnStatement YieldReturn(this IBlockStatementParent blockParent, IExpression returnValue) { var yieldResult = new YieldReturnStatement(blockParent, returnValue); blockParent.Add(yieldResult); return(yieldResult); }
public static ILockStatement Lock(this IBlockStatementParent parent, IExpression monitorLock) { var lockStatement = new LockStatement(parent, monitorLock); parent.Add(lockStatement); return(lockStatement); }
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); }
public static ITryStatement TryFinally(this IBlockStatementParent parent) { var result = new TryStatement(parent); result.HasFinally = true; parent.Add(result); return(result); }
public static ITryStatement TryCatch(this IBlockStatementParent parent, TypedName exceptionType) { var result = new TryStatement(parent); result.Catch(exceptionType); parent.Add(result); return(result); }
public static ITryStatement TryCatch(this IBlockStatementParent parent) { var result = new TryStatement(parent); result.HasCatchAll = true; parent.Add(result); return(result); }
public static IExplicitStringLiteralStatement Literal(this IBlockStatementParent block, string literal) { IExplicitStringLiteralStatement result = new ExplicitStringLiteralStatement(block) { Literal = literal }; block.Add(result); return(result); }