コード例 #1
0
 private void OnMoveSelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     selectedIndex = listViewMoves.SelectedIndex;
     if (selectedIndex == -1) {
         this.labelMovePower.Content = "";
         this.labelMoveAccuracy.Content = "";
         this.labelMoveCategory.Content = "";
         this.labelMoveAppeal.Content = "";
         this.labelMoveJam.Content = "";
         this.textBlockMoveDescription.Text = "";
         buttonOpenMoveInBulbapedia.Visibility = Visibility.Hidden;
     }
     else {
         Move move = (Move)moves[selectedIndex].Tag;
         this.labelMovePower.Content = (move.MoveData.Power != 0 ? move.MoveData.Power.ToString() : "---");
         this.labelMoveAccuracy.Content = (move.MoveData.Accuracy != 0 ? move.MoveData.Accuracy.ToString() : "---");
         this.labelMoveCategory.Content = move.MoveData.Category.ToString();
         this.labelMoveAppeal.Content = move.MoveData.Appeal;
         this.labelMoveJam.Content = move.MoveData.Jam;
         this.textBlockMoveDescription.Text = (contestMode ? move.MoveData.ContestDescription : move.MoveData.Description);
         currentMoveData = move.MoveData;
         buttonOpenMoveInBulbapedia.Visibility = Visibility.Visible;
     }
 }
コード例 #2
0
        private static void LoadMoves(SQLiteConnection connection)
        {
            SQLiteCommand command;
            SQLiteDataReader reader;
            DataTable table;

            // Load Gen3 Move Data
            command = new SQLiteCommand("SELECT * FROM Moves", connection);
            reader = command.ExecuteReader();
            table = new DataTable("Moves");
            table.Load(reader);
            foreach (DataRow row in table.Rows) {
                MoveData move = new MoveData(row);
                gen3MoveMap.Add(move.ID, move);
                gen3MoveList.Add(move);
            }
        }