col1 ConsoleField[5];
col1 ConsoleField[5]
{
position = [1,1],
color = red
};
// 第 2、第 4 要素に値を代入します。
col1 ConsoleField[5]
{
this[2] { color = blue },
this[4] { color = blue }
};
this キーワードのもう 1 つの使い方について詳しくは、「this」キーワードを参照してください。
new Menu
{
labelText = "Universe",
MenuItems =
// プロパティー値は動的配列です。
[
new MenuItem
{ name = "Expand",
labelText = "Expand" },
new MenuItem
{ name = "Collapse",
labelText = "Collapse" }
]
}