static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); ExportRuntimePoliciesIfTheProtectOptionsHaveBeenModified(); string outputDir = string.Empty; List<string> filelist = ParseArgsAndGetFileList(args, ref outputDir); if (filelist.Count == 0) return; CleanerController controller = new CleanerController(); controller.Files.PasswordProtectedFile += OnPasswordProtectedFile; controller.WriteToFolder = outputDir; ReadProgressForm readProgress = new ReadProgressForm(controller, filelist); readProgress.ShowDialog(); if (controller.GetRealFileCount() == 0) return; ContainerForm optionsForm = new ContainerForm(controller); optionsForm.ShowDialog(); try { controller.Dispose(); } catch (Exception ex) { Workshare.Interop.Logging.Logger.LogError(ex); } }
static void Main(string[] args) { if (!Licensing.IsLicensed(Licensing.ProtectEnterpriseClient, ".", false)) { Console.WriteLine(Properties.Resources.UNLICENSED); return; } ParamParser parser = new ParamParser(); if (args == null || args.Length < 1) { Console.Write(parser.GetCommandLineHelp()); return; } if (!parser.Parse(args)) { Console.Write(parser.GetCommandLineHelp()); return; } InitializeSummary(); CleanerController controller = new CleanerController(); controller.WriteToFolder = parser.WriteToFolder; controller.FileProcessed += OnFileProcessed; controller.ProcessComplete += OnProcessComplete; controller.CleanProcessCancelled += OnCleanProcessCancelled; controller.Files.ReadFile += OnReadFile; List<string> allfiles = new List<string>(); allfiles.AddRange(parser.Files); allfiles.AddRange(parser.Folders); Console.Write(Properties.Resources.READING); controller.AddFilesForProcessing(allfiles, parser.IncludeSubDirectories); Console.Write(Environment.NewLine); controller.Options.UnCheckAll(); controller.Options.CheckById(parser.Options); controller.Process(); controller.Dispose(); }