Beispiel #1
0
        private void ProgressForm_Activated(object sender, EventArgs e)
        {
            var handler = new ProgressEventHandler.ProgressHandler(genData2_OnProgress);

            try
            {
                if (!IsProcessing)
                {
                    this.Refresh();
                    IsProcessing                = false;
                    genData1.OnProgress        += new ProgressEventHandler.ProgressHandler(genData1_OnProgress);
                    genData2.OnProgress        += handler;
                    Generate.OnCompareProgress += handler;

                    /*Thread t1 = new Thread(delegate()
                     * {*/
                    this.ErrorLocation = "Loading " + databaseProgressControl1.DatabaseName;
                    Source             = genData1.Process();
                    databaseProgressControl2.Message = "Complete";
                    databaseProgressControl2.Value   = Generate.MaxValue;

                    /*});
                     * Thread t2 = new Thread(delegate()
                     * {*/
                    this.ErrorLocation = "Loading " + databaseProgressControl2.DatabaseName;
                    Destination        = genData2.Process();

                    origenClone = (Database)Source.Clone(null);

                    /*});
                     * t1.Start();
                     * t2.Start();
                     * t1.Join();
                     * t2.Join();
                     */
                    this.ErrorLocation = "Comparing Databases";
                    Destination        = Generate.Compare(Source, Destination);
                    Source             = origenClone;

                    databaseProgressControl1.Message = "Complete";
                    databaseProgressControl1.Value   = Generate.MaxValue;
                }
            }
            catch (Exception err)
            {
                this.Error = err;
            }
            finally
            {
                Generate.OnCompareProgress -= handler;
                this.Dispose();
            }
        }
Beispiel #2
0
        private void ProgressForm_Activated(object sender, EventArgs e)
        {
            var handler = new ProgressEventHandler.ProgressHandler(genData2_OnProgress);

            try
            {
                if (!IsProcessing)
                {
                    this.Refresh();
                    IsProcessing = false;
                    OriginGenerator.OnProgress      += new ProgressEventHandler.ProgressHandler(genData1_OnProgress);
                    DestinationGenerator.OnProgress += handler;

                    this.ErrorLocation            = "Loading " + destinationProgressControl.DatabaseName;
                    Origin                        = OriginGenerator.Process();
                    originProgressControl.Message = "Complete";
                    originProgressControl.Value   = OriginGenerator.GetMaxValue();

                    this.ErrorLocation = "Loading " + originProgressControl.DatabaseName;
                    Destination        = DestinationGenerator.Process();

                    originClone = (Schema.Model.IDatabase)Origin.Clone(null);

                    this.ErrorLocation = "Comparing Databases";
                    Destination        = Comparer.Compare(Origin, Destination);
                    Origin             = originClone;

                    destinationProgressControl.Message = "Complete";
                    destinationProgressControl.Value   = DestinationGenerator.GetMaxValue();
                }
            }
            catch (Exception err)
            {
                this.Error = err;
            }
            finally
            {
                OriginGenerator.OnProgress      -= handler;
                DestinationGenerator.OnProgress -= handler;
                this.Dispose();
            }
        }
Beispiel #3
0
        private void ProgressForm_Activated(object sender, EventArgs e)
        {
            var handler = new ProgressEventHandler.ProgressHandler(genData2_OnProgress);
            try
            {
                if (!IsProcessing)
                {
                    this.Refresh();
                    IsProcessing = false;
                    genData1.OnProgress += new ProgressEventHandler.ProgressHandler(genData1_OnProgress);
                    genData2.OnProgress += handler;
                    Generate.OnCompareProgress += handler;

                    /*Thread t1 = new Thread(delegate()
                    {*/
                    this.friendlyErrorLocation = "Loading " + databaseProgressControl1.DatabaseName;
                    origen = genData1.Process();
                    databaseProgressControl2.Message = "Complete";
                    databaseProgressControl2.Value = Generate.MaxValue;
                    /*});
                    Thread t2 = new Thread(delegate()
                    {*/
                    this.friendlyErrorLocation = "Loading " + databaseProgressControl2.DatabaseName;
                    destino = genData2.Process();

                    origenClone = (Database)origen.Clone(null);
                    /*});
                    t1.Start();
                    t2.Start();
                    t1.Join();
                    t2.Join();
                    */
                    this.friendlyErrorLocation = "Comparing Databases";
                    destino = Generate.Compare(origen, destino);
                    origen = origenClone;

                    databaseProgressControl1.Message = "Complete";
                    databaseProgressControl1.Value = Generate.MaxValue;
                }
            }
            catch (Exception err)
            {
                this.error = err;
            }
            finally
            {
                Generate.OnCompareProgress -= handler;
                this.Dispose();
            }
        }