Click here to Skip to main content
16,004,507 members
Home / Discussions / C#
   

C#

 
GeneralRe: Displaying Custom Collection Control Contents Pin
mike montagne13-Mar-07 6:38
mike montagne13-Mar-07 6:38 
GeneralRe: Displaying Custom Collection Control Contents Pin
andymo214-Mar-07 10:41
andymo214-Mar-07 10:41 
GeneralRe: Displaying Custom Collection Control Contents Pin
mike montagne14-Mar-07 12:41
mike montagne14-Mar-07 12:41 
Questioncomputing the numeric value of 2 textbox without triggering with a button? (Windows Application) Pin
icesha12-Mar-07 16:13
icesha12-Mar-07 16:13 
AnswerRe: computing the numeric value of 2 textbox without triggering with a button? (Windows Application) Pin
rah_sin12-Mar-07 18:24
professionalrah_sin12-Mar-07 18:24 
GeneralRe: computing the numeric value of 2 textbox without triggering with a button? (Windows Application) Pin
PS@Codeproj12-Mar-07 19:44
PS@Codeproj12-Mar-07 19:44 
GeneralRe: computing the numeric value of 2 textbox without triggering with a button? (Windows Application) Pin
rah_sin12-Mar-07 20:06
professionalrah_sin12-Mar-07 20:06 
QuestionAnomalous behavior implementing the Dispose pattern? Pin
mike montagne12-Mar-07 15:49
mike montagne12-Mar-07 15:49 
I have a class which descends from Control and features a Bitmap property. It is my impression that it is my control's responsibility to call Dispose() on the example f_BitmapField in the commented out call of the following snippet. If I deploy this call (remove the comment instructions), there is no resource issue at run time destruction, but if this control is placed on a parent control, then when I delete the parent control at design time (without first deleting my child control) I get an ambiguous error stating only that a parameter is invalid. A later dialog is sometimes raised which refers to the property, not the field — suggesting that an invalid reference to the property exists. No Finalize method is deployed, and no further dispose processes refer to the field or resources which can be associated with it at disposal.

Can anybody explain this behavior? Is it not theoretically the control's responsibility to call Dispose() on the bitmap field as in the commented lines here?

I am beginning to wonder if the IDE isn't mishandling the proper implementation — forcing me to write the wrong code (omit dispose) so that I get acceptable design time behavior. Run time behavior doesn't seem to be affected. I don't feel comfortable about the required implementation. Maybe someone knows there is a different, explicit pattern to follow here?

protected override void Dispose( bool disposing )
     {
     if ( disposing )
          {
          // Release managed resources.

          // if ( null != f_BitmapField)
          //     f_BitmapField.Dispose( );
          }

     // Release unmanaged resources.
     // Set large fields to null.

     base.Dispose( disposing );
     }

QuestionQuestion on an error message Pin
JMOdom12-Mar-07 15:36
JMOdom12-Mar-07 15:36 
AnswerRe: Question on an error message Pin
rah_sin12-Mar-07 18:10
professionalrah_sin12-Mar-07 18:10 
QuestionCompressing files to multiple .zip's Pin
Ollie198612-Mar-07 13:16
Ollie198612-Mar-07 13:16 
AnswerRe: Compressing files to multiple .zip's Pin
Ollie198612-Mar-07 21:39
Ollie198612-Mar-07 21:39 
GeneralRe: Compressing files to multiple .zip's Pin
sherifffruitfly13-Mar-07 14:53
sherifffruitfly13-Mar-07 14:53 
QuestionHow to compare struct Pin
LiamD12-Mar-07 12:36
LiamD12-Mar-07 12:36 
AnswerRe: How to compare struct Pin
Dawid Mazuruk12-Mar-07 13:00
Dawid Mazuruk12-Mar-07 13:00 
AnswerRe: How to compare struct Pin
tgrt12-Mar-07 13:30
tgrt12-Mar-07 13:30 
AnswerRe: How to compare struct Pin
mike montagne12-Mar-07 14:22
mike montagne12-Mar-07 14:22 
QuestionDataGrid Selection Pin
mrarunks12-Mar-07 11:57
mrarunks12-Mar-07 11:57 
AnswerRe: DataGrid Selection Pin
Dawid Mazuruk12-Mar-07 12:56
Dawid Mazuruk12-Mar-07 12:56 
QuestionInteger Input Validation Pin
dboy22112-Mar-07 10:00
dboy22112-Mar-07 10:00 
AnswerRe: Integer Input Validation Pin
Ennis Ray Lynch, Jr.12-Mar-07 10:07
Ennis Ray Lynch, Jr.12-Mar-07 10:07 
AnswerRe: Integer Input Validation Pin
Edmundisme12-Mar-07 10:14
Edmundisme12-Mar-07 10:14 
QuestionOS Loader Lock Pin
dsl/fahk12-Mar-07 9:07
dsl/fahk12-Mar-07 9:07 
AnswerRe: OS Loader Lock Pin
Judah Gabriel Himango12-Mar-07 10:21
sponsorJudah Gabriel Himango12-Mar-07 10:21 
GeneralRe: OS Loader Lock Pin
dsl/fahk12-Mar-07 12:24
dsl/fahk12-Mar-07 12:24 

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.