Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Base"/> class.
 /// </summary>
 public Base()
 {
     m_Connection    = new ConnectionAdapter();
     m_TableCont     = new TableContainer(this);
     m_ViewCont      = new ViewContainer(this);
     m_ProcedureCont = new ProcedureContainer(this);
     m_FunctionCont  = new FunctionContainer(this);
 }
Example #2
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(TableContainer target, Direction dir)
        {
            Qualifier = Modification.None;

            foreach (Table src in Tables)
            {
                // progress.Value++;

                bool found = false;

                foreach (Table tgt in target.Tables)
                {
                    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.Tables.Add(new Table(m_Base, src));
                    }

                    Qualifier = Modification.Modified;
                }
                else
                {
                }
            }

            return(Qualifier);
        }