示例#1
0
        public Integrity(Integrity another)
        {
            Oid refOid = null;
            Atom refAtom = null;
            Or refOr = null;
            And refAnd = null;
            AndOrFormula refFormula = null;

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

                if (another.Atom != null)
                {
                    refAtom = (Atom)another.Atom.Clone();
                }

                if (another.InnerOr != null)
                {
                    refOr = (Or)another.InnerOr.Clone();
                }

                if (another.InnerAnd != null)
                {
                    refAnd = (And)another.InnerAnd.Clone();
                }

                if (another.Formula != null)
                {
                    refFormula = (AndOrFormula)another.Formula.Clone();
                }
            }
            catch (Exception e)
            {
                e.ToString();
            }

            oid = refOid;
            and = refAnd;
            or = refOr;
            formula = refFormula;
            atom = refAtom;
        }
示例#2
0
        public Warden(Warden another)
        {
            Integrity refIntegrity = null;

            try
            {
                if (another.Integrity != null)
                {
                    refIntegrity = (Integrity)another.Integrity.Clone();
                }
            }
            catch (Exception e)
            {
                e.ToString();
            }

            integrity = refIntegrity;
        }
示例#3
0
        /*
         * private Atom atom;
         * private Or or;
         * private And and;
         * private Oid oid;
         * private AndOrFormula formula;
         */
        public override bool Equals(object o)
        {
            if (o == null || GetType() != o.GetType())
            {
                return false;
            }

            Integrity other = new Integrity((Integrity)o);

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

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

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

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

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

            return true;
        }