Click here to Skip to main content
15,915,754 members
Home / Discussions / C#
   

C#

 
GeneralTEXTBOX Pin
vikramlinux2-Jul-02 3:32
vikramlinux2-Jul-02 3:32 
GeneralRe: TEXTBOX Pin
Chris Rickard2-Jul-02 4:11
Chris Rickard2-Jul-02 4:11 
GeneralRe: TEXTBOX Pin
vikramlinux2-Jul-02 5:48
vikramlinux2-Jul-02 5:48 
GeneralRe: TEXTBOX Pin
Sorin Comanescu3-Jul-02 22:42
Sorin Comanescu3-Jul-02 22:42 
GeneralJoining two DataTables to a CheckListBox control... Pin
Andrew Connell2-Jul-02 3:28
Andrew Connell2-Jul-02 3:28 
GeneralAll treenodes in a treeView Pin
2-Jul-02 1:20
suss2-Jul-02 1:20 
GeneralRe: All treenodes in a treeView Pin
James T. Johnson3-Jul-02 8:58
James T. Johnson3-Jul-02 8:58 
GeneralThe C# using operator Pin
Chris Maunder1-Jul-02 15:47
cofounderChris Maunder1-Jul-02 15:47 
I'm just wondering about the C# using operator and what it means in terms of style.

In C# you can either do:
Font font = new Font("Arial", 10.0f);
// use font
...
font.Dispose(); // free resource
// garbage collector will clean up memory
or
Font font = new Font("Arial", 10.0f);
using (font)
{
    // use font
    ...
}
// compiler automatically calls font.Dispose();
// garbage collector will clean up memory
Has anyone used the using keyword? If so, why? For convenience? Style? For fear that IDisposable may be changed in future releases and using will still work while Dispose may not?

Just curious.

cheers,
Chris Maunder

I spent a minute looking at my own code by accident. I was thinking "What the hell is this guy doing?" - @Logan
GeneralRe: The C# using operator Pin
Andy Smith1-Jul-02 16:03
Andy Smith1-Jul-02 16:03 
GeneralRe: The C# using operator Pin
Rama Krishna Vavilala1-Jul-02 16:05
Rama Krishna Vavilala1-Jul-02 16:05 
GeneralRe: The C# using operator Pin
Chris Maunder1-Jul-02 16:25
cofounderChris Maunder1-Jul-02 16:25 
GeneralRe: The C# using operator Pin
Rama Krishna Vavilala1-Jul-02 16:03
Rama Krishna Vavilala1-Jul-02 16:03 
GeneralRe: The C# using operator Pin
Nish Nishant1-Jul-02 16:08
sitebuilderNish Nishant1-Jul-02 16:08 
GeneralRe: The C# using operator Pin
Andy Smith1-Jul-02 16:12
Andy Smith1-Jul-02 16:12 
GeneralRe: The C# using operator Pin
Nish Nishant1-Jul-02 17:15
sitebuilderNish Nishant1-Jul-02 17:15 
GeneralRe: The C# using operator Pin
Andy Smith1-Jul-02 17:28
Andy Smith1-Jul-02 17:28 
GeneralRe: The C# using operator Pin
Rama Krishna Vavilala1-Jul-02 16:17
Rama Krishna Vavilala1-Jul-02 16:17 
GeneralRe: The C# using operator Pin
James T. Johnson1-Jul-02 17:15
James T. Johnson1-Jul-02 17:15 
GeneralRe: The C# using operator Pin
Rama Krishna Vavilala6-Jul-02 16:06
Rama Krishna Vavilala6-Jul-02 16:06 
GeneralRe: The C# using operator Pin
Andy Smith1-Jul-02 16:15
Andy Smith1-Jul-02 16:15 
GeneralRe: The C# using operator Pin
Rama Krishna Vavilala1-Jul-02 16:25
Rama Krishna Vavilala1-Jul-02 16:25 
GeneralRe: The C# using operator Pin
Andy Smith1-Jul-02 16:29
Andy Smith1-Jul-02 16:29 
GeneralRe: The C# using operator Pin
Rama Krishna Vavilala1-Jul-02 16:32
Rama Krishna Vavilala1-Jul-02 16:32 
GeneralRe: The C# using operator Pin
James T. Johnson1-Jul-02 17:25
James T. Johnson1-Jul-02 17:25 
GeneralRe: The C# using operator Pin
Andy Smith1-Jul-02 17:30
Andy Smith1-Jul-02 17:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.