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, 1668👍, 0💬
Popular Posts:
How To Export Data to an XML File? - Oracle DBA FAQ - Introduction to Oracle SQL Developer If you wa...
How To Export Your Connection Information to a File? - Oracle DBA FAQ - Introduction to Oracle SQL D...
How can we connect to Microsoft Access , Foxpro , Oracle etc ? Microsoft provides System.Data.OleDb ...
What is the difference between "printf(...)" and "sprintf(...)"? sprintf(...) writes data to the cha...
What will be printed as the result of the operation below: main() { char *p1; char *p2; p1=(char *)m...