.NET 4.x Не запускается библиотека: "no suitable method found to override" - C#
Формулировка задачи:
Выдаёт ошибку "'Library_for_lab_2.UserControl1.Dispose(bool)': no suitable method found to override (CS0115)"
Помогите, пожалуйста.
UserControl1.Designer.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Library_for_lab_2
{
public abstract class Product
{
public virtual double Price()
{
return Topaz.Price + Gold.Price + Saphire.Price;
}
public virtual double Volume()
{
return Topaz.Volume + Saphire.Volume;
}
public Topaz Topaz { get; set; }
public Gold Gold { get; set; }
public Saphire Saphire { get; set; }
protected abstract string Type { get; }
public override string ToString()
{
return string.Format("Стоимость: {0}\nКолличество карат: {1}\nТип: {2}\nЗолото: {3}\nТопаз: {4}\nСапфир: {5}\n",
Price(), Volume(), Type, Gold, Topaz, Saphire);
}
}
public abstract class GoldProduct : Product
{
}
public class Rings : GoldProduct
{
protected override string Type
{
get { return "Создание кольца"; }
}
public Diamond Diamond { get; set; }
public override double Price()
{
return base.Price() + Diamond.Price;
}
public override double Volume()
{
return base.Volume() + Diamond.VolumeTime;
}
public override string ToString()
{
return base.ToString() + string.Format("Алмаз для кольца: {0}\n", Diamond);
}
}
public class Earrings : GoldProduct
{
protected override string Type
{
get { return "Создание сережек"; }
}
}
public class Necklace : GoldProduct
{
public Saphire Saphire2 { get; set; }
protected override string Type
{
get { return "Создание ожерелья"; }
}
public override double Price()
{
return base.Price() + Saphire2.Price;
}
public override double Volume()
{
return base.Volume() + Saphire2.Volume;
}
public override string ToString()
{
return base.ToString() + string.Format("Дополнительные сапфиры для ожерелья: {0}\n", Saphire2);
}
}
public class SilverProduct : Product
{
public Silver Silver { get; set; }
protected override string Type
{
get { return "Изделия с серебром"; }
}
public override double Price()
{
return base.Price() + Silver.Price;
}
public override string ToString()
{
return base.ToString() + string.Format("Серебро: {0}\n",
Silver == null ? "Отсуствует" : "Присуствует");
}
}
public class Topaz
{
public double Price { get; set; }
public int Volume { get; set; }
public override string ToString()
{
return string.Format("Вес камня {0} карат", Volume);
}
}
public class Gold
{
public double Price { get; set; }
public double Congestion { get; set; }
public override string ToString()
{
return string.Format("Проба {0} ", Congestion);
}
}
public class Saphire
{
public double Price { get; set; }
public int Volume { get; set; }
public override string ToString()
{
return string.Format("Вес камня {0} карат", Volume);
}
}
public class Silver
{
public double Price { get; set; }
}
public class Diamond
{
public double Price { get; set; }
public int VolumeTime { get; set; }
public override string ToString()
{
return string.Format("Колличество карат {0} ", VolumeTime);
}
}
}namespace Library_for_lab_2
{
partial class UserControl1
{
/// <summary>
/// Designer variable used to keep track of non-visual components.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Disposes resources used by the form.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing) {
if (components != null) {
components.Dispose();
}
}
base.Dispose(disposing);
}
/// <summary>
/// This method is required for Windows Forms designer support.
/// Do not change the method contents inside the source code editor. The Forms designer might
/// not be able to load this method if it was changed manually.
/// </summary>
private void InitializeComponent()
{
//
// UserControl1
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Name = "UserControl1";
}
}
}Решение задачи: «.NET 4.x Не запускается библиотека: "no suitable method found to override"»
textual
Листинг программы
using System.Windows.Forms;