工作到一半緊急地停止,也容易讓資料變得不完全,難以除錯。
但如果真的停不下來怎麼辦?? 設定Retry次數??
while (thread.ThreadState == ThreadState.Running)
{
thread.Join(10);
}
while (thread.ThreadState == ThreadState.Running)
{
thread.Join(10);
}
interface IPerson
{
double Height { get; }
}
Class Person : IPerson
{
public double Height {get; private set;}
}
interface中的屬性不能宣告為private set,否則會出現下列錯誤訊息:"Height.set': accessibility modifiers may not be used on accessors in an interface"
但如果宣告成set,Class的實作interface時,該屬性一定要一併宣告成set,否則會出現下列錯誤:
"Name.set' is not public."