/// <summary> /// Initializes a new instance of the <see cref="Table"/> class. /// </summary> public Table() { m_Parent = null; m_Name = String.Empty; m_Rows = new List <Row>(); m_FieldCont = new TableFieldContainer(this); m_ConstraintCont = new ConstraintContainer(this); m_DataCont = null; }
/// <summary> /// Initializes a new instance of the <see cref="ConstraintContainer"/> class. /// </summary> /// <param name="parent">The parent.</param> /// <param name="Target">The target.</param> public ConstraintContainer(Table parent, ConstraintContainer Target) : this(parent) { GhostCopy(Target); foreach (Constraint Const in Target.Constraints) { m_Constraints.Add(new Constraint(Const)); } }
/// <summary> /// Initializes a new instance of the <see cref="Table"/> class. /// </summary> /// <param name="parent">The parent.</param> /// <param name="Target">The target.</param> public Table(Base parent, Table Target) : this(parent) { GhostCopy(Target); m_Parent = Target.Parent; m_Name = Target.Name; m_Rows = new List <Row>(); m_FieldCont = new TableFieldContainer(this, Target.FieldCont); m_ConstraintCont = new ConstraintContainer(this, Target.ConstraintCont); if (Target.DataCont != null) { m_DataCont = new DataContainer(this, Target.DataCont); } }
/// <summary> /// Qualifies this object against another one. /// </summary> /// <param name="target">The target.</param> /// <param name="dir">The direction.</param> /// <returns></returns> public Modification qualifyVersus(ConstraintContainer target, Direction dir) { Qualifier = Modification.None; foreach (Constraint src in m_Constraints) { bool found = false; foreach (Constraint tgt in target.Constraints) { if (src.Name == tgt.Name && tgt.IsGhost == false) { Modification mod = src.qualifyVersus(tgt, dir); if (Qualifier == Modification.None && mod != Modification.None) { Qualifier = Modification.Modified; } found = true; break; } } if (found == false) { if (dir == Direction.Out) { src.Qualifier = Modification.Deleted; } else { src.Qualifier = Modification.Created; } if (src.Twin == null) { target.Constraints.Add(new Constraint(src)); } Qualifier = Modification.Modified; } } return(Qualifier); }