Esempio n. 1
0
        public static void Defrag
        (
            [Required] string sourceFileStorageName,
            [Required] string destinationFileStorageName,
            [Required] string sqlTable,
            [Required] string sqlColumn
        )
        {
            try
            {
                var startDateTime          = DateTime.Now;
                var progressNotifierPhase1 = new ProgressNotifier("Reading indexes");
                var progressNotifierPhase2 = new ProgressNotifier("Writing");

                FileStorageFacade.DefragDataIdentifiers(sourceFileStorageName, destinationFileStorageName, sqlTable, sqlColumn, progressNotifierPhase1.ShowProgress, progressNotifierPhase2.ShowProgress);
                Console.WriteLine();
                var timeSpan = DateTime.Now - startDateTime;
                Console.WriteLine(string.Format("File storage optimization finished"));
                Console.WriteLine(string.Format("This operation took {0} msecs", (Int64)timeSpan.TotalMilliseconds));
            }
            catch (Exception e)
            {
                Console.WriteLine(string.Format("An error occured; {0}", e.Message));
            }
        }