Click here to Skip to main content
15,901,853 members
Home / Discussions / C#
   

C#

 
QuestionMDI - Kinda... [modified] Pin
#realJSOP21-Nov-08 0:26
professional#realJSOP21-Nov-08 0:26 
AnswerRe: MDI - Kinda... Pin
Luc Pattyn21-Nov-08 2:52
sitebuilderLuc Pattyn21-Nov-08 2:52 
AnswerRe: MDI - Kinda... Pin
Mycroft Holmes21-Nov-08 13:49
professionalMycroft Holmes21-Nov-08 13:49 
AnswerRe: MDI - Kinda... Pin
Scott Dorman22-Nov-08 2:40
professionalScott Dorman22-Nov-08 2:40 
QuestionOpen Excel with C#.NET Pin
chirag.3g20-Nov-08 23:31
chirag.3g20-Nov-08 23:31 
AnswerRe: Open Excel with C#.NET Pin
Giorgi Dalakishvili20-Nov-08 23:59
mentorGiorgi Dalakishvili20-Nov-08 23:59 
Questionreports: 'Format' style of textbox item Pin
klok_@20-Nov-08 23:00
klok_@20-Nov-08 23:00 
QuestionDispose() Pin
Member 78161020-Nov-08 22:52
Member 78161020-Nov-08 22:52 
Hi,

Plz go thro the snippet below.


class C : IDisposable
        {
            double d;
            public C()
            {
                d = 1.999;
            }
            public void UseLimitedResource()
            {
                Console.WriteLine("Using limited resource...");
            }

            void IDisposable.Dispose()
            {
                Console.WriteLine("Disposing limited resource.");
            }

            public void getvalue()
            {
                Console.WriteLine(d.ToString());
            }
        }

class DeployResource
{
        static void Main(string[] args)
        {
            C c;
            using (c = new C())
            {
                c.UseLimitedResource();
           
            }
            c.getvalue();

            Console.WriteLine("Now Outside using statement.");
}

Output :

Using limited resource...
Disposing limited resource.
1.999
Now Outside using statement.

Now my question is does an object be called even after it is disposed ? i.e. after calling the dispose still i'm able to get the value 1.999.

Can any one explain clearly ? Blush | :O

Thanx Wink | ;)

Long Live

AnswerRe: Dispose() Pin
JoeSharp20-Nov-08 23:03
JoeSharp20-Nov-08 23:03 
GeneralRe: Dispose() Pin
Scott Dorman22-Nov-08 2:47
professionalScott Dorman22-Nov-08 2:47 
AnswerRe: Dispose() [modified] Pin
Thomas Weller20-Nov-08 23:18
Thomas Weller20-Nov-08 23:18 
GeneralRe: Dispose() Pin
Mirko198021-Nov-08 0:26
Mirko198021-Nov-08 0:26 
GeneralRe: Dispose() Pin
Le centriste21-Nov-08 6:38
Le centriste21-Nov-08 6:38 
GeneralRe: Dispose() Pin
Scott Dorman22-Nov-08 2:42
professionalScott Dorman22-Nov-08 2:42 
AnswerRe: Dispose() Pin
Guffa21-Nov-08 5:32
Guffa21-Nov-08 5:32 
AnswerRe: Dispose() Pin
Scott Dorman22-Nov-08 2:45
professionalScott Dorman22-Nov-08 2:45 
QuestionCrystal report error.......?? Pin
Hum Dum20-Nov-08 20:03
Hum Dum20-Nov-08 20:03 
QuestionForm (8 UserControl + 1 StatusStrip + 1 ToolStrip): error? where? it works!!! Pin
nelsonpaixao20-Nov-08 13:27
nelsonpaixao20-Nov-08 13:27 
AnswerRe: Form (8 UserControl + 1 StatusStrip + 1 ToolStrip): error? where? it works!!! Pin
Christian Graus20-Nov-08 13:39
protectorChristian Graus20-Nov-08 13:39 
GeneralRe: Form (8 UserControl + 1 StatusStrip + 1 ToolStrip): error? where? it works!!! Pin
nelsonpaixao20-Nov-08 13:56
nelsonpaixao20-Nov-08 13:56 
GeneralRe: Form (8 UserControl + 1 StatusStrip + 1 ToolStrip): error? where? it works!!! Pin
Christian Graus20-Nov-08 15:12
protectorChristian Graus20-Nov-08 15:12 
GeneralRe: Form (8 UserControl + 1 StatusStrip + 1 ToolStrip): error? where? it works!!! Pin
Luc Pattyn21-Nov-08 2:59
sitebuilderLuc Pattyn21-Nov-08 2:59 
GeneralRe: Form (8 UserControl + 1 StatusStrip + 1 ToolStrip): error? where? it works!!! Pin
nelsonpaixao21-Nov-08 13:39
nelsonpaixao21-Nov-08 13:39 
QuestionSQLMetal Usage Pin
altctrlnick20-Nov-08 12:33
altctrlnick20-Nov-08 12:33 
AnswerRe: SQLMetal Usage Pin
Mirko198020-Nov-08 21:33
Mirko198020-Nov-08 21:33 

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.