Esempio n. 1
0
        private void btnTrash_Click(object sender, EventArgs e)
        {
            if (DialogResult.Yes != CppUtils.YesOrNo(string.Format(Properties.Resources.ARE_YOU_SURE_TO_TRASH, txtName.Tag.ToString()),
                                                     MessageBoxDefaultButton.Button2))
            {
                return;
            }

            List <Control> cs = disableAll();

            try
            {
                //FileSystem.DeleteFile(
                //  this.txtName.Tag.ToString(),
                //  UIOption.OnlyErrorDialogs,
                //  RecycleOption.SendToRecycleBin);

                if (0 == CppUtils.DeleteFile(this, this.txtName.Tag.ToString()))
                {
                    Close();
                }
            }
            catch (Exception)
            {
                //using (new Ambiesoft.CenteringDialog(this))
                //{
                //    MessageBox.Show(ex.Message,
                //    Application.ProductName,
                //    MessageBoxButtons.OK,
                //    MessageBoxIcon.Exclamation);
                //}
            }
            finally
            {
                enableAll(cs);
            }
        }