自分メモ。
クラスのフィールドをコンストラクト時に配列化したい場合の書き方。
C#はフィールドの初期化時にフィールドを参照できないが、メソッドとして参照してあげる。
class Hoge {
...
private int value1;
private int value2;
private int value3;
private int value4;
private int value5;
private IEnumerator<int> Values()
{
yield return this.value1;
yield return this.value2;
yield return this.value3;
yield return this.value4;
yield return this.value5;
}
}