Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
I am constantly writing the drawing procedures with System.Drawing.Graphics, but having to use the try and dispose blocks is to
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 Graphics objects. Can I automate this?
✍: Guest
Yes, the code
System.Drawing.Graphics canvas = new System.Drawing.Graphics();
try
{
//some code
}
finally
canvas.Dispose();
is functionally equivalent to
using (System.Drawing.Graphics canvas = new System.Drawing.Graphics())
{
//some code
} //canvas.Dispose() gets called automatically
2013-11-20, 1748👍, 0💬
Popular Posts:
Can one change the mouse pointer in Forms? The SET_APPLICATION_PROPERTY build-in in Oracle Forms all...
What does XmlValidatingReader class do? XmlTextReader class does not validate the contents of an XML...
What is the sequence of UML diagrams in project? First let me say some fact about this question, you...
How To Call a Sub Procedure? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions To...
.NET INTERVIEW QUESTIONS - What is the difference between System exceptions and Application exceptio...