Пример #1
0
        public void delete()
        {
            if (this.CurrentAdress == "")
            {
                return;
            }
            DirectoryInfo directoryInfo = new DirectoryInfo(this.CurrentAdress);

            DirectoryInfo[] directories = directoryInfo.GetDirectories();
            FileInfo[]      files       = directoryInfo.GetFiles();

            foreach (DirectoryInfo folder in directories)
            {
                if (folder.Exists && folder.Name == this.SelectedItems[0].Text)
                {
                    ImprovedFolder.Delete(folder.FullName);
                }
            }
            foreach (FileInfo file in files)
            {
                if (this.SelectedItems.Count > 0 && file.Exists && file.Name == this.SelectedItems[0].Text)
                {
                    file.Delete();
                }
            }
            this.buildDirectories(this.CurrentAdress);
        }
Пример #2
0
        public void pasteFromBuffer()
        {
            if (this.name == "" || this.CurrentAdress == "")
            {
                return;
            }
            string target;

            if (this.SelectedItems.Count == 0)
            {
                target = Path.Combine(this.CurrentAdress);
            }
            else
            {
                target = Path.Combine(this.CurrentAdress, Path.GetFileName(this.SelectedItems[0].Text));
            }
            ImprovedFolder.CopyTo(this.Buffer, target, name);
            this.buildDirectories(this.CurrentAdress);
        }