You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.
When delete a file or multiples a from project/solution using the ContextMenu option "Delete" those files will not goes to TRASH/RecycleBin.
I thing that the semantic of delete is correct, but on a computer when a user: Delete a file the expected behavior is "move to trash" like when he Delete a text on Text Editor the expected behavior is possible to "Undo"
TEST ON: Visual Studio for Mac (8.9 Preview Build 265) which is based on MonoDevelop.
Tracking where is problem in code
After search in repository with better keyword "Exclude From Project".
Improve message inside method ProjectFileNodeBuilder.DeleteMultipleItems alerting the user that file will be permanent delete (not moved to trash)
GettextCatalog.GetString ("Are you sure you want to delete the selected files and " +
Possible Solution - 02
Find a .NET library (if license allow) that provide a cross OS implementation of "move to trash".
Microsoft.VisualBasic.FileIO.FileSystem.DeleteFile (but is i don't know if available on all OS)
Possible Solution - 03
Should be Implement this expect behavior "move to trash" on MonoDevelop, but I'm not ready to provide a possible "implementation", because I'm new with c# and MonoDevelop code base
Possible Solution - 04
:) Ask .NET Framework (Microsoft) to support this kind of operation System.IO.File
Most o solutions/software relay on low level IO to delete and not move to trash, that is not what a user expect
Maybe this should be solved at .NET Framework/Mono level or extracted as external library
Problem
When delete a file or multiples a from project/solution using the ContextMenu option "Delete" those files will not goes to TRASH/RecycleBin.
I thing that the semantic of delete is correct, but on a computer when a user: Delete a file the expected behavior is "move to trash" like when he Delete a text on Text Editor the expected behavior is possible to "Undo"
TEST ON: Visual Studio for Mac (8.9 Preview Build 265) which is based on MonoDevelop.
Tracking where is problem in code
After search in repository with better keyword "Exclude From Project".
The method "DeleteMultipleItems" handler the "Delete" Command has the attribute [CommandHandler (EditCommands.Delete)].
Can found at
https://github.com/mono/monodevelop/blob/master/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs
DeleteMultipleItems will invoke RemoveFilesFromProject wich invoke FileService.DeleteFile https://github.com/mono/monodevelop/blob/master/main/src/core/MonoDevelop.Core/MonoDevelop.Core/FileService.cs
FilService will lookup for the "Correct "FileSystemExtension ("/MonoDevelop/Core/FileSystemExtensions"), which is
DummyFileSystemExtension if I'm correct which is part of "Core Addins". Core Addins "Extensions Model" https://github.com/mono/monodevelop/blob/master/main/src/core/MonoDevelop.Core/MonoDevelop.Core.addin.xml
Implmentations using System.IO.File.DeleteFile (permanent delete)
Possible Solution - 01
Improve message inside method ProjectFileNodeBuilder.DeleteMultipleItems alerting the user that file will be permanent delete (not moved to trash)
GettextCatalog.GetString ("Are you sure you want to delete the selected files and " +
Possible Solution - 02
Find a .NET library (if license allow) that provide a cross OS implementation of "move to trash".
Possible Solution - 03
Should be Implement this expect behavior "move to trash" on MonoDevelop, but I'm not ready to provide a possible "implementation", because I'm new with c# and MonoDevelop code base
Possible Solution - 04
:) Ask .NET Framework (Microsoft) to support this kind of operation System.IO.File
Trash API
Operative System (OS) References
-- Foundation/FileManager trashItem https://developer.apple.com/documentation/foundation/filemanager/1414306-trashitem
-- Xamarin SDK (FileManager) https://docs.microsoft.com/en-us/dotnet/api/foundation.nsfilemanager.trashitem?view=xamarin-ios-sdk-12#Foundation_NSFileManager_TrashItem_Foundation_NSUrl_Foundation_NSUrl__Foundation_NSError__
-- MUST confirm Implementations for: KDE, GNOME, ...
Conclusion
Most o solutions/software relay on low level IO to delete and not move to trash, that is not what a user expect
Maybe this should be solved at .NET Framework/Mono level or extracted as external library
Others References
The text was updated successfully, but these errors were encountered: