diff options
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/Storage')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/DefaultStorageProvider.cs | 23 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.Common/Storage/IStorageProvider.cs | 6 |
2 files changed, 13 insertions, 16 deletions
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<String, Action<List<ExplorerFileItem>>> _fileHandlers; + private Dictionary<String, Action<ExplorerFileItem>> _fileHandlers; /// <summary> /// Occurs when a new storage drive has been inserted. @@ -58,7 +58,7 @@ namespace Tango.PPC.Common.Storage /// </summary> public DefaultStorageProvider(IPPCApplicationManager applicationManager) { - _fileHandlers = new Dictionary<string, Action<List<ExplorerFileItem>>>(); + _fileHandlers = new Dictionary<string, Action<ExplorerFileItem>>(); var drives = DriveInfo.GetDrives().Where(x => x.DriveType == DriveType.Removable).ToList(); if (drives.Count > 0) @@ -86,7 +86,7 @@ namespace Tango.PPC.Common.Storage /// <param name="extension">The file extension.</param> /// <param name="handler">The handler.</param> /// <exception cref="System.InvalidOperationException">Cannot register multiple file handlers for the same extension.</exception> - public void RegisterFileHandler(string extension, Action<List<ExplorerFileItem>> handler) + public void RegisterFileHandler(string extension, Action<ExplorerFileItem> handler) { if (_fileHandlers.ContainsKey(extension)) { @@ -99,7 +99,7 @@ namespace Tango.PPC.Common.Storage /// Unregisters the file handler. /// </summary> /// <param name="handler">The handler.</param> - public void UnregisterFileHandler(Action<List<ExplorerFileItem>> handler) + public void UnregisterFileHandler(Action<ExplorerFileItem> handler) { var h = _fileHandlers.SingleOrDefault(x => x.Value == handler); @@ -112,17 +112,14 @@ namespace Tango.PPC.Common.Storage /// <summary> /// Submits a file selection. /// </summary> - /// <param name="fileItems">The file item.</param> - public void SubmitFileSelection(List<ExplorerFileItem> fileItems) + /// <param name="fileItem">The file item.</param> + 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 /// </summary> /// <param name="extension">The file extension.</param> /// <param name="handler">The handler.</param> - void RegisterFileHandler(String extension, Action<List<ExplorerFileItem>> handler); + void RegisterFileHandler(String extension, Action<ExplorerFileItem> handler); /// <summary> /// Unregisters the file handler. /// </summary> /// <param name="handler">The handler.</param> - void UnregisterFileHandler(Action<List<ExplorerFileItem>> handler); + void UnregisterFileHandler(Action<ExplorerFileItem> handler); /// <summary> /// Submits a file selection. /// </summary> /// <param name="fileItem">The file item.</param> - void SubmitFileSelection(List<ExplorerFileItem> fileItems); + void SubmitFileSelection(ExplorerFileItem fileItem); } } |
