?? bvacationvisitor.cs
字號:
using System;
namespace Visitor
{
/// <summary>
/// Summary description for bVacationVisitor.
/// </summary>
public class bVacationVisitor :Visitor {
private int totalDays;
public bVacationVisitor() {
totalDays = 0;
}
//-----
public override void visit(Employee emp) {
totalDays += emp.getVacDays();
try {
Manager mgr = (Manager)emp;
totalDays += mgr.getBonusDays();
}
catch(Exception ){}
}
//-----
public override void visit(Boss bos) {
totalDays += bos.getVacDays();
totalDays += bos.getBonusDays();
}
//-----
public int getTotalDays() {
return totalDays;
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -