예제 #1
0
        /// <summary>
        /// Edit method.
        /// </summary>
        public override void Edit()
        {
            // While the new item cannot be initialized - let the user pick another one or cancel the addition.
            bool enough = false;

            while (!enough)
            {
                VirtualNewForm form = VirtualNewForm.GetActionsInstance();
                if (form.ShowDialog() == DialogResult.OK)
                {
                    var action = (BaseScriptAction)form.Value;
                    if (action.Initialize())
                    {
                        parent.Remove(this);
                        parent.Add(action);
                        parent.Add(this);
                        enough = true;
                    }
                }
                else
                {
                    enough = true;
                }
            }
        }
예제 #2
0
        /// <summary>
        /// Edit method.
        /// </summary>
        public override void Edit()
        {
            bool enough = false;

            while (!enough)
            {
                VirtualNewForm form = VirtualNewForm.GetConditionsInstance();
                if (form.ShowDialog() == DialogResult.OK)
                {
                    var action = (BaseScriptCondition)form.Value;
                    if (action.Initialize())
                    {
                        parent.Remove(this);
                        parent.Add(action);
                        parent.Add(this);
                        enough = true;
                    }
                }
                else
                {
                    enough = true;
                }
            }
        }