G
Guest
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.Junk2.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.JunkControl
{
T myObject;
public Junk2(T junk)
: base()
{
InitializeComponent();
myObject = junk;
}
}
}
namespace TestControl
{
partial class Junk2
{
/// <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);
}
}
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.Junk2.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.JunkControl
{
T myObject;
public Junk2(T junk)
: base()
{
InitializeComponent();
myObject = junk;
}
}
}
namespace TestControl
{
partial class Junk2
{
/// <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);
}
}