делает приложение для WP7, но натолкнулся на ошибку этого оператора.Похоже на 3-й случай.Дает "не может провалиться из-за ошибки в регистре".Я погуглил эту ошибку, и если я не сконцентрировался должным образом, я уверен, что все настроил правильно.
private void SortFeedData(int fs) { //only using cases 1,2,3 since 0 is for the news page which doesn't need sorting switch (fs) { case 1: //Sort feed data for "Scores" Page switch (ButtonSourceLeague) { case "Premier League": //clears all current feed data App.Data.FeedList.Clear(); //For News Page - BBC Football RSS Feed App.Data.FeedList.Add("http://www.rsslivescores.com/premier-league.aspx"); break; case "Championship": //clears all current feed data App.Data.FeedList.Clear(); //For News Page - Test feed App.Data.FeedList.Add("http://www.rsslivescores.com/engchamp-league.aspx"); break; case "League One": //clears all current feed data App.Data.FeedList.Clear(); //For News Page - BBC Football RSS Feed App.Data.FeedList.Add("http://www.rsslivescores.com/premier-league.aspx"); break; case "League Two": //clears all current feed data App.Data.FeedList.Clear(); //For News Page - BBC Football RSS Feed App.Data.FeedList.Add("http://www.rsslivescores.com/premier-league.aspx"); break; case "FA Cup": //clears all current feed data App.Data.FeedList.Clear(); //For News Page - BBC Football RSS Feed App.Data.FeedList.Add("http://www.rsslivescores.com/fa-cup.aspx"); break; case "League Cup": //clears all current feed data App.Data.FeedList.Clear(); //For News Page - BBC Football RSS Feed App.Data.FeedList.Add("http://www.rsslivescores.com/english-league-cup.aspx"); break; default: MessageBox.Show("Error"); break; } break; case 2: //Sort feed data for "Fixtures" Page switch (ButtonSourceLeague) { case "Premier League": //clears all current feed data App.Data.FeedList.Clear(); //For News Page - BBC Football RSS Feed App.Data.FeedList.Add("http://www.rsslivescores.com/premier-league.aspx"); break; case "Championship": //clears all current feed data App.Data.FeedList.Clear(); //For News Page - Test feed App.Data.FeedList.Add("http://www.rsslivescores.com/RssTestFeed.aspx"); break; case "League One": //clears all current feed data App.Data.FeedList.Clear(); //For News Page - BBC Football RSS Feed App.Data.FeedList.Add("http://www.rsslivescores.com/premier-league.aspx"); break; case "League Two": //clears all current feed data App.Data.FeedList.Clear(); //For News Page - BBC Football RSS Feed App.Data.FeedList.Add("http://www.rsslivescores.com/premier-league.aspx"); break; case "FA Cup": //clears all current feed data App.Data.FeedList.Clear(); //For News Page - BBC Football RSS Feed App.Data.FeedList.Add("http://www.rsslivescores.com/premier-league.aspx"); break; case "League Cup": //clears all current feed data App.Data.FeedList.Clear(); //For News Page - BBC Football RSS Feed App.Data.FeedList.Add("http://www.rsslivescores.com/premier-league.aspx"); break; default: MessageBox.Show("Error"); break; } //Sort feed data for "My Club" Page //Either a big-ass case statment for EVERY club we know off //OR find a SINGLE rss feed that has info on ALL clubs break; case 3: switch (ButtonSourceClub) { case "Manchester United": App.Data.FeedList.Add("rss xml link here"); break; default: MessageBox.Show("Error"); break; } } } }
}
В case 3: у вас нет оператора break вне внутреннего switch. Следовательно, существует неявный переход к следующему утверждению (хотя следующего утверждения нет).
case 3:
break
switch
case 3: switch (ButtonSourceClub) { case "Manchester United": App.Data.FeedList.Add("rss xml link here"); break; default: MessageBox.Show("Error"); break; } break; //Here's what you're missing.
В третьем случае пропущен оператор break:
break; case 3: switch (ButtonSourceClub) { case "Manchester United": App.Data.FeedList.Add("rss xml link here"); break; default: MessageBox.Show("Error"); break; } break; // <---- was missing }