コード例 #1
0
 /// <summary>
 /// Takes a list of characters that have been encapsulated into a GetCharactersForMenuResult object and
 /// pops open a menu from which they can be chosen to interact with.
 /// </summary>
 /// <param name="characterresult">The result of a call to the server for data.</param>
 private static void ProcessCharactersForMenu(GetCharactersForMenuResult characterresult)
 {
     if (characterresult.Success)
     {
         _displayingCharacterMenu = true;
         List <MenuButtonMetadataItem> characters = new List <MenuButtonMetadataItem>();
         foreach (var item in characterresult.Characters)
         {
             characters.Add(new MenuButtonMetadataItem(item.Id, item.Name, "Character"));
         }
         CharacterMenu.SetElements(characters);
         _mainConsole.Children.Add(CharacterMenu);
         _mainConsole.Children.MoveToTop(CharacterMenu);
         string menuTitle = "Manage your character(s)";
         CharacterMenu.ShowMenu(menuTitle);
         int cellX = 0;
         while (cellX < menuTitle.Length)
         {
             cellX++;
             CharacterMenu.SetEffect(cellX, 0, CharacterMenu.menuFade);
         }
     }
     else
     {
         CreateErrorWindow(characterresult.Error, _mainConsole);
     }
 }