Data Type Object Class for defining a reactive action.
상속: ActionLibrary.DTOs.ActionDefinitionDTO
        private void addOrEditButton_Click(object sender, EventArgs e)
        {
            try
            {
                float priority;
                if (!float.TryParse(textBoxPriority.Text, out priority))
                    priority = 0;

                var newReaction = new ReactionDTO
                {
                    Action = textBoxAction.Text,
                    Target = textBoxTarget.Text,
                    Priority = priority
                };

                if (_reactionToEdit != null)
                {
                    _edmAsset.UpdateReaction(_reactionToEdit, newReaction);
                }
                else
                {
                    _edmAsset.AddReaction(newReaction);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, Resources.ErrorDialogTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            this.Close();
        }
        public AddOrEditReactionForm(EmotionalDecisionMakingAsset edmAsset, ReactionDTO reactionToEdit = null)
        {
            InitializeComponent();

            _edmAsset = edmAsset;
            _reactionToEdit = reactionToEdit;

            if (reactionToEdit != null)
            {
                this.Text = Resources.EditReactionFormTitle;
                this.addOrEditButton.Text = Resources.UpdateButtonLabel;
                textBoxAction.Text = reactionToEdit.Action;
                textBoxTarget.Text = reactionToEdit.Target;
                textBoxPriority.Text = reactionToEdit.Priority.ToString();
            }
        }
 public ActionTendency(ReactionDTO dto)
     : base(dto)
 {
     Priority = dto.Priority;
 }
예제 #4
0
 private void UpdateConditions(ReactionDTO reaction)
 {
     _conditionSetView.SetData(reaction?.Conditions);
 }