I am constantly writing the drawing procedures with system.drawing.graphics, but having to use the try and dispose blocks is too time-consuming with graphicsobjects. Can I automate this?



I am constantly writing the drawing procedures with system.drawing.graphics, but having to use the t..

Answer / Anesh Gupta

To avoid repeatedly writing `using` blocks for disposable objects like Graphics, you can create a helper method or class that takes care of the disposal automatically. This way, you'll only need to manage one centralized location for disposing resources instead of doing it everywhere in your code.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Dot Net General Interview Questions

What is operator overloading in .net?

1 Answers  


How to get the hostname or IP address of the server?

2 Answers  


What are use of Cloud computing....?

1 Answers   CTS,


How viewstate is being formed and how it's stored on client in .net?

1 Answers  


How will u load dynamic assembly? How will create assemblies at run time?

1 Answers  


diff between forms authentication and windows authentication?

11 Answers  


Readonly vs. const?

2 Answers   Hewitt,


Compare client server application with n-tier application

1 Answers  


what is managed data and managed code?

2 Answers  


How can you manage pagination on a page using .Net?

1 Answers  


How would ASP and ASP.NET apps run at the same time on the same server?

1 Answers  


How boxing and unboxing occures in memory?

1 Answers  


Categories