即時得到一個錯誤在我的C#代碼,我無法弄清楚,爲什麼錯誤擴展Shape類
namespace Memory
{
class Meme : Shape
{
public int used { get; set; }
public string name { get; set; }
protected override Geometry DefiningGeometry => throw new NotImplementedException();
}
}
錯誤即時得到的是:
System.NotImplementedException:「方法或操作未實現。'
代碼創建實例:
options.Add(new Meme()
{
name = option,
used = 0,
Width = 50,
Height = 50,
Fill = Brushes.Red
});
您是否在代碼中看到'throw new NotImplementedException()'行? –
你的DefiningGeometry引發了這個異常。仔細閱讀代碼。 – Harsh
所以即時通訊非常新,但它通過添加該行自動完成我的課程, –