コード例 #1
0
    // use delegates if you want to pass a method as a parameter to another method, use delegates
    // to make your methods and code reusable, use delegates
    public static void Main()
    {
        List <EmployeeDel> emplist = new List <EmployeeDel>();

        emplist.Add(new EmployeeDel()
        {
            ID         = 100,
            Ename      = "Geetha",
            Experience = 5,
            Salary     = 23000
        });
        emplist.Add(new EmployeeDel()
        {
            ID         = 101,
            Ename      = "Yedida",
            Experience = 2,
            Salary     = 2343242
        });
        emplist.Add(new EmployeeDel()
        {
            ID         = 102,
            Ename      = "Ye",
            Experience = 7,
            Salary     = 23643
        });
        ISPromotable prom = new ISPromotable(promote);

        EmployeeDel.PromoteEmployee(emplist, prom);
    }
コード例 #2
0
 static bool promote(EmployeeDel employ)
 {
     if
     (employ.Experience >= 5)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }