コード例 #1
0
ファイル: Program.cs プロジェクト: matrap/patterns
        static void Main(string[] args)
        {
            ReportManager lineManager = new LineManager();
            ReportManager hrManager   = lineManager.SetSuccessor(new HrManager());
            ReportManager director    = hrManager.SetSuccessor(new Director());

            var marek = new Employee(lineManager, "Marek");

            marek.RequestFor("New mobile phone");
        }
コード例 #2
0
 public ReportManager SetSuccessor(ReportManager successor)
 {
     Successor = successor;
     return(successor);
 }
コード例 #3
0
 public Employee(ReportManager reportManager, string fullName)
 {
     _reportManager = reportManager;
     FullName       = fullName;
 }