コード例 #1
0
        public void Execute(IActionContext context)
        {
            EditRuleForm form = new EditRuleForm();

            form.ShowDialog(Core.MainWindow);
            form.Dispose();
        }
コード例 #2
0
        public IResource   ShowEditActionRuleForm(string name, string[] resTypes,
                                                  IResource[][] conditions, IResource[] exceptions, IResource[] actions)
        {
            IResource    result = null;
            EditRuleForm form   = new EditRuleForm(name, resTypes, conditions, exceptions, actions);

            if (form.ShowDialog(Core.MainWindow) == DialogResult.OK)
            {
                result = form.ResultResource;
            }
            return(result);
        }
コード例 #3
0
        private void EditRuleButton_Click(object sender, EventArgs e)
        {
            int index = RulesList.SelectedIndex;

            if (index < 0)
            {
                MessageBox.Show("Please select a rule to edit.", "Edit error",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            EditRuleForm erf = new EditRuleForm(this, RulesList.SelectedItem.ToString());

            erf.ShowDialog();
        }
コード例 #4
0
        public IResource   ShowEditResourceForm(IResource res)
        {
            #region Preconditions
            if (res == null)
            {
                throw new ArgumentNullException("res", "FilteringFormsManager -- Input resource is NULL");
            }

            if (res.Type != FilterManagerProps.ViewResName &&
                res.Type != FilterManagerProps.RuleResName &&
                res.Type != FilterManagerProps.ViewCompositeResName)
            {
                throw new ArgumentException("FilteringFormsManager -- Input resource has inappropriate type [" + res.Type + "]");
            }
            #endregion Preconditions

            Form      form;
            IResource result = null;
            String    name   = res.GetStringProp(Core.Props.Name);
            if (res.HasProp("IsActionFilter"))
            {
                form = new EditRuleForm(name);
            }
            else
            if (res.HasProp("IsFormattingFilter"))
            {
                form = new EditFormattingRuleForm(name);
            }
            else
            if (res.HasProp("IsTrayIconFilter"))
            {
                form = new EditTrayIconRuleForm(name);
            }
            else
            if (res.HasProp("IsExpirationFilter"))
            {
                if (IsSimpleExpirationRule(res))
                {
                    form = new EditExpirationRuleSimpleForm(res);
                }
                else
                {
                    form = new EditExpirationRuleForm(name);
                }
            }
            else
            {
                form = new EditViewForm(name);
            }

            if (form.ShowDialog(Core.MainWindow) == DialogResult.OK)
            {
                if (form is EditExpirationRuleSimpleForm)
                {
                    result = (form as EditExpirationRuleSimpleForm).ResultResource;
                }
                else
                {
                    result = (form as ViewCommonDialogBase).ResultResource;
                }
            }

            form.Dispose();

            return(result);
        }
コード例 #5
0
        public void Execute(IActionContext context)
        {
            EditRuleForm form = new EditRuleForm(context.SelectedResources[0].DisplayName);

            form.ShowDialog();
        }