public override ActionBase GetAction() { if (this.TranslationLanguageComboBox.SelectedIndex >= 0 && !string.IsNullOrEmpty(this.TranslationTextTextBox.Text)) { CultureInfo culture = (CultureInfo)this.TranslationLanguageComboBox.SelectedItem; TranslationResponseActionTypeEnum responseType = EnumHelper.GetEnumValueFromString <TranslationResponseActionTypeEnum>((string)this.ResponseActionComboBox.SelectedItem); if (responseType == TranslationResponseActionTypeEnum.Chat) { if (!string.IsNullOrEmpty(this.ChatResponseTextBox.Text)) { return(TranslationAction.CreateForChat(culture, this.TranslationTextTextBox.Text, this.AllowProfanityCheckBox.IsChecked.GetValueOrDefault(), this.ChatResponseTextBox.Text)); } } else if (responseType == TranslationResponseActionTypeEnum.Command) { if (this.CommandResponseComboBox.SelectedIndex >= 0) { return(TranslationAction.CreateForCommand(culture, this.TranslationTextTextBox.Text, this.AllowProfanityCheckBox.IsChecked.GetValueOrDefault(), (CommandBase)this.CommandResponseComboBox.SelectedItem, this.CommandResponseArgumentsTextBox.Text)); } } else if (responseType == TranslationResponseActionTypeEnum.SpecialIdentifier) { if (SpecialIdentifierStringBuilder.IsValidSpecialIdentifier(this.SpecialIdentifierResponseTextBox.Text)) { return(TranslationAction.CreateForSpecialIdentifier(culture, this.TranslationTextTextBox.Text, this.AllowProfanityCheckBox.IsChecked.GetValueOrDefault(), this.SpecialIdentifierResponseTextBox.Text)); } } } return(null); }
public TranslationActionControl(TranslationAction action) : this() { this.action = action; }
public TranslationActionControl(ActionContainerControl containerControl, TranslationAction action) : this(containerControl) { this.action = action; }