コード例 #1
0
 /// <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;
 }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TableFieldContainer"/> class.
        /// </summary>
        /// <param name="parent">The parent.</param>
        /// <param name="Target">The target.</param>
        public TableFieldContainer(Table parent, TableFieldContainer Target)
            : this(parent)
        {
            GhostCopy(Target);

            foreach (TableField Field in Target.Fields)
            {
                m_Fields.Add(new TableField(Field));
            }
        }
コード例 #3
0
        /// <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(TableFieldContainer target, Direction dir)
        {
            Qualifier = Modification.None;

            foreach (Field src in m_Fields)
            {
                bool found = false;

                foreach (Field tgt in target.m_Fields)
                {
                    if (src.Name == tgt.Name && tgt.IsGhost == false)
                    {
                        Modification mod = src.qualifyVersus(tgt, dir);

                        if (Qualifier == Modification.None && mod != Modification.None)
                        {
                            Qualifier = Modification.Modified;
                        }

                        src.Twin = tgt;

                        found = true;
                        break;
                    }
                }

                if (found == false)
                {
                    if (dir == Direction.Out)
                    {
                        src.Qualifier = Modification.Deleted;
                    }
                    else
                    {
                        src.Qualifier = Modification.Created;
                    }

                    if (src.Twin == null)
                    {
                        target.Fields.Add(new TableField(src));
                    }

                    Qualifier = Modification.Modified;
                }
            }

            return(Qualifier);
        }
コード例 #4
0
        /// <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);
            }
        }