private void handpcbx_DragDrop(object sender, DragEventArgs e) { Handpcbx pbx = sender as Handpcbx; String lastboxType = lastbox.GetType().Name; Card replacement; if (lastboxType.Equals("Handpcbx")) { Handpcbx lastbox2 = lastbox as Handpcbx; replacement = lastbox2.getCard(); lastbox2.setCard(pbx.getCard()); pbx.setCard(replacement); lastbox2.updateImage(); pbx.updateImage(); } else if (lastboxType.Equals("Stagepcbx")) { Stagepcbx lastbox2 = lastbox as Stagepcbx; replacement = lastbox2.getCard(); lastbox2.setCard(pbx.getCard()); pbx.setCard(replacement); lastbox2.updateImage(); pbx.updateImage(); } else { throw new Exception("Not implemented"); } }
private void WR_DragDrop(object sender, DragEventArgs e) { String lastboxType = lastbox.GetType().Name; Card Addition; if (lastboxType.Equals("Handpcbx")) { Handpcbx lastbox2 = lastbox as Handpcbx; Addition = lastbox2.getCard(); lastbox2.setCard(null); currentWR.insertCard(Addition); lastbox2.updateImage(); currentWR.updateImage(); WaitingRm.Image = currentWR.Image; } else if (lastboxType.Equals("Stagepcbx")) { Stagepcbx lastbox2 = lastbox as Stagepcbx; Addition = lastbox2.getCard(); lastbox2.setCard(null); currentWR.insertCard(Addition); lastbox2.updateImage(); currentWR.updateImage(); WaitingRm.Image = currentWR.Image; } else { throw new Exception("Not implemented"); } }