概要 「デリゲートのイメージがつかめない」って人が思った以上に多いようなので、 利用例をいくつか挙げて、図示してみることに。 一言でいうと、「何か処理を外から挿す」というのがデリゲートの役割。 述語: 条件式を外から挿す 「デリゲート」で書いたことをさらりともう一度。 特定の条件を満たすものだけを抽出するようなメソッドを書きたいとき、条件式をデリゲートにして引数に渡します。 (こういう、外から与える条件式を述語(predicate)と言ったりします。) 例えば、与えられた条件を満たすものの和を求めるメソッドは以下のように書けます。 static int Sum(int[] a, Predicate<int> pred) { int sum = 0; foreach (int x in a) if (pred(x)) sum += x; return sum; } pred が「外から与える