Beispiel #1
0
        private void BackgroundUpdateTaxonomy(object sender, DoWorkEventArgs args)
        {
            if (args.Argument == null)
            {
                return;
            }
            TaxonomyLoaderArgs loaderArgs = args.Argument as TaxonomyLoaderArgs;
            bool?retValue = null;

            if (loaderArgs != null)
            {
                if (loaderArgs.ConnectionString == null || loaderArgs.DatabaseName == null)
                {
                    args.Cancel = true;
                    return;
                }

                Updater taxonomyUpdater = new Updater();
                if (taxonomyUpdater.Run(loaderArgs.ConnectionString, loaderArgs.DatabaseName))
                {
                    retValue = true;
                }
                else
                {
                    retValue = false;
                }
                args.Result = retValue;
            }
        }
Beispiel #2
0
        private void OnUpdateTaxonomy()
        {
            UpdatingDB    = true;
            StatusMessage = UPDATING_TAXONOMY;

            rCADConnection oleConn = new rCADConnection();

            oleConn.Instance     = Instance;
            oleConn.Host         = Host;
            oleConn.SecurityType = SecurityType.WindowsAuthentication;
            oleConn.Database     = Database;
            oleConn.Provider     = "SQLNCLI10.1";

            TaxonomyLoaderArgs args = new TaxonomyLoaderArgs {
                ConnectionString = oleConn.BuildConnectionString(), DatabaseName = Database
            };

            _worker.RunWorkerAsync(args);
        }