Exemplo n.º 1
0
        /// <summary>Handles the MouseDoubleClick event of any WPF DataGrid control containing PlayerStatsRow entries.</summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">
        ///     The <see cref="MouseButtonEventArgs" /> instance containing the event data.
        /// </param>
        /// <returns></returns>
        public static bool AnyPlayerDataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var s = sender as DataGrid;
            if (s != null && s.SelectedCells.Count > 0)
            {
                var psr = (PlayerStatsRow) s.SelectedItems[0];

                var pow = new PlayerOverviewWindow(psr.TeamF, psr.ID);
                pow.ShowDialog();

                return true;
            }
            return false;
        }
Exemplo n.º 2
0
        private void QuickFind(object sender, ExecutedRoutedEventArgs e)
        {
            if (SQLiteIO.IsTSTEmpty())
            {
                return;
            }

            var qfw = new QuickFindWindow();
            if (qfw.ShowDialog() != true)
            {
                return;
            }

            var item = QuickFindWindow.SelectedItem;
            if (item.Type == SearchItem.SelectionType.Team)
            {
                var w = new TeamOverviewWindow(item.ID);
                w.ShowDialog();
            }
            else
            {
                var w = new PlayerOverviewWindow(PST[item.ID].TeamF, item.ID);
                w.ShowDialog();
            }
        }
Exemplo n.º 3
0
        /// <summary>Handles the Click event of the btnPlayerOverview control. Opens the Player Overview window.</summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">
        ///     The <see cref="RoutedEventArgs" /> instance containing the event data.
        /// </param>
        private void btnPlayerOverview_Click(object sender, RoutedEventArgs e)
        {
            if (String.IsNullOrEmpty(CurrentDB))
            {
                return;
            }
            if (SQLiteIO.IsTSTEmpty())
            {
                MessageBox.Show("You need to create a team or import stats before using the Analysis features.");
                return;
            }

            dispatcherTimer_Tick(null, null);
            var pow = new PlayerOverviewWindow();
            pow.ShowDialog();
        }