コード例 #1
0
        /*!
         *  \brief Open the ticket comment window to add a comment.
         *
         *  If no lottery number is selected in the list of tickets
         *  an error message is displayed for the end-user and no
         *  further action is taken.
         */
        private void BtnAddComment_Click(object sender, RoutedEventArgs e)
        {
            if (!HasTicketSelected())
            {
                return;
            }

            var commentWindow = new WndTicketComment((Ticket)LwTickets.SelectedItem, true)
            {
                Owner = this
            };

            this.IsEnabled = false;
            commentWindow.ShowDialog();
        }
コード例 #2
0
        //! Show comment for the selected ticket, if any.
        private void BtnShowComment_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(((Ticket)LwTickets.SelectedItem)?.Comment))
            {
                return;
            }

            var commentWindow = new WndTicketComment((Ticket)LwTickets.SelectedItem)
            {
                Owner = this
            };

            this.IsEnabled = false;
            commentWindow.ShowDialog();
        }
コード例 #3
0
ファイル: WndMain.xaml.cs プロジェクト: denDAY04/vplottery
        //! Open the comment window if a winning ticket with a comment is double-clicked.
        private void LwWinningTickets_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var selectedTicket = (Ticket)LwWinningTickets.SelectedItem;

            if (string.IsNullOrEmpty(selectedTicket?.Comment))
            {
                return;
            }
            var commentWindow = new WndTicketComment(selectedTicket)
            {
                Owner = this
            };

            this.IsEnabled = false;
            commentWindow.ShowDialog();
        }