コード例 #1
0
ファイル: RuleML.cs プロジェクト: erdembey/ooRuleML
        public RuleML(RuleML another)
        {
            Oid refOid = null;
            Assert refAssert = null;
            Query refQuery = null;
            Protect refProtect = null;
            parent = new ArrayList();
            try
            {
                if (another.Assert != null)
                {
                    refAssert = (Assert)another.Assert.Clone();
                }

                if (another.Oid != null)
                {
                    refOid = (Oid)another.Oid.Clone();
                }

                if (another.Query != null)
                {
                    refQuery = (Query)another.Query.Clone();
                }

                if (another.Protect != null)
                {
                    refProtect = (Protect)another.Protect.Clone();
                }

                if (another.Parent != null)
                {
                    int[] items = (int[])another.Parent.Clone();
                    parent.Clear();
                    foreach (int item in items)
                    {
                        parent.Add(item);
                    }
                }
            }
            catch (Exception e)
            {
                e.ToString();
            }

            assert = refAssert;
            oid = refOid;
            protect = refProtect;
            query = refQuery;
            id = another.id;
        }
コード例 #2
0
ファイル: RuleML.cs プロジェクト: erdembey/ooRuleML
        public override bool Equals(object o)
        {
            if (o == null || GetType() != o.GetType())
            {
                return false;
            }

            RuleML other = new RuleML((RuleML)o);

            if (this.assert != null)
            {
                if (!this.Assert.Equals(other.Assert))
                {
                    return false;
                }
            }

            if (this.Protect != null)
            {
                if (!this.Protect.Equals(other.Protect))
                {
                    return false;
                }
            }

            if (this.Query != null)
            {
                if (!this.Query.Equals(other.Query))
                {
                    return false;
                }
            }

            if (this.oid != null)
            {
                if (!this.Oid.Equals(other.Oid))
                {
                    return false;
                }
            }

            return true;
        }
コード例 #3
0
ファイル: RuleML.cs プロジェクト: erdembey/ooRuleML
        public int CompareTo(object o)
        {
            RuleML another = new RuleML((RuleML)o);

            if (another.assert != null && assert != null)
            {
                return assert.CompareTo(another.assert);
            }

            return 0;
        }