/// <summary> /// upon clicking the save button, store data of the current opened grid. /// Some tabs may have another TabControl in which that Control contains a Grid control. /// </summary> private void BtnSave_Click(object sender, EventArgs ev) { var main = TabControlMain.SelectedTab; switch (((MouseEventArgs)ev).Button) { case MouseButtons.Left: { if (loadAll || ModifierKeys == Keys.Shift) { ForEachPage(TabControlMain, (page, text) => BinaryDataUtil.ExportBinary(page, text)); } else { BinaryDataUtil.ExportBinary(main, main.Text); } if (!loadAll) MessageBox.Show(Resources.CompleteSaveBIN); break; } case MouseButtons.Right: { if (ModifierKeys == Keys.Shift) { ForEachPage(TabControlMain, (page, text) => BinaryDataUtil.ExportPictures(page, text)); } else { BinaryDataUtil.ExportPictures(main, main.Text); } if (!loadAll) MessageBox.Show(Resources.CompleteSaveImages); break; } } }
/// <summary> /// upon clicking the save button, store data of the current opened grid. /// Some tabs may have another TabControl in which that Control contains a Grid control. /// </summary> private void BtnSave_Click(object sender, EventArgs ev) { var main = TabControlMain.SelectedTab; switch (((MouseEventArgs)ev).Button) { case MouseButtons.Left: { if (main.Controls[0] is TabControl tc) { foreach (TabPage page in tc.TabPages) { BinaryDataUtil.ExportBinary(page, main.Text); } } else { BinaryDataUtil.ExportBinary(main, main.Text); } if (!loadAll) { MessageBox.Show(Resources.CompleteSaveBIN); } break; } case MouseButtons.Right: { if (main.Controls[0] is TabControl tc) { foreach (TabPage page in tc.TabPages) { BinaryDataUtil.ExportPictures(page, main.Text); } } else { BinaryDataUtil.ExportPictures(main, main.Text); } if (!loadAll) { MessageBox.Show(Resources.CompleteSaveImages); } break; } } }