Click here to Skip to main content
15,906,341 members
Home / Discussions / C#
   

C#

 
GeneralRe: radiobutton and bool Pin
kabutar23-Oct-07 21:22
kabutar23-Oct-07 21:22 
GeneralRe: radiobutton and bool Pin
N a v a n e e t h23-Oct-07 21:25
N a v a n e e t h23-Oct-07 21:25 
GeneralRe: radiobutton and bool Pin
kabutar23-Oct-07 21:34
kabutar23-Oct-07 21:34 
AnswerRe: radiobutton and bool Pin
Spunky Coder23-Oct-07 20:53
Spunky Coder23-Oct-07 20:53 
QuestionWhat is embossing method? Pin
yohanes.luhur23-Oct-07 20:36
yohanes.luhur23-Oct-07 20:36 
AnswerRe: What is embossing method? Pin
Christian Graus23-Oct-07 21:05
protectorChristian Graus23-Oct-07 21:05 
AnswerRe: What is embossing method? Pin
Pete O'Hanlon23-Oct-07 22:25
mvePete O'Hanlon23-Oct-07 22:25 
QuestionPlz help me to display on Dropdownlist Pin
P_Elza23-Oct-07 20:32
P_Elza23-Oct-07 20:32 
AnswerRe: Plz help me to display on Dropdownlist Pin
Christian Graus23-Oct-07 20:56
protectorChristian Graus23-Oct-07 20:56 
GeneralRe: Plz help me to display on Dropdownlist Pin
P_Elza23-Oct-07 21:16
P_Elza23-Oct-07 21:16 
GeneralRe: Plz help me to display on Dropdownlist Pin
Christian Graus23-Oct-07 21:30
protectorChristian Graus23-Oct-07 21:30 
GeneralRe: Plz help me to display on Dropdownlist Pin
P_Elza23-Oct-07 21:58
P_Elza23-Oct-07 21:58 
GeneralRe: update from combobo to textbox Pin
Christian Graus23-Oct-07 20:12
protectorChristian Graus23-Oct-07 20:12 
GeneralRe: update from combobo to textbox Pin
kabutar23-Oct-07 20:23
kabutar23-Oct-07 20:23 
QuestionRemoving refrences or objects ? Garbage collector Pin
N a v a n e e t h23-Oct-07 20:03
N a v a n e e t h23-Oct-07 20:03 
AnswerRe: Removing refrences or objects ? Garbage collector Pin
Christian Graus23-Oct-07 20:10
protectorChristian Graus23-Oct-07 20:10 
GeneralRe: Removing refrences or objects ? Garbage collector Pin
N a v a n e e t h23-Oct-07 20:14
N a v a n e e t h23-Oct-07 20:14 
GeneralRe: Removing refrences or objects ? Garbage collector Pin
Christian Graus23-Oct-07 20:25
protectorChristian Graus23-Oct-07 20:25 
GeneralRe: Removing refrences or objects ? Garbage collector Pin
N a v a n e e t h23-Oct-07 20:31
N a v a n e e t h23-Oct-07 20:31 
GeneralRe: Removing refrences or objects ? Garbage collector Pin
lmoelleb23-Oct-07 20:45
lmoelleb23-Oct-07 20:45 
GeneralRe: Removing refrences or objects ? Garbage collector Pin
N a v a n e e t h23-Oct-07 20:59
N a v a n e e t h23-Oct-07 20:59 
GeneralRe: Removing refrences or objects ? Garbage collector Pin
lmoelleb23-Oct-07 21:17
lmoelleb23-Oct-07 21:17 
Sorry I wasn't clear enough. With "it" I was referring to "whatever code cleans up the object", not specifically the Dispose method. I can see this was not clear the way I wrote it.

To avoid confusing statements I'll just include the standard dispose pattern here.

From memory, typing streight into the editor - syntax errors to be expected, but the pattern should be more or less correct.

<br />
class Whatever : IDisposable<br />
{<br />
  ~Whatever<br />
  {<br />
    // this is NOT calling Dispose as per MSDN instructions,<br />
    // but an overload of Dispose that could<br />
    // as well have been named something else (naming it<br />
    // Dispose(bool) is that standard though, so it would be confusing<br />
    // to deviate from it).<br />
    Dispose(false); <br />
  }<br />
<br />
  public void Dispose()<br />
  {<br />
    Dispose(true);<br />
  }<br />
<br />
  private void Dispose(bool disposing)<br />
  {<br />
    // TODO: Release any unmanaged references here (so no matter if<br />
    // it is a Dispose or finalizer call.<br />
    if (disposing)<br />
    {<br />
      // This is only executed when Dispose is called, not when called<br />
      // though the finalizer.<br />
<br />
      // TODO: Dispose referenced managed objects here if any of them<br />
      // implements IDisposable. Never ever try to release them from<br />
      // the finalizer call - they might already have been released.<br />
<br />
      // Tell the Garbage Collector it no longer need to finalize this, if<br />
      // this isn't done, the object will end up being promoted a generation<br />
      // before being released.<br />
      GC.SuppressFinalize(this)<br />
    }<br />
  }<br />
}<br />

GeneralRe: Removing refrences or objects ? Garbage collector Pin
N a v a n e e t h23-Oct-07 21:21
N a v a n e e t h23-Oct-07 21:21 
GeneralRe: Removing refrences or objects ? Garbage collector Pin
lmoelleb23-Oct-07 21:27
lmoelleb23-Oct-07 21:27 
GeneralRe: Removing refrences or objects ? Garbage collector Pin
N a v a n e e t h23-Oct-07 21:32
N a v a n e e t h23-Oct-07 21:32 

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.