Exemple #1
0
        static void Main(string [] args)
        {
            var cmdOptions = new CmdOptions();

            if (CommandLine.Parser.Default.ParseArguments(args, cmdOptions))
            {
                if (string.IsNullOrEmpty(cmdOptions.InputFile) &&
                    !cmdOptions.UseUI)
                {
                    PrintUsage(cmdOptions);
                }
                else
                {
                    if (!string.IsNullOrEmpty(cmdOptions.InputFile))
                    {
                        RunTool(cmdOptions);
                    }
                    else
                    {
                        ShowUI();
                    }
                }
            }
            else
            {
                PrintUsage(cmdOptions);
            }
        }
Exemple #2
0
 private static void RunTool(CmdOptions cmdOptions)
 {
     if (!string.IsNullOrEmpty(cmdOptions.InputFile))
     {
         if (!System.IO.File.Exists(cmdOptions.InputFile))
         {
             Console.WriteLine("Input file {0} doesn't exists.", cmdOptions.InputFile);
         }
         else
         {
             DBRestoreParam dBRestoreParam = DBRestoreParam.NewDBRestoreParam(cmdOptions.InputFile);
             List <string>  strList        = DBRestoreHelper.RestoreCleanupShrinkDB(dBRestoreParam);
             foreach (string str in strList)
             {
                 Console.WriteLine(str);
             }
         }
     }
 }
Exemple #3
0
 private static void PrintUsage(CmdOptions cmdOptions)
 {
     Console.WriteLine(cmdOptions.GetUsage());
     Console.WriteLine("Press any key to continue...");
     Console.ReadLine();
 }