У меня есть блок кода следующим образом, и я использую 3 вложенных блока using.
Я обнаружил, что с помощью блоков try finally я могу избежать этого, но если есть более двух операторов using, то какой лучший подход?
private FileStream fileStream = null;
private Document document = null;
private PdfWriter pdfWriter =  null;
using (fileStream = new FileStream("ABC.pdf", FileMode.Create))
{
    using (document = new Document(PageSize.A4, marginLeft, marginRight, marginTop, marginBottom))
    {
        using (pdfWriter = PdfWriter.GetInstance(document, fileStream))
        {
            document.AddAuthor(metaInformation["author"]);
            document.AddCreator(metaInformation["creator"]);
            document.AddKeywords("Report Generation using I Text");
            document.AddSubject("Document subject");
            document.AddTitle("The document title");
        }
    }
}