public static int? ShowDialog(Window owner, int gameIndex)
 {
     SendMailToWindow window = new SendMailToWindow(gameIndex);
     window.Owner = owner;
     var result = window.ShowDialog();
     if (result != null && result.Value) {
         return window.gameIndex;
     }
     return null;
 }
示例#2
0
        public static int?ShowDialog(Window owner, int gameIndex)
        {
            SendMailToWindow window = new SendMailToWindow(gameIndex);

            window.Owner = owner;
            var result = window.ShowDialog();

            if (result != null && result.Value)
            {
                return(window.gameIndex);
            }
            return(null);
        }
示例#3
0
        private void OnMailSendTo(object sender, EventArgs e)
        {
            int?result = SendMailToWindow.ShowDialog(Window.GetWindow(this), mailbox.GameSave.GameIndex);

            if (result != null)
            {
                if (PokeManager.GetGameSaveAt(result.Value).Mailbox.HasRoomForMail)
                {
                    PokeManager.GetGameSaveAt(result.Value).Mailbox.AddMail(selectedMail);
                    mailbox.TossMailAt(selectedIndex);
                }
                else
                {
                    // No room for item
                    TriggerMessageBox.Show(Window.GetWindow(this), "No room for that mail. Mailbox is full", "No Room");
                }
            }
        }