Cosa vuol dire?
No overload for method 'Object' takes '2' arguments
Io ho definito il costruttore della classe base così:
codice:
protected PaintRectangle(Rectangle r, string title)//title
{
this.Bounds = r;
_title = title;//title
init();
}
Poi ho definito 2 classi derivate:
codice:
public class ImageRectangle
{
string _imgFilepath;
public ImageRectangle(Rectangle r, string Filename, string imgFilepath): base(r,Filename)
{
_imgFilepath = imgFilepath;
init();
}
public class TextRectangle
{
string _text;
public TextRectangle(Rectangle r, string Filename, string text): base(r,Filename)
{
_text = text;
init();
}
}}
Quello che vorrei io è che il metodo base contenga solo rectangle e title mentre quelli derivati abbiano in comune il rectangle e il title, mentre abbiano nel loro costrutto un campo in più, uno per ImageRectangle con il percorso del file e uno, per TextRectangle con una stringa di testo.