From 00a491d93733d4625ad329b2ba8237f445364b3f Mon Sep 17 00:00:00 2001 From: Mirta Date: Wed, 30 Dec 2020 16:39:52 +0200 Subject: merge --- .../Storage/DefaultStorageProvider.cs | 23 ++++++++++------------ .../Tango.PPC.Common/Storage/IStorageProvider.cs | 6 +++--- 2 files changed, 13 insertions(+), 16 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/Storage') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/DefaultStorageProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/DefaultStorageProvider.cs index 5f097d303..46315e4b8 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/DefaultStorageProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/DefaultStorageProvider.cs @@ -21,7 +21,7 @@ namespace Tango.PPC.Common.Storage public class DefaultStorageProvider : ExtendedObject, IStorageProvider { private Thread _scanThread; - private Dictionary>> _fileHandlers; + private Dictionary> _fileHandlers; /// /// Occurs when a new storage drive has been inserted. @@ -58,7 +58,7 @@ namespace Tango.PPC.Common.Storage /// public DefaultStorageProvider(IPPCApplicationManager applicationManager) { - _fileHandlers = new Dictionary>>(); + _fileHandlers = new Dictionary>(); var drives = DriveInfo.GetDrives().Where(x => x.DriveType == DriveType.Removable).ToList(); if (drives.Count > 0) @@ -86,7 +86,7 @@ namespace Tango.PPC.Common.Storage /// The file extension. /// The handler. /// Cannot register multiple file handlers for the same extension. - public void RegisterFileHandler(string extension, Action> handler) + public void RegisterFileHandler(string extension, Action handler) { if (_fileHandlers.ContainsKey(extension)) { @@ -99,7 +99,7 @@ namespace Tango.PPC.Common.Storage /// Unregisters the file handler. /// /// The handler. - public void UnregisterFileHandler(Action> handler) + public void UnregisterFileHandler(Action handler) { var h = _fileHandlers.SingleOrDefault(x => x.Value == handler); @@ -112,17 +112,14 @@ namespace Tango.PPC.Common.Storage /// /// Submits a file selection. /// - /// The file item. - public void SubmitFileSelection(List fileItems) + /// The file item. + public void SubmitFileSelection(ExplorerFileItem fileItem) { - if (fileItems != null && fileItems.Count > 0) - { - String extension = Path.GetExtension(fileItems.First().Path); + String extension = Path.GetExtension(fileItem.Path); - if (_fileHandlers.ContainsKey(extension)) - { - _fileHandlers[extension].Invoke(fileItems); - } + if (_fileHandlers.ContainsKey(extension)) + { + _fileHandlers[extension].Invoke(fileItem); } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/IStorageProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/IStorageProvider.cs index 2a9cf4e90..902021002 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/IStorageProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/IStorageProvider.cs @@ -38,18 +38,18 @@ namespace Tango.PPC.Common.Storage /// /// The file extension. /// The handler. - void RegisterFileHandler(String extension, Action> handler); + void RegisterFileHandler(String extension, Action handler); /// /// Unregisters the file handler. /// /// The handler. - void UnregisterFileHandler(Action> handler); + void UnregisterFileHandler(Action handler); /// /// Submits a file selection. /// /// The file item. - void SubmitFileSelection(List fileItems); + void SubmitFileSelection(ExplorerFileItem fileItem); } } -- cgit v1.3.1