I have written a control that does some base functionality. I then wrote a
control that inherits from it so that I can make several unique versions
which behave differently. To do this the inherited control uses generics.
When I compile this code the "Dispose()" routine of my inherited class
generates a compiler error.
TestControl.Jun k2.Dispose(bool ): no suitable method found to override.
Can someone tell me why this is happening and how I can correct it?
Sample code below.
namespace TestControl
{
public partial class Junk2<T: TestControl.Jun kControl
{
T myObject;
public Junk2(T junk)
: base()
{
InitializeCompo nent();
myObject = junk;
}
}
}
namespace TestControl
{
partial class Junk2
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.Componen tModel.IContain er 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.Disp ose();
}
base.Dispose(di sposing);
}
}
--
-----------
Thanks,
Steve
control that inherits from it so that I can make several unique versions
which behave differently. To do this the inherited control uses generics.
When I compile this code the "Dispose()" routine of my inherited class
generates a compiler error.
TestControl.Jun k2.Dispose(bool ): no suitable method found to override.
Can someone tell me why this is happening and how I can correct it?
Sample code below.
namespace TestControl
{
public partial class Junk2<T: TestControl.Jun kControl
{
T myObject;
public Junk2(T junk)
: base()
{
InitializeCompo nent();
myObject = junk;
}
}
}
namespace TestControl
{
partial class Junk2
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.Componen tModel.IContain er 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.Disp ose();
}
base.Dispose(di sposing);
}
}
--
-----------
Thanks,
Steve
Comment