private void MoveButtonToolStripMenuItem_Click(object sender, EventArgs e) { LaunchButton lLaunchButton = (LaunchButton)this.mButtonContextMenuStrip.SourceControl; if (this.mLaunchButtonSwitchedFrom == null) { lLaunchButton.FlatStyle = FlatStyle.Popup; this.mLaunchButtonSwitchedFrom = lLaunchButton; this.MoveButtonToolStripMenuItem.Text = Resources.String_MoveButtonHere; } else { try { ButtonCell lButtonCell = this.mLaunchButtonSwitchedFrom.mButtonCell; this.mLaunchButtonSwitchedFrom.ReloadButtonCell(ref lLaunchButton.mButtonCell); lLaunchButton.ReloadButtonCell(ref lButtonCell); this.mLaunchButtonSwitchedFrom.FlatStyle = FlatStyle.Standard; this.mLaunchButtonSwitchedFrom = null; this.MoveButtonToolStripMenuItem.Text = Resources.String_MoveButton; this.mGlobalConfig.SaveAll(); } catch (Exception ex) { MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void ClearButtonToolStripMenuItem_Click(object sender, EventArgs e) { if (MessageBox.Show(Resources.String_ConfirmToClearButton, "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { LaunchButton lLaunchButton = (LaunchButton)this.mButtonContextMenuStrip.SourceControl; try { lLaunchButton.mButtonCell.InitButtonCellData(); lLaunchButton.ReloadButtonCell(ref lLaunchButton.mButtonCell); this.mGlobalConfig.SaveAll(); } catch (Exception ex) { MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void EditButtonToolStripMenuItem_Click(object sender, EventArgs e) { ButtonEditForm lButtonEditForm = new ButtonEditForm(); LaunchButton lLaunchButton = (LaunchButton)this.mButtonContextMenuStrip.SourceControl; this.mEditingButtonCell = lLaunchButton.mButtonCell; if (lButtonEditForm.ShowDialog(this) == DialogResult.OK) { try { lLaunchButton.ReloadButtonCell(ref this.mEditingButtonCell); this.mGlobalConfig.SaveAll(); } catch (Exception ex) { MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error); } } this.mEditingButtonCell = null; }