Beispiel #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);
 }
        /// <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(ViewContainer target, Direction dir)
        {
            Qualifier = Modification.None;

            foreach (View src in Views)
            {
                // progress.Value++;

                bool found = false;

                foreach (View tgt in target.Views)
                {
                    if (src.Name == tgt.Name)
                    {
                        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;
                    }

                    Qualifier = Modification.Modified;
                }
                else
                {
                }
            }

            return(Qualifier);
        }