public WindowMove(WindowActionMove action) { InitializeComponent(); this.action = action; textBoxMoveX.Text = action.X.ToString(); textBoxMoveY.Text = action.Y.ToString(); }
private void ButtonAdd_Click(object sender, RoutedEventArgs e) { IWindowAction action; string name = ((ComboBoxItem)comboBoxActions.SelectedItem).Content as string; switch (name) { case "Bring to front": action = new WindowActionBringToFront(); break; case "Close": action = new WindowActionClose(); break; case "Maximize": action = new WindowActionMaximize(); break; case "Minimize": action = new WindowActionMinimize(); break; case "Move": action = new WindowActionMove(); break; case "Restore": action = new WindowActionRestore(); break; case "Resize": action = new WindowActionResize(); break; case "Send keys": action = new WindowActionSendKeys(); break; case "Wait": action = new WindowActionWait(); break; default: return; } Add(action); CheckCanSave(); }