private void OnMoveListViewItem(MailboxEventArgs e) { if (MoveListViewItem != null) { MoveListViewItem(this, e); } }
private void OnUpdateListViewItem(MailboxEventArgs e) { if (UpdateListViewItem != null) { UpdateListViewItem(this, e); } }
private void OnAddListViewItem(MailboxEventArgs e) { if (AddListViewItem != null) { AddListViewItem(this, e); } }
public void TossMailAt(int index, bool party = false) { gameSave.IsChanged = true; boxMail.RemoveAt(index); MailboxEventArgs args = new MailboxEventArgs(); args.Index = index; OnRemoveListViewItem(args); }
public void RepopulateListView() { listViewItems.Clear(); for (int i = 0; i < boxMail.Count; i++) { MailboxEventArgs args = new MailboxEventArgs(); args.Index = i; args.Mail = boxMail[i]; OnAddListViewItem(args); } }
public void MoveMail(int oldIndex, int newIndex, bool party = false) { gameSave.IsChanged = true; Mail mail = boxMail[oldIndex]; boxMail.RemoveAt(oldIndex); boxMail.Insert(newIndex, mail); MailboxEventArgs args = new MailboxEventArgs(); args.OldIndex = oldIndex; args.NewIndex = newIndex; OnMoveListViewItem(args); }
public void AddMail(Mail mail, bool party = false) { if (party) { if (partyMail.Count < 6) { gameSave.IsChanged = true; partyMail.Add(mail); mail.Mailbox = this; } } else if (boxMail.Count < (int)mailboxSize || mailboxSize == 0) { gameSave.IsChanged = true; boxMail.Add(mail); mail.Mailbox = this; MailboxEventArgs args = new MailboxEventArgs(); args.Index = boxMail.Count - 1; args.Mail = mail; OnAddListViewItem(args); } }
private void OnAddListViewItem(object sender, MailboxEventArgs e) { ListViewItem listViewItem = new ListViewItem(); listViewItem.SnapsToDevicePixels = true; listViewItem.UseLayoutRounding = true; DockPanel dockPanel = new DockPanel(); dockPanel.Width = 300; Image image = new Image(); image.Source = ItemDatabase.GetItemImageFromID(e.Mail.MailItemID); image.Stretch = Stretch.None; image.SnapsToDevicePixels = true; image.UseLayoutRounding = true; TextBlock fromName = new TextBlock(); fromName.VerticalAlignment = VerticalAlignment.Center; fromName.Text = "From " + e.Mail.TrainerName; fromName.TextTrimming = TextTrimming.CharacterEllipsis; fromName.Margin = new Thickness(4, 0, 0, 0); /*TextBlock blockLv = new TextBlock(); blockLv.VerticalAlignment = VerticalAlignment.Center; blockLv.HorizontalAlignment = HorizontalAlignment.Right; blockLv.TextAlignment = TextAlignment.Right; blockLv.Text = "Lv"; blockLv.Width = Double.NaN; blockLv.MinWidth = 10; TextBlock blockLevel = new TextBlock(); blockLevel.VerticalAlignment = VerticalAlignment.Center; blockLevel.HorizontalAlignment = HorizontalAlignment.Right; blockLevel.TextAlignment = TextAlignment.Right; blockLevel.Width = 30; blockLevel.Text = e.Pokeblock.Level.ToString();*/ listViewItem.Content = dockPanel; mailbox.ListViewItems.Insert(e.Index, listViewItem); dockPanel.Children.Add(image); dockPanel.Children.Add(fromName); //dockPanel.Children.Add(blockLevel); //dockPanel.Children.Add(blockLv); ContextMenu contextMenu = new ContextMenu(); MenuItem menuPokeblockSendTo = new MenuItem(); menuPokeblockSendTo.Header = "Send To"; menuPokeblockSendTo.Click += OnMailSendTo; contextMenu.Items.Add(menuPokeblockSendTo); MenuItem menuPokeblockToss = new MenuItem(); menuPokeblockToss.Header = "Return to Inventory"; menuPokeblockToss.Click += OnMailReturnToInventory; contextMenu.Items.Add(menuPokeblockToss); listViewItem.ContextMenu = contextMenu; //DockPanel.SetDock(image, Dock.Left); //DockPanel.SetDock(blockLevel, Dock.Right); UpdateDetails(); }
private void OnUpdateListViewItem(MailboxEventArgs e) { if (UpdateListViewItem != null) { UpdateListViewItem(this, e); } }
private void OnRemoveListViewItem(MailboxEventArgs e) { if (RemoveListViewItem != null) { RemoveListViewItem(this, e); } }
private void OnAddListViewItem(MailboxEventArgs e) { if (AddListViewItem != null) { AddListViewItem(this, e); } }
public void TossMailAt(int index, bool party = false) { gameSave.IsChanged = true; boxMail.RemoveAt(index); MailboxEventArgs args = new MailboxEventArgs(); args.Index = index; OnRemoveListViewItem(args); }
public void RepopulateListView() { listViewItems.Clear(); for (int i = 0; i < boxMail.Count; i++) { MailboxEventArgs args = new MailboxEventArgs(); args.Index = i; args.Mail = boxMail[i]; OnAddListViewItem(args); } }
public void AddMail(Mail mail, bool party = false) { if (party) { if (partyMail.Count < 6) { gameSave.IsChanged = true; partyMail.Add(mail); mail.Mailbox = this; } } else if (boxMail.Count < (int)mailboxSize || mailboxSize == 0) { gameSave.IsChanged = true; boxMail.Add(mail); mail.Mailbox = this; MailboxEventArgs args = new MailboxEventArgs(); args.Index = boxMail.Count - 1; args.Mail = mail; OnAddListViewItem(args); } }
private void OnMoveListViewItem(object sender, MailboxEventArgs e) { mailbox.ListViewItems.Move(e.OldIndex, e.NewIndex); }
private void OnRemoveListViewItem(object sender, MailboxEventArgs e) { if (selectedIndex >= mailbox.MailboxCount) { if (mailbox.MailboxCount == 0) { selectedIndex = -1; listViewItems.SelectedIndex = selectedIndex; } else { selectedIndex--; listViewItems.SelectedIndex = selectedIndex; } } mailbox.ListViewItems.RemoveAt(e.Index); if (selectedIndex > mailbox.MailboxCount) { listViewItems.SelectedIndex = selectedIndex; } UpdateDetails(); }
public void MoveMail(int oldIndex, int newIndex, bool party = false) { gameSave.IsChanged = true; Mail mail = boxMail[oldIndex]; boxMail.RemoveAt(oldIndex); boxMail.Insert(newIndex, mail); MailboxEventArgs args = new MailboxEventArgs(); args.OldIndex = oldIndex; args.NewIndex = newIndex; OnMoveListViewItem(args); }