コード例 #1
0
        void AddCondition(TreeNode root, XmlCondition condition)
        {
            if (condition != null)
            {
                TreeNode node = null;

                if (condition is XmlSimpleCondition)
                {
                    node = new TreeNode("condition");
                }
                else
                {
                    node = new TreeNode((condition as XmlComplexCondition).BinaryOperator.ToString().Replace("Operator", ""));
                    AddCondition(node, (condition as XmlComplexCondition).Condition1);
                    AddCondition(node, (condition as XmlComplexCondition).Condition2);
                }
                node.Tag = condition;
                if (root == null)
                {
                    treeView1.Nodes.Add(node);
                }
                else
                {
                    root.Nodes.Add(node);
                }
            }
        }
コード例 #2
0
ファイル: Condition.cs プロジェクト: configare/hispeed
        /// <summary>
        /// Serializes the condition by creating a serializabe instance of the XmlCondition
        /// class.
        /// </summary>
        /// <returns></returns>
        public XmlCondition Serialize()
        {
            XmlCondition res = this.CreateSerializableInstance();

            this.SerializeProperties(res);

            return(res);
        }
コード例 #3
0
ファイル: ComplexCondition.cs プロジェクト: configare/hispeed
        protected override void SerializeProperties(XmlCondition res)
        {
            base.SerializeProperties(res);
            XmlComplexCondition instance = (XmlComplexCondition)res;

            instance.Condition1     = this.Condition1.Serialize();
            instance.Condition2     = this.Condition2.Serialize();
            instance.BinaryOperator = this.BinaryOperator;
        }
コード例 #4
0
        protected override void SerializeProperties(XmlCondition res)
        {
            base.SerializeProperties(res);

            XmlSimpleCondition instance = (XmlSimpleCondition)res;

            instance.Setting       = this.Setting.Serialize();
            instance.UnaryOperator = this.UnaryOperator;
        }
コード例 #5
0
        protected override Condition CreateInstance()
        {
            Condition condition1 = null;
            Condition condition2 = null;

            //if (this.Condition1 != null)
            {
                condition1 = this.Condition1.Deserialize();
            }

            //if (this.Condition2 != null)
            {
                condition2 = this.Condition2.Deserialize();
            }
            return(new ComplexCondition(condition1, this.BinaryOperator, condition2));
        }
コード例 #6
0
        public ConditionBuilderForm(XmlCondition condition)
        {
            InitializeComponent();

            propertyGrid1.PropertyValueChanged += new PropertyValueChangedEventHandler(propertyGrid1_PropertyValueChanged);

            if (condition == null)
            {
                TreeNode node = new TreeNode("condition");
                node.Tag = new XmlSimpleCondition();
                treeView1.Nodes.Add(node);
            }
            else
            {
                AddCondition(null, condition);
            }

            label1.Text = BuildConditionString(treeView1.Nodes[0]);

            ExpandTreeToLevel(treeView1.Nodes, 3);
        }
コード例 #7
0
ファイル: Condition.cs プロジェクト: configare/hispeed
 protected virtual void SerializeProperties(XmlCondition res)
 {
 }