M
mehdi_mousavi
Hi folks,
Consider a dialog that is being generated within the visual
environment:
//HERE'S THE DESIGNER-GENERATED CODE...
partial class CustomerDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be
disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
}
Now, consider the file that's being created to be modified by the
developer:
public partial class CustomerDlg : Common.CommonBaseDlg
{
private DataSet myLocalResourceThatNeedsToBeDisposed;
}
The question is that how am I supposed to override the Dispose method,
while the designer-generated code has been doing so before? In other
words, how am I supposed to dispose
myLocalResourceThatNeedsToBeDisposed? Is it safe to move the Dispose
method from the designer-generated code to the main code?
FYI: I'm using VS2005, .NET Framework 2.0.
Any help would be highly appreciated,
Cheers,
Mehdi
Consider a dialog that is being generated within the visual
environment:
//HERE'S THE DESIGNER-GENERATED CODE...
partial class CustomerDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be
disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
}
Now, consider the file that's being created to be modified by the
developer:
public partial class CustomerDlg : Common.CommonBaseDlg
{
private DataSet myLocalResourceThatNeedsToBeDisposed;
}
The question is that how am I supposed to override the Dispose method,
while the designer-generated code has been doing so before? In other
words, how am I supposed to dispose
myLocalResourceThatNeedsToBeDisposed? Is it safe to move the Dispose
method from the designer-generated code to the main code?
FYI: I'm using VS2005, .NET Framework 2.0.
Any help would be highly appreciated,
Cheers,
Mehdi