public static IUsingBlockStatement Using(this IBlockStatementParent parent, ILocalDeclarationsStatement resourceAcquisition) { var usingStatement = new UsingBlockStatement(parent, resourceAcquisition); parent.Add(usingStatement); return(usingStatement); }
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); }