コード例 #1
0
        public static RuleGroup Create(XmlNode xmlNode, RdcTreeNode node, ICollection <string> errors)
        {
            RuleGroup ruleGroup = new RuleGroup();

            ruleGroup.ReadXml(xmlNode, node, errors);
            return(ruleGroup);
        }
コード例 #2
0
        public SmartGroupPropertiesTabPage(TabbedSettingsDialog dialog, SmartGroupSettings settings)
            : base(dialog, settings, settings.Name)
        {
            _ruleGroup = ((dialog as SmartGroupPropertiesDialog).AssociatedNode as SmartGroup).RuleGroup;
            int rowIndex = 0;
            int tabIndex = 0;

            AddGroupName(ref rowIndex, ref tabIndex);
            AddParentCombo(ref rowIndex, ref tabIndex);
            rowIndex++;
            Label label = new Label
            {
                Location  = FormTools.NewLocation(0, rowIndex++),
                Text      = "符合以下",
                TextAlign = ContentAlignment.MiddleLeft,
                Size      = new Size(56, 20)
            };

            _anyAllCombo = new ValueComboBox <RuleGroupOperator>(Helpers.EnumValues <RuleGroupOperator>(), (RuleGroupOperator v) => v.ToString())
            {
                Location      = new Point(label.Right, label.Top),
                Size          = new Size(50, 20),
                TabIndex      = tabIndex++,
                SelectedValue = RuleGroupOperator.All
            };
            Label label2 = new Label
            {
                Location  = new Point(_anyAllCombo.Right + 5, label.Top),
                Text      = "规则的服务器",
                TextAlign = ContentAlignment.MiddleLeft,
                Size      = new Size(140, 20)
            };

            base.Controls.Add(label, _anyAllCombo, label2);
            GroupBox groupBox = new GroupBox
            {
                Location = FormTools.NewLocation(0, rowIndex++)
            };

            _rulePanel = new Panel
            {
                Location   = FormTools.NewLocation(0, 0),
                AutoScroll = true
            };
            int num = 302 - groupBox.Top - 40;

            _rulePanel.Size = new Size(480, num);
            _rulePanel.VerticalScroll.LargeChange = num;
            _rulePanel.VerticalScroll.SmallChange = num / 20;
            groupBox.Size = new Size(496, num + _rulePanel.Top * 2);
            groupBox.Controls.Add(_rulePanel);
            _nextRuleTabIndex = tabIndex;
            base.Controls.Add(groupBox);
        }
コード例 #3
0
 protected override void InitSettings()
 {
     base.Properties = new SmartGroupSettings();
     base.AllSettingsGroups.Add(Properties);
     RuleGroup = new RuleGroup(RuleGroupOperator.All, Enumerable.Empty <Rule>());
 }