Example #1
0
		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);
			}
		}
Example #2
0
		private void btnClean_Click(object sender, EventArgs e)
		{
			if (m_currentStatus == CurrentStatus.OptionsSelection)
			{
				if (!m_optionCtl.HasOptionsSelected() && m_optionCtl.HasValidFiles())
					MessageBox.Show(Properties.Resources.NO_OPTIONS_SELECTED);
                else if (!m_optionCtl.HasValidLocation() && m_optionCtl.HasValidFiles())
                    MessageBox.Show(Properties.Resources.NO_LOCATION_SELECTED);
                else
                {
                    // re-read the files if being written to an alternate folder
                    if (!string.IsNullOrEmpty(m_controller.WriteToFolder))
                    {
                        ReadProgressForm readProgress = new ReadProgressForm(m_controller);
                        readProgress.ShowDialog();
                    }

                    DoProcessing();
                }
			}
			else if (m_currentStatus == CurrentStatus.Cleaning)
			{
				InitializeTrayNotification();
			}
			else if (m_currentStatus == CurrentStatus.Report)
				Close();
		}