public static bool SetRule(this IPropertiesContainer container, [NotNull] IRuleEditorDialog ruleEditor)
        {
            bool result = false;

            ruleEditor.Rule = container.GetRule();

            if (ruleEditor is Form dialog && dialog.ShowDialog(Form.ActiveForm) == DialogResult.OK)
            {
                container.SetRule(ruleEditor.Rule);
                result = true;
            }

            return(result);
        }
示例#2
0
        private bool FilterRule([NotNull] IPropertiesContainer container, [Required] string filterRule)
        {
            var result = false;

            var rule = container.GetRule();

            if (rule != null)
            {
                var ruleText = rule.ToString();
                if (ruleText.ToLower().Contains(filterRule.ToLower()))
                {
                    result = true;
                }
            }

            return(result);
        }
示例#3
0
        private bool HasSelectionRule(IPropertiesContainer container)
        {
            var rule = container?.GetRule();

            return(rule?.Root != null);
        }