Click here to Skip to main content
15,892,643 members
Home / Discussions / C#
   

C#

 
GeneralRe: Difference between flush\dispose\close Pin
Sandeep Akhare26-Feb-07 2:56
Sandeep Akhare26-Feb-07 2:56 
GeneralRe: Difference between flush\dispose\close Pin
sharpiesharpie26-Feb-07 3:02
sharpiesharpie26-Feb-07 3:02 
GeneralRe: Difference between flush\dispose\close Pin
Sandeep Akhare26-Feb-07 3:29
Sandeep Akhare26-Feb-07 3:29 
GeneralRe: Difference between flush\dispose\close Pin
Guffa26-Feb-07 3:57
Guffa26-Feb-07 3:57 
GeneralRe: Difference between flush\dispose\close Pin
Luc Pattyn26-Feb-07 10:15
sitebuilderLuc Pattyn26-Feb-07 10:15 
AnswerRe: Difference between flush\dispose\close Pin
Colin Angus Mackay26-Feb-07 3:46
Colin Angus Mackay26-Feb-07 3:46 
GeneralRe: Difference between flush\dispose\close Pin
Scott Dorman26-Feb-07 4:09
professionalScott Dorman26-Feb-07 4:09 
GeneralRe: Difference between flush\dispose\close Pin
Colin Angus Mackay26-Feb-07 4:30
Colin Angus Mackay26-Feb-07 4:30 
Scott Dorman wrote:
I just double-checed that through Reflector


Ummm... I got my information through reflector.

Dispose calls close on an object of a class called __HandleProtector, not FileStream.

public override void Close()
{
      this.Dispose(true);
      GC.nativeSuppressFinalize(this);
}
 
protected virtual void Dispose(bool disposing)
{
      if (this._handleProtector != null)
      {
            if (!this._handleProtector.IsClosed)
            {
                  this.Flush();
            }
            this._handleProtector.Close();
      }
      this._canRead = false;
      this._canWrite = false;
      this._canSeek = false;
      this._buffer = null;
}
 
public override void Flush()
{
      if (this._handleProtector.IsClosed)
      {
            __Error.FileNotOpen();
      }
      if (this._writePos > 0)
      {
            this.FlushWrite();
      }
      else if ((this._readPos < this._readLen) && this.CanSeek)
      {
            this.FlushRead();
      }
}





GeneralRe: Difference between flush\dispose\close Pin
sharpiesharpie26-Feb-07 4:41
sharpiesharpie26-Feb-07 4:41 
GeneralRe: Difference between flush\dispose\close Pin
Colin Angus Mackay26-Feb-07 4:48
Colin Angus Mackay26-Feb-07 4:48 
GeneralRe: Difference between flush\dispose\close Pin
Scott Dorman26-Feb-07 4:41
professionalScott Dorman26-Feb-07 4:41 
AnswerRe: Difference between flush\dispose\close Pin
Scott Dorman26-Feb-07 4:11
professionalScott Dorman26-Feb-07 4:11 
QuestionDeploying App with Crystal Report (.Net 2005) Pin
Banjo Ayorinde26-Feb-07 1:26
Banjo Ayorinde26-Feb-07 1:26 
QuestionpropertyGrid Pin
mihksoft26-Feb-07 0:21
mihksoft26-Feb-07 0:21 
AnswerRe: propertyGrid Pin
topcatalpha26-Feb-07 0:26
topcatalpha26-Feb-07 0:26 
GeneralRe: propertyGrid Pin
mihksoft26-Feb-07 2:56
mihksoft26-Feb-07 2:56 
GeneralRe: propertyGrid Pin
topcatalpha26-Feb-07 3:06
topcatalpha26-Feb-07 3:06 
GeneralRe: propertyGrid Pin
mihksoft26-Feb-07 3:13
mihksoft26-Feb-07 3:13 
GeneralRe: propertyGrid Pin
topcatalpha26-Feb-07 3:21
topcatalpha26-Feb-07 3:21 
QuestionAssign Datagridview.datasource Pin
topcatalpha26-Feb-07 0:21
topcatalpha26-Feb-07 0:21 
AnswerRe: Assign Datagridview.datasource Pin
topcatalpha24-Apr-07 20:49
topcatalpha24-Apr-07 20:49 
QuestionFocus of another application Pin
MrAndrew26-Feb-07 0:12
MrAndrew26-Feb-07 0:12 
AnswerRe: Focus of another application Pin
topcatalpha26-Feb-07 0:30
topcatalpha26-Feb-07 0:30 
QuestionFocus on Child Form Pin
idreesbadshah25-Feb-07 23:51
idreesbadshah25-Feb-07 23:51 
AnswerRe: Focus on Child Form Pin
Jakub Mller25-Feb-07 23:53
Jakub Mller25-Feb-07 23:53 

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.