I know I have a fundamental problem, I do not fully understand List objects.
Based on a user input from a list box I want to creat a different list named icons
.
I previously had issues with the switch
function, seemed I was doing it at the class level, so I am trying to put it in the following method. The error I get is a local variable named "icons" is already defined in this scope.
I tried creating the list object outside the method, and I'm either not getting the syntax correct to assign within the switch or I am barking up the wrong tree.
Thanks in advanced for putting up with my remedial C#
!!
string board = "1";
private void SelectBoard()
{
// Each of these letters is an interesting icon
// in the Webdings font,
// and each icon appears twice in this list
switch (board)
{
case "1":
List<string> icons = new List<string>()
{
"!", "!", "N", "N", ",", ",", "k", "k",
"b", "b", "v", "v", "w", "w", "z", "z"
};
break;
case "2":
List<string> icons = new List<string>()
{
//another list of 8*2 char
};
break;
case "3":
List<string> icons = new List<string>()
{
//another list of 8*2 char
};
break;
case "4":
List<string> icons = new List<string>()
{
//another list of 8*2 char
};
break;
case "5":
List<string> icons = new List<string>()
{
//another list of 8*2 char
};
break;
case "6":
List<string> icons = new List<string>()
{
//another list of 8*2 char
};
break;
}
}