-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Bug fixes. - Conversion performance improvments.
- Loading branch information
Showing
33 changed files
with
805 additions
and
731 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using Audio.GUI.ViewModels; | ||
using Avalonia.Input; | ||
using Avalonia.Platform.Storage; | ||
using Avalonia.Xaml.Interactions.DragAndDrop; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
|
||
namespace Audio.GUI.Behaviours; | ||
public class FileDropBehaviour : DropHandlerBase | ||
{ | ||
public override bool Execute(object? sender, DragEventArgs e, object? sourceContext, object? targetContext, object? state) | ||
{ | ||
if (targetContext is MainViewModel mainViewModel) | ||
{ | ||
List<string> files = []; | ||
|
||
foreach(IStorageItem? storageItem in e.Data.GetFiles() ?? []) | ||
{ | ||
string? path = storageItem.TryGetLocalPath(); | ||
if (!string.IsNullOrWhiteSpace(path)) | ||
{ | ||
if (Directory.Exists(path)) | ||
{ | ||
files.AddRange(Directory.GetFiles(path, "*.*", SearchOption.AllDirectories)); | ||
} | ||
else if (File.Exists(path)) | ||
{ | ||
files.Add(path); | ||
} | ||
} | ||
} | ||
|
||
_ = mainViewModel.LoadFiles(files); | ||
|
||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
public override bool Validate(object? sender, DragEventArgs e, object? sourceContext, object? targetContext, object? state) | ||
{ | ||
return targetContext is MainViewModel && e.Data.Contains(DataFormats.Files); | ||
} | ||
} |
48 changes: 0 additions & 48 deletions
48
Audio.GUI/Behaviours/ScrollToEndOnCollectionChangedBehaviour.cs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.