private void switchPrevbaseSize(object sender, EventArgs e) { foreach (ToolStripMenuItem item in prevbaseSize.DropDownItems) { item.Checked = (item == sender); } if (sender == prevbaseOriginalSizeToolStripMenuItem) { portraitViewer1.prevbaseResizeTo = null; } else if (sender == x128ToolStripMenuItem) { portraitViewer1.prevbaseResizeTo = new Size(128, 128); } else if (sender == x96ToolStripMenuItem) { portraitViewer1.prevbaseResizeTo = new Size(96, 96); } else if (sender == x88ToolStripMenuItem) { portraitViewer1.prevbaseResizeTo = new Size(88, 88); } else if (sender == customPrevbaseSizeToolStripMenuItem) { EnterSizeDialog dialog = new EnterSizeDialog(); dialog.SizeEntry = portraitViewer1.prevbaseResizeTo ?? new Size(128, 128); if (dialog.ShowDialog() == DialogResult.OK) { portraitViewer1.prevbaseResizeTo = dialog.SizeEntry; } } }
private void resizeAllPrevbasesToolStripMenuItem_Click(object sender, EventArgs e) { var dialog = new EnterSizeDialog() { SizeEntry = portraitViewer1.prevbaseResizeTo ?? new Size(176, 176) }; if (dialog.ShowDialog() == DialogResult.OK) { portraitViewer1.ResizeAllPrevbases(dialog.SizeEntry); } }