// THIS REGION IS RETAINED JUST TO HAVE THIS CODE AVAILABLE, BUT:
        //    1) the builder ONLY runs in background mode
        //    2) the other portions from this method may be useful as the other
        //       builder options are refined as scheduled tasks


        ///// <summary> Immediately perform all requested tasks </summary>
        ///// <param name="BuildProductionMarcxmlFeed"> Flag indicates if the MarcXML feed for OPACs should be produced </param>
        ///// <param name="BuildTestMarcxmlFeed"> Flag indicates if the items set to be put in a TEST feed should have their MarcXML feed produced</param>
        ///// <param name="RunBulkloader"> Flag indicates if the preload </param>
        ///// <param name="CompleteStaticRebuild"> Flag indicates whether to rebuild all the item static pages </param>
        ///// <param name="MarcRebuild"> Flag indicates if all the MarcXML files for each resource should be rewritten from the METS/MODS metadata files </param>
        //public void Execute_Immediately(bool BuildProductionMarcxmlFeed, bool BuildTestMarcxmlFeed, bool RunBulkloader, bool CompleteStaticRebuild, bool MarcRebuild )
        //{
        //    // start with warnings on imagemagick and ghostscript not being installed
        //    if (Engine_ApplicationCache_Gateway.Settings.Builder.ImageMagick_Executable.Length == 0)
        //    {
        //        Console.WriteLine("WARNING: Could not find ImageMagick installed.  Some image processing will be unavailable.");
        //    }
        //    if (Engine_ApplicationCache_Gateway.Settings.Builder.Ghostscript_Executable.Length == 0)
        //    {
        //        Console.WriteLine("WARNING: Could not find GhostScript installed.  Some PDF processing will be unavailable.");
        //    }

        //    if (CompleteStaticRebuild)
        //    {
        //        Console.WriteLine("Beginning static rebuild");
        //        LogFileXhtml staticRebuildLog = new LogFileXhtml( logFileDirectory  + "\\static_rebuild.html");
        //        Static_Pages_Builder builder = new Static_Pages_Builder(Engine_ApplicationCache_Gateway.Settings.Servers.Application_Server_URL, Engine_ApplicationCache_Gateway.Settings.Servers.Static_Pages_Location, Engine_ApplicationCache_Gateway.Settings.Servers.Application_Server_Network);
        //        builder.Rebuild_All_Static_Pages(staticRebuildLog, true, String.Empty, -1);
        //    }

        //    if ( MarcRebuild )
        //    {
        //        Static_Pages_Builder builder = new Static_Pages_Builder(Engine_ApplicationCache_Gateway.Settings.Servers.Application_Server_URL, Engine_ApplicationCache_Gateway.Settings.Servers.Static_Pages_Location, Engine_ApplicationCache_Gateway.Settings.Servers.Application_Server_Network);
        //        builder.Rebuild_All_MARC_Files(Engine_ApplicationCache_Gateway.Settings.Servers.Image_Server_Network);
        //    }

        //    if (BuildProductionMarcxmlFeed)
        //    {
        //        Create_Complete_MarcXML_Feed(false);
        //    }

        //    if (BuildTestMarcxmlFeed)
        //    {
        //        Create_Complete_MarcXML_Feed(true);
        //    }

        //    // Create the log
        //    string directory = logFileDirectory;
        //    if (!Directory.Exists(directory))
        //        Directory.CreateDirectory(directory);

        //    // Run the PRELOADER
        //    if (RunBulkloader)
        //    {
        //        Run_BulkLoader( verbose );
        //    }
        //    else
        //    {
        //        Console.WriteLine("PreLoader skipped per command line arguments");
        //    }
        //}

        #endregion

        #region Methods to handle checking for abort requests

        private bool CheckForAbort()
        {
            if (aborted)
            {
                return(true);
            }

            if (Abort_Database_Mechanism.Abort_Requested())
            {
                aborted = true;
                Abort_Database_Mechanism.Builder_Operation_Flag = Builder_Operation_Flag_Enum.ABORTING;
            }
            return(aborted);
        }
        private bool CheckForAbort()
        {
            if (aborted)
            {
                return(true);
            }

            bool returnValue = Abort_Database_Mechanism.Abort_Requested();

            if (returnValue)
            {
                aborted = true;

                logger.AddError("ABORT REQUEST RECEIVED VIA DATABASE KEY");
            }
            return(returnValue);
        }