Skip to content
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
518c4ed
Implement Undo, Redo
d2dyno1 Nov 16, 2020
fbecac7
Reenable TerminalController.Init
d2dyno1 Nov 16, 2020
f072d88
CodeFactor
d2dyno1 Nov 16, 2020
d5e690b
Update1 (Read description for more information)
d2dyno1 Nov 17, 2020
b303f0f
Small Optimisations
d2dyno1 Nov 17, 2020
78c5ac2
Update2 (Read description for more information)
d2dyno1 Nov 17, 2020
8dc93f9
Update2
d2dyno1 Nov 18, 2020
36d4599
Added Null Checks
d2dyno1 Nov 18, 2020
b05f1ca
Code naming fixes
d2dyno1 Nov 19, 2020
d6a9878
Fixed couple issues + build error (read description)
d2dyno1 Nov 19, 2020
a9bb74e
Fixed Copying/Moving .lnk Files
d2dyno1 Nov 20, 2020
cd20fa0
Code optimizations
d2dyno1 Nov 20, 2020
88b7b3f
Ditched the Throttle() function
d2dyno1 Nov 20, 2020
cba9fa7
Fixed Drag and Drop associatedInstance null issue
d2dyno1 Nov 20, 2020
e1342d9
Fixed spamming CTRL+Z CTRL+Y causing crash + Code cleanup
d2dyno1 Nov 20, 2020
40220c0
Fixes an issue where a folder wouldn't be copied to the same directory
d2dyno1 Nov 20, 2020
cf60ec3
Files no longer crash if the source folder is copied to source folder
d2dyno1 Nov 20, 2020
e979bf2
Fixes
d2dyno1 Nov 20, 2020
592e676
Fixes (read description)
d2dyno1 Nov 20, 2020
3435dab
Shortcut items now work with Undo, Redo but... (read description)
d2dyno1 Nov 20, 2020
2773f05
Fixed Redo
d2dyno1 Nov 20, 2020
4da5879
Dramatically improved reliability of IStorageHistory + Cleaned uo code
d2dyno1 Nov 21, 2020
55514c7
Fixed an issue with deleting shortcut items
d2dyno1 Nov 21, 2020
a8b1856
Merge branch 'master' into master
d2dyno1 Nov 21, 2020
71be385
Small code improvements
d2dyno1 Nov 21, 2020
2546a5d
Merge branch 'master' of https://github.com/d2dyno1/Files
d2dyno1 Nov 21, 2020
99c16ce
Code cleanup
d2dyno1 Nov 22, 2020
918f679
CodeFactor
d2dyno1 Nov 22, 2020
cdeda49
Resolved Merge issues
d2dyno1 Nov 22, 2020
b7503cf
Update FilesystemOperations from merge
d2dyno1 Nov 22, 2020
adad102
Uncomment TerminalController.Init()
d2dyno1 Nov 22, 2020
40d7088
Update Files/DataModels/ReturnResult.cs
d2dyno1 Nov 22, 2020
da647ac
Fixed redo crash after deleting from recycle bin
d2dyno1 Nov 22, 2020
4447587
Merge branch 'master' of https://github.com/d2dyno1/Files
d2dyno1 Nov 22, 2020
85652d1
Fixed StorageHistoryIndex index, added App.RemoveHistory()
d2dyno1 Nov 22, 2020
6613dc7
Improved Codestyle
d2dyno1 Nov 23, 2020
0d5d124
Move enums to Enums folder
tsvietOK Nov 23, 2020
3a05769
Code align
tsvietOK Nov 23, 2020
2d04b1a
Removed unnecessary code
d2dyno1 Nov 23, 2020
f5aa01e
Update Repo
d2dyno1 Nov 23, 2020
2bdd9a4
Fixes (read description)
d2dyno1 Nov 24, 2020
afc6e87
Fix compilation error
d2dyno1 Nov 24, 2020
7123af5
Created a wrapper class for storage history list
d2dyno1 Nov 27, 2020
eec5a68
Fixed an issue where folders wouldn't be copied
d2dyno1 Nov 27, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions Files/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Files.Controllers;
using Files.Controls;
using Files.Filesystem;
using Files.Filesystem.FilesystemHistory;
using Files.Helpers;
using Files.View_Models;
using Files.Views;
Expand All @@ -17,6 +18,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
Expand All @@ -37,6 +39,13 @@ sealed partial class App : Application
{
private static bool ShowErrorNotification = false;

private readonly static CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
public static CancellationToken CancellationToken = cancellationTokenSource.Token;

public static SemaphoreSlim SemaphoreSlim = new SemaphoreSlim(1, 1);
public static readonly List<IStorageHistory> StorageHistory = new List<IStorageHistory>();
public static int StorageHistoryIndex = 0;

public static SettingsViewModel AppSettings { get; set; }
public static InteractionViewModel InteractionViewModel { get; set; }
public static JumpListManager JumpList { get; } = new JumpListManager();
Expand All @@ -59,6 +68,30 @@ public App()
StartAppCenter();
}

public static void AddHistory(IStorageHistory history)
{
if (history != null)
{
StorageHistory.Add(history);
if (StorageHistory.Count > 1)
{
StorageHistoryIndex++;
}
}
}

public static void RemoveHistory(IStorageHistory history)
{
if (history != null)
{
StorageHistory.Remove(history);

StorageHistoryIndex--;
int index = ArrayHelpers.FitBounds(StorageHistoryIndex, StorageHistory.Count);
StorageHistoryIndex = index;
}
}

private async void StartAppCenter()
{
JObject obj;
Expand Down
11 changes: 7 additions & 4 deletions Files/BaseLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ public BaseLayout()
{
SelectedItemsPropertiesViewModel = new SelectedItemsPropertiesViewModel(this);
DirectoryPropertiesViewModel = new DirectoryPropertiesViewModel();

// QuickLook Integration
ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
var isQuickLookIntegrationEnabled = localSettings.Values["quicklook_enabled"];
Expand All @@ -163,6 +164,8 @@ public BaseLayout()

public abstract void SetSelectedItemsOnUi(List<ListedItem> selectedItems);

public abstract void AddSelectedItemsOnUi(List<ListedItem> selectedItems);

private void ClearShellContextMenus(MenuFlyout menuFlyout)
{
var contextMenuItems = menuFlyout.Items.Where(c => c.Tag != null && ParseContextMenuTag(c.Tag).menuHandle != null).ToList();
Expand Down Expand Up @@ -597,13 +600,13 @@ protected async void List_DragOver(object sender, DragEventArgs e)
deferral.Complete();
}

protected void List_Drop(object sender, DragEventArgs e)
protected async void List_Drop(object sender, DragEventArgs e)
{
var deferral = e.GetDeferral();

if (e.DataView.Contains(StandardDataFormats.StorageItems))
{
ParentShellPageInstance.InteractionOperations.ItemOperationCommands.PasteItemWithStatus(e.DataView, ParentShellPageInstance.FilesystemViewModel.WorkingDirectory, e.AcceptedOperation);
await ParentShellPageInstance.InteractionOperations.FilesystemHelpers.PerformOperationTypeAsync(e.AcceptedOperation, e.DataView, ParentShellPageInstance.FilesystemViewModel.WorkingDirectory, true);
e.Handled = true;
}

Expand Down Expand Up @@ -703,13 +706,13 @@ protected async void Item_DragOver(object sender, DragEventArgs e)
deferral.Complete();
}

protected void Item_Drop(object sender, DragEventArgs e)
protected async void Item_Drop(object sender, DragEventArgs e)
{
var deferral = e.GetDeferral();

e.Handled = true;
ListedItem rowItem = GetItemFromElement(sender);
ParentShellPageInstance.InteractionOperations.ItemOperationCommands.PasteItemWithStatus(e.DataView, (rowItem as ShortcutItem)?.TargetPath ?? rowItem.ItemPath, e.AcceptedOperation);
await ParentShellPageInstance.InteractionOperations.FilesystemHelpers.PerformOperationTypeAsync(e.AcceptedOperation, e.DataView, (rowItem as ShortcutItem)?.TargetPath ?? rowItem.ItemPath, true);
deferral.Complete();
}

Expand Down
195 changes: 0 additions & 195 deletions Files/Commands/Delete.cs

This file was deleted.

12 changes: 0 additions & 12 deletions Files/Commands/ItemOperations.cs

This file was deleted.

Loading