Example #1
0
        public void Delete(ListView list, bool left)
        {
            string CurrentPath;

            if (left)
            {
                CurrentPath = currentPath1;
            }
            else
            {
                CurrentPath = currentPath2;
            }
            if (list.SelectedItems.Count > 0)
            {
                foreach (int i in list.SelectedIndices)
                {
                    if (list.Items[i].ImageIndex == 0)
                    {
                        Folder folder = new Folder(CurrentPath + "\\" + list.Items[i].Text);
                        folder.Delete();
                    }
                    else
                    {
                        CommonFile file = new CommonFile(CurrentPath + "\\" + list.Items[i].Text);
                        file.Delete();
                    }
                }
            }
        }
Example #2
0
        public void Delete(ListView list, bool left)
        {
            string currentPath;

            if (left)
            {
                currentPath = currentPath1;
            }
            else
            {
                currentPath = currentPath2;
            }
            WarningForm warningForm = new WarningForm(false);

            warningForm.ShowDialog();
            if (warningForm.action)
            {
                if (list.SelectedItems.Count > 0)
                {
                    foreach (int i in list.SelectedIndices)
                    {
                        if (list.Items[i].ImageIndex == 0)
                        {
                            Folder folder = new Folder(currentPath + "\\" + list.Items[i].Text);
                            folder.Delete();
                            director.DeleteReport(currentPath + "\\" + list.Items[i].Text);
                            director.BuildReport();
                            reports.Add(director.GetReportItem());
                        }
                        else
                        {
                            CommonFile file = new CommonFile(currentPath + "\\" + list.Items[i].Text);
                            file.Delete();
                            director.DeleteReport(currentPath + "\\" + list.Items[i].Text);
                            director.BuildReport();
                            reports.Add(director.GetReportItem());
                        }
                    }
                }
            }
        }