private void cmdNext_Click(object sender, RoutedEventArgs e) { if (SaveGesture()) { this.Hide(); ActionDialog ad = new ActionDialog(GestureManager.Instance.GestureName); ad.Show(); this.Close(); } else { txtGestureName.Focus(); } }
private void cmdEditAction_Click(object sender, RoutedEventArgs e) { // Make sure at least one item is selected if (lstAvailableActions.SelectedItems.Count == 0) return; // Get first item selected, associated action, and selected application ActionInfo selectedItem = (ActionInfo)lstAvailableActions.SelectedItem; IAction selectedAction = null; IApplication selectedApplication = null; string selectedGesture = null; selectedApplication = lstAvailableApplication.SelectedItem as IApplication; if (selectedApplication == null) // Select action from global application list selectedAction = ApplicationManager.Instance.GetGlobalApplication().Actions.FirstOrDefault(a => a.Name == selectedItem.ActionName); else // Select action from selected application list selectedAction = selectedApplication.Actions.FirstOrDefault(a => a.Name == selectedItem.ActionName); if (selectedAction == null) return; // Get currently assigned gesture selectedGesture = selectedAction.GestureName; // Set current application, current action, and current gestures ApplicationManager.Instance.CurrentApplication = selectedApplication; GestureManager.Instance.GestureName = selectedGesture; ActionDialog actionDialog = new ActionDialog(selectedAction, selectedApplication); actionDialog.ShowDialog(); }
private void btnAddAction_Click(object sender, RoutedEventArgs e) { if (GestureManager.Instance.Gestures.Length == 0) { UIHelper.GetParentWindow(this) .ShowMessageAsync(LocalizationProvider.Instance.GetTextValue("Action.Messages.NoGestureTitle"), LocalizationProvider.Instance.GetTextValue("Action.Messages.NoGesture"), MessageDialogStyle.Affirmative, new MetroDialogSettings() { AffirmativeButtonText = LocalizationProvider.Instance.GetTextValue("Common.OK"), ColorScheme = MetroDialogColorScheme.Accented, AnimateHide = false, AnimateShow = false }); return; } var ai = lstAvailableActions.SelectedItem as ActionInfo; string gestureName = ai?.GestureName; ActionDialog actionDialog = new ActionDialog(gestureName, lstAvailableApplication.SelectedItem as IApplication); actionDialog.Show(); }
private void cmdNext_Click(object sender, RoutedEventArgs e) { if (SaveGesture()) { this.Hide(); ActionDialog ad = new ActionDialog(GestureManager.Instance.GestureName); ad.Show(); this.Close(); } else txtGestureName.Focus(); }