Ejemplo n.º 1
0
        /// <summary>
        /// Executes this command.
        /// </summary>
        /// <param name="parameter">The parameter.</param>
        public override void Execute(object parameter)
        {
            var browser = AppCore.FormMain.SchemaBrowser;

            DatabaseSchema destination = browser.SelectedSchema;

            if (destination == null)
            {
                if (browser.Schemas.Count == 0)
                {
                    return;
                }

                destination = browser.Schemas[0];
            }

            var            builder = DatabaseSchema.CreateBuilder(destination.ProviderType);
            DatabaseSchema source  = builder.BuildDatabaseSchema(destination.ConnectionString);

            AppCore.FormMain.ExceptionViewer.ShowExceptions(builder.Errors);


            var form = new CompareConsole();

            form.View.ShowCompareResult(ObjectResult.Compare(source, destination));
            form.Show(AppCore.FormMain.DockPanel);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Executes this command.
        /// </summary>
        /// <param name="parameter">The parameter.</param>
        /// <param name="target">The target.</param>
        public override void Execute(object parameter, object target)
        {
            var destionationSchema = AppCore.Current.Form.SchemaBrowser.SelectedSchema;

            if (destionationSchema == null)
            {
                MessageBox.Show("Select schema. Please.", "Error");
                return;
            }
            var builder      = new OleDbSchemaBuilder();
            var sourceSchema = builder.BuildDatabaseSchema(destionationSchema.ConnectionString);

            AppCore.Current.Form.ErrorViewer.ShowErrors(builder.Errors);

            var dummyDoc = new CompareConsole();

            dummyDoc.ShowResults(_configuration.Compare(typeof(DatabaseSchema), sourceSchema, destionationSchema) as ObjectResult);
            dummyDoc.Show(AppCore.Current.Form.DockPanel);
        }