public void Cut(ShellObject source) { try { string sourcePath = source.Path; Buffer[0] = sourcePath; Buffer[1] = "cut"; } catch (NullReferenceException e) { ResponceToTheException(e, "Select an item to cut"); } }
public void Delete(ShellObject source) { try { string sourcePath = source.Path; FileAttributes attr = File.GetAttributes(sourcePath); if (attr.HasFlag(FileAttributes.Directory)) { actionStrategy = GetActions(ActionObjects.FolderShell); actionStrategy.Delete(sourcePath); } else { actionStrategy = GetActions(ActionObjects.FileShell); actionStrategy.Delete(sourcePath); } GoToPath(sourcePath.Substring(0, sourcePath.LastIndexOf('\\'))); } catch (NullReferenceException e) { ResponceToTheException(e, "Select an item to delete"); } }
public void CancelReadOnlyAttributes(ShellObject drive) { DirectoryInfo di = new DirectoryInfo(drive.Path); RemoveReadOnlyFlag(di); }