Exemple #1
0
        /// <summary>
        /// "Form create" event handler.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">Event arguments.</param>
        private void FrmCleaner_Load(object sender, EventArgs e)
        {
            // Changing window title...
            Text = String.Format(Text, CleanInfo);

            // Starting searching for candidates...
            if (!GttWrk.IsBusy)
            {
                CM_FTable.BeginUpdate(); GttWrk.RunWorkerAsync();
            }

            // Blocking selection if required...
            CM_FTable.Enabled = !IsReadOnly;
        }
Exemple #2
0
        /// <summary>
        /// Finalizes candidates find procedure.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">Completion arguments and results.</param>
        private void GttWrk_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            // Unlocking ListView...
            CM_FTable.EndUpdate();

            // Showing estimated of free space to be free after removing all found files...
            CM_Info.Text = String.Format(AppStrings.PS_FrFInfo, GuiHelpers.SclBytes(TotalSize));

            // Checking if candidates are found...
            if (CM_FTable.Items.Count == 0)
            {
                // Nothing found. Showing message and closing form...
                MessageBox.Show(AppStrings.PS_LoadErr, Properties.Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                CM_Clean.Enabled = false;
                Close();
            }
            else
            {
                // At least one candidate found. Enabling cleanup button...
                CM_Clean.Enabled = true;
            }
        }