Fisheye: Tag 92ce91281efab19772bd3e2d7ecea2c0a6c8ea97 refers to a dead (removed) revision in file `Core/Common/src/Core.Common.Gui/Commands/ExportImportCommandHandler.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Core/Common/src/Core.Common.Gui/Commands/GuiExportHandler.cs
===================================================================
diff -u -r84355c65e37e079dedfb6037e16ff0c5b9fa8e64 -r92ce91281efab19772bd3e2d7ecea2c0a6c8ea97
--- Core/Common/src/Core.Common.Gui/Commands/GuiExportHandler.cs (.../GuiExportHandler.cs) (revision 84355c65e37e079dedfb6037e16ff0c5b9fa8e64)
+++ Core/Common/src/Core.Common.Gui/Commands/GuiExportHandler.cs (.../GuiExportHandler.cs) (revision 92ce91281efab19772bd3e2d7ecea2c0a6c8ea97)
@@ -32,9 +32,9 @@
namespace Core.Common.Gui.Commands
{
///
- /// Class responsible for data export commands.
+ /// Class responsible for handling export workflow with user interaction.
///
- public class GuiExportHandler
+ public class GuiExportHandler : IExportCommandHandler
{
private static readonly ILog log = LogManager.GetLogger(typeof(GuiExportHandler));
private static readonly Bitmap brickImage = Resources.brick;
@@ -53,12 +53,11 @@
this.exportInfos = exportInfos;
}
- ///
- /// Asks the user to select which exporter to use if multiple are available. Then
- /// if an exporter is found/selected, the user is asked for a location to export to.
- /// Finally the data is being exported from the source object.
- ///
- /// The export source.
+ public bool CanExportFrom(object source)
+ {
+ return GetSupportedExportInfos(source).Any();
+ }
+
public void ExportFrom(object source)
{
var exportInfo = GetSupportedExportInfoUsingDialog(source);
@@ -70,25 +69,27 @@
ExportItemUsingFileOpenDialog(exportInfo, source);
}
- ///
- /// Checks whether or not exporters are available for .
- ///
- /// The data object to check the export support for.
- /// Whether or not can be exported.
- public bool CanExportFrom(object source)
+ private IEnumerable GetSupportedExportInfos(object source)
{
- return GetSupportedExportInfos(source).Any();
+ if (source == null)
+ {
+ return Enumerable.Empty();
+ }
+
+ var sourceType = source.GetType();
+
+ return exportInfos.Where(info => (info.DataType == sourceType || sourceType.Implements(info.DataType)) && info.IsEnabled(source));
}
- private ExportInfo GetSupportedExportInfoUsingDialog(object itemToExport)
+ private ExportInfo GetSupportedExportInfoUsingDialog(object source)
{
- var supportedExportInfos = GetSupportedExportInfos(itemToExport).ToArray();
+ var supportedExportInfos = GetSupportedExportInfos(source).ToArray();
if (supportedExportInfos.Length == 0)
{
MessageBox.Show(Resources.GuiExportHandler_GetSupportedExporterForItemUsingDialog_No_exporter_for_this_item_available,
Resources.GuiExportHandler_GetSupportedExporterForItemUsingDialog_Error);
- var itemToExportType = itemToExport == null ? "null" : itemToExport.GetType().FullName;
+ var itemToExportType = source == null ? "null" : source.GetType().FullName;
log.Warn(string.Format(Resources.GuiExportHandler_GetSupportedExporterForItemUsingDialog_No_exporter_for_this_item_0_available, itemToExportType));
return null;
}
@@ -110,10 +111,11 @@
return supportedExportInfos.First(info => info.Name == selectExportInfoDialog.SelectedItemTypeName);
}
}
+
return null;
}
- private void ExportItemUsingFileOpenDialog(ExportInfo exportInfo, object item)
+ private void ExportItemUsingFileOpenDialog(ExportInfo exportInfo, object source)
{
log.Info(Resources.GuiExportHandler_ExporterItemUsingFileOpenDialog_Start_exporting);
@@ -127,30 +129,18 @@
{
if (saveFileDialog.ShowDialog(dialogParent) == DialogResult.OK)
{
- var exporter = exportInfo.CreateFileExporter(item, saveFileDialog.FileName);
+ var exporter = exportInfo.CreateFileExporter(source, saveFileDialog.FileName);
if (exporter.Export())
{
log.Info(Resources.GuiExportHandler_ExporterItemUsingFileOpenDialog_Finished_exporting);
}
else
{
- log.Warn(Resources.GuiExportHandler_ExporterItemUsingFileOpenDialog_Export_failed);
+ log.Error(Resources.GuiExportHandler_ExporterItemUsingFileOpenDialog_Export_failed);
}
}
}
}
-
- private IEnumerable GetSupportedExportInfos(object source)
- {
- if (source == null)
- {
- return Enumerable.Empty();
- }
-
- var sourceType = source.GetType();
-
- return exportInfos.Where(info => (info.DataType == sourceType || sourceType.Implements(info.DataType)) && info.IsEnabled(source));
- }
}
}
\ No newline at end of file
Index: Core/Common/src/Core.Common.Gui/Commands/GuiImportHandler.cs
===================================================================
diff -u -r5daa9f73f05cf59182cc6c3048f3174adc3ee3d9 -r92ce91281efab19772bd3e2d7ecea2c0a6c8ea97
--- Core/Common/src/Core.Common.Gui/Commands/GuiImportHandler.cs (.../GuiImportHandler.cs) (revision 5daa9f73f05cf59182cc6c3048f3174adc3ee3d9)
+++ Core/Common/src/Core.Common.Gui/Commands/GuiImportHandler.cs (.../GuiImportHandler.cs) (revision 92ce91281efab19772bd3e2d7ecea2c0a6c8ea97)
@@ -34,7 +34,7 @@
///
/// Class responsible for handling import workflow with user interaction.
///
- public class GuiImportHandler
+ public class GuiImportHandler : IImportCommandHandler
{
private static readonly ILog log = LogManager.GetLogger(typeof(GuiImportHandler));
@@ -52,20 +52,26 @@
this.fileImporters = fileImporters;
}
- ///
- /// Asks the user to select which importer to use if multiple are available. Then
- /// if an importer is found/selected, the user is asked for a source to import from.
- /// Finally the data is being imported to the target object.
- ///
- /// The import target.
- public void ImportDataTo(object target)
+ public bool CanImportOn(object target)
{
- ImportToItem(target);
+ return fileImporters.Any(fileImporter => fileImporter.CanImportOn(target));
}
- private IFileImporter GetSupportedImporterForTargetType(object target)
+ public void ImportOn(object target)
{
+ var importer = GetSupportedImporterUsingDialog(target);
+ if (importer == null)
+ {
+ return;
+ }
+
+ ImportItemsUsingFileOpenDialog(importer, target);
+ }
+
+ private IFileImporter GetSupportedImporterUsingDialog(object target)
+ {
var importers = fileImporters.Where(fileImporter => fileImporter.CanImportOn(target)).ToArray();
+
if (!importers.Any())
{
MessageBox.Show(Resources.GuiImportHandler_GetSupportedImporterForTargetType_No_importer_available_for_this_item,
@@ -75,7 +81,6 @@
return null;
}
- // If there is only one available importer use that:
if (importers.Length == 1)
{
return importers[0];
@@ -96,23 +101,14 @@
return importers.First(i => i.Name == selectImporterDialog.SelectedItemTypeName);
}
}
+
return null;
}
- private void ImportToItem(object item)
+ private void ImportItemsUsingFileOpenDialog(IFileImporter importer, object target)
{
- var importer = GetSupportedImporterForTargetType(item);
- if (importer == null)
- {
- return;
- }
-
- GetImportedItemsUsingFileOpenDialog(importer, item);
- }
-
- private void GetImportedItemsUsingFileOpenDialog(IFileImporter importer, object target)
- {
var windowTitle = string.Format(Resources.GuiImportHandler_GetImportedItemsUsingFileOpenDialog_Select_a_DataType_0_file_to_import_from, importer.Name);
+
using (var dialog = new OpenFileDialog
{
Filter = importer.FileFilter,
Index: Core/Common/src/Core.Common.Gui/Commands/IExportCommandHandler.cs
===================================================================
diff -u
--- Core/Common/src/Core.Common.Gui/Commands/IExportCommandHandler.cs (revision 0)
+++ Core/Common/src/Core.Common.Gui/Commands/IExportCommandHandler.cs (revision 92ce91281efab19772bd3e2d7ecea2c0a6c8ea97)
@@ -0,0 +1,48 @@
+// Copyright (C) Stichting Deltares 2016. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+namespace Core.Common.Gui.Commands
+{
+ ///
+ /// Interface declaring commands/methods related to exporting data.
+ ///
+ public interface IExportCommandHandler
+ {
+ ///
+ /// Indicates if there are exporters for the given source object.
+ ///
+ /// The source object to check exporter availability for.
+ /// true if there are exporters available, false otherwise.
+ bool CanExportFrom(object source);
+
+ ///
+ /// Perform the export workflow by the following steps:
+ ///
+ /// If multiple exporters are available for the source object, ask the user
+ /// which exporter to use;
+ /// Ask the user which file or file-destination to export to;
+ /// Export from the source object to the specified location.
+ ///
+ ///
+ /// The data object to export from.
+ void ExportFrom(object source);
+ }
+}
\ No newline at end of file
Fisheye: Tag 92ce91281efab19772bd3e2d7ecea2c0a6c8ea97 refers to a dead (removed) revision in file `Core/Common/src/Core.Common.Gui/Commands/IExportImportCommandHandler.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Core/Common/src/Core.Common.Gui/Commands/IImportCommandHandler.cs
===================================================================
diff -u
--- Core/Common/src/Core.Common.Gui/Commands/IImportCommandHandler.cs (revision 0)
+++ Core/Common/src/Core.Common.Gui/Commands/IImportCommandHandler.cs (revision 92ce91281efab19772bd3e2d7ecea2c0a6c8ea97)
@@ -0,0 +1,48 @@
+// Copyright (C) Stichting Deltares 2016. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+namespace Core.Common.Gui.Commands
+{
+ ///
+ /// Interface declaring commands/methods related to importing data.
+ ///
+ public interface IImportCommandHandler
+ {
+ ///
+ /// Indicates if there are importers for the given target object.
+ ///
+ /// The target object to check importer availability for.
+ /// true if there are importers available, false otherwise.
+ bool CanImportOn(object target);
+
+ ///
+ /// Perform the import workflow by the following steps:
+ ///
+ /// If multiple importers are available for the target object, ask the user
+ /// which importer to use;
+ /// Ask the user which file to use to import from;
+ /// Import from the user specified file to the target object.
+ ///
+ ///
+ /// The data object to import to.
+ void ImportOn(object target);
+ }
+}
\ No newline at end of file
Index: Core/Common/src/Core.Common.Gui/ContextMenu/ContextMenuBuilder.cs
===================================================================
diff -u -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 -r92ce91281efab19772bd3e2d7ecea2c0a6c8ea97
--- Core/Common/src/Core.Common.Gui/ContextMenu/ContextMenuBuilder.cs (.../ContextMenuBuilder.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5)
+++ Core/Common/src/Core.Common.Gui/ContextMenu/ContextMenuBuilder.cs (.../ContextMenuBuilder.cs) (revision 92ce91281efab19772bd3e2d7ecea2c0a6c8ea97)
@@ -40,24 +40,36 @@
///
/// Creates a new instance of .
///
- /// The from which to obtain information to render and bind actions
- /// to the items of the . If null, this builder will not render items which
- /// require this type of information.
- /// The
- /// from which to obtain information to render and bind actions to the items of the
- /// . If null, this builder will not render items
- /// which require this type of information.
- /// The from which
- /// to obtain information to render and bind actions to the items of the .
- /// If null, this builder will not render items which require this type of information.
+ /// The from which to obtain
+ /// information to render and bind actions to the items of the . If null,
+ /// this builder will not render items which require this type of information.
+ /// The from which to obtain
+ /// information to render and bind actions to the items of the . If null,
+ /// this builder will not render items which require this type of information.
+ /// The from which to obtain
+ /// information to render and bind actions to the items of the . If null,
+ /// this builder will not render items which require this type of information.
+ /// The from which to obtain information to render
+ /// and bind actions to the items of the . If null, this builder will not
+ /// render items which require this type of information.
/// The data object for which to create a .
/// The to use while executing the actions.
/// Thrown when the any input argument is null.
- public ContextMenuBuilder(IApplicationFeatureCommands featureCommandHandler, IExportImportCommandHandler importExportHandler, IViewCommands viewsCommandsHandler, object dataObject, TreeViewControl treeViewControl)
+ public ContextMenuBuilder(IApplicationFeatureCommands featureCommandHandler,
+ IImportCommandHandler importCommandHandler,
+ IExportCommandHandler exportCommandHandler,
+ IViewCommands viewCommands,
+ object dataObject,
+ TreeViewControl treeViewControl)
{
try
{
- guiItemsFactory = new GuiContextMenuItemFactory(featureCommandHandler, importExportHandler, viewsCommandsHandler, dataObject);
+ guiItemsFactory = new GuiContextMenuItemFactory(featureCommandHandler,
+ importCommandHandler,
+ exportCommandHandler,
+ viewCommands,
+ dataObject);
+
treeViewItemsFactory = new TreeViewContextMenuItemFactory(dataObject, treeViewControl);
}
catch (ArgumentNullException e)
Index: Core/Common/src/Core.Common.Gui/ContextMenu/GuiContextMenuItemFactory.cs
===================================================================
diff -u -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 -r92ce91281efab19772bd3e2d7ecea2c0a6c8ea97
--- Core/Common/src/Core.Common.Gui/ContextMenu/GuiContextMenuItemFactory.cs (.../GuiContextMenuItemFactory.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5)
+++ Core/Common/src/Core.Common.Gui/ContextMenu/GuiContextMenuItemFactory.cs (.../GuiContextMenuItemFactory.cs) (revision 92ce91281efab19772bd3e2d7ecea2c0a6c8ea97)
@@ -21,7 +21,6 @@
using System;
using System.Windows.Forms;
-
using Core.Common.Gui.Commands;
using Core.Common.Gui.Properties;
@@ -33,41 +32,58 @@
internal class GuiContextMenuItemFactory
{
private readonly IApplicationFeatureCommands applicationFeatureCommandHandler;
- private readonly IExportImportCommandHandler exportImportCommandHandler;
+ private readonly IImportCommandHandler importCommandHandler;
+ private readonly IExportCommandHandler exportCommandHandler;
private readonly IViewCommands viewCommands;
private readonly object dataObject;
///
/// Creates a new instance of .
///
- /// The which contains information for creating the
- /// .
- /// The
+ /// The
/// which contains information for creating the .
- /// The which contains
+ /// The which contains
/// information for creating the .
+ /// The which contains
+ /// information for creating the .
+ /// The which contains information for
+ /// creating the .
/// The data object for which to create .
/// Thrown when any input argument is null.
- public GuiContextMenuItemFactory(IApplicationFeatureCommands applicationFeatureCommandHandler, IExportImportCommandHandler exportImportCommandHandler, IViewCommands viewCommandsHandler, object dataObject)
+ public GuiContextMenuItemFactory(IApplicationFeatureCommands applicationFeatureCommandHandler,
+ IImportCommandHandler importCommandHandler,
+ IExportCommandHandler exportCommandHandler,
+ IViewCommands viewCommandsHandler,
+ object dataObject)
{
if (applicationFeatureCommandHandler == null)
{
- throw new ArgumentNullException("applicationFeatureCommandHandler", Resources.GuiContextMenuItemFactory_Can_not_create_gui_context_menu_items_without_gui);
+ throw new ArgumentNullException("applicationFeatureCommandHandler",
+ Resources.GuiContextMenuItemFactory_Can_not_create_gui_context_menu_items_without_gui);
}
- if (exportImportCommandHandler == null)
+ if (importCommandHandler == null)
{
- throw new ArgumentNullException("exportImportCommandHandler", Resources.GuiContextMenuItemFactory_Can_not_create_gui_context_menu_items_without_exportImport_handler);
+ throw new ArgumentNullException("importCommandHandler",
+ Resources.GuiContextMenuItemFactory_Can_not_create_gui_context_menu_items_without_import_handler);
}
+ if (exportCommandHandler == null)
+ {
+ throw new ArgumentNullException("exportCommandHandler",
+ Resources.GuiContextMenuItemFactory_Can_not_create_gui_context_menu_items_without_export_handler);
+ }
if (viewCommandsHandler == null)
{
- throw new ArgumentNullException("viewCommandsHandler", Resources.GuiContextMenuItemFactory_Can_not_create_gui_context_menu_items_without_view_commands);
+ throw new ArgumentNullException("viewCommandsHandler",
+ Resources.GuiContextMenuItemFactory_Can_not_create_gui_context_menu_items_without_view_commands);
}
if (dataObject == null)
{
- throw new ArgumentNullException("dataObject", Resources.ContextMenuItemFactory_Can_not_create_context_menu_items_without_data);
+ throw new ArgumentNullException("dataObject",
+ Resources.ContextMenuItemFactory_Can_not_create_context_menu_items_without_data);
}
this.applicationFeatureCommandHandler = applicationFeatureCommandHandler;
- this.exportImportCommandHandler = exportImportCommandHandler;
+ this.importCommandHandler = importCommandHandler;
+ this.exportCommandHandler = exportCommandHandler;
viewCommands = viewCommandsHandler;
this.dataObject = dataObject;
}
@@ -98,14 +114,14 @@
/// The created .
public ToolStripItem CreateExportItem()
{
- bool canExport = exportImportCommandHandler.CanExportFrom(dataObject);
+ bool canExport = exportCommandHandler.CanExportFrom(dataObject);
var newItem = new ToolStripMenuItem(Resources.Export)
{
ToolTipText = Resources.Export_ToolTip,
Image = Resources.ExportIcon,
Enabled = canExport
};
- newItem.Click += (s, e) => exportImportCommandHandler.ExportFrom(dataObject);
+ newItem.Click += (s, e) => exportCommandHandler.ExportFrom(dataObject);
return newItem;
}
@@ -117,14 +133,14 @@
/// The created .
public ToolStripItem CreateImportItem()
{
- bool canImport = exportImportCommandHandler.CanImportOn(dataObject);
+ bool canImport = importCommandHandler.CanImportOn(dataObject);
var newItem = new ToolStripMenuItem(Resources.Import)
{
ToolTipText = Resources.Import_ToolTip,
Image = Resources.ImportIcon,
Enabled = canImport
};
- newItem.Click += (s, e) => exportImportCommandHandler.ImportOn(dataObject);
+ newItem.Click += (s, e) => importCommandHandler.ImportOn(dataObject);
return newItem;
}
@@ -144,7 +160,7 @@
Enabled = canShowProperties
};
newItem.Click += (s, e) => applicationFeatureCommandHandler.ShowPropertiesFor(dataObject);
-
+
return newItem;
}
}
Index: Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj
===================================================================
diff -u -re25d2b8b5045ee7549f406cfb8a4ea0f81ec7a7d -r92ce91281efab19772bd3e2d7ecea2c0a6c8ea97
--- Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj (.../Core.Common.Gui.csproj) (revision e25d2b8b5045ee7549f406cfb8a4ea0f81ec7a7d)
+++ Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj (.../Core.Common.Gui.csproj) (revision 92ce91281efab19772bd3e2d7ecea2c0a6c8ea97)
@@ -104,12 +104,12 @@
-
-
+
+
Index: Core/Common/src/Core.Common.Gui/GuiCore.cs
===================================================================
diff -u -rba9236580e1e4361d4c5392c238f8b9930aaa90e -r92ce91281efab19772bd3e2d7ecea2c0a6c8ea97
--- Core/Common/src/Core.Common.Gui/GuiCore.cs (.../GuiCore.cs) (revision ba9236580e1e4361d4c5392c238f8b9930aaa90e)
+++ Core/Common/src/Core.Common.Gui/GuiCore.cs (.../GuiCore.cs) (revision 92ce91281efab19772bd3e2d7ecea2c0a6c8ea97)
@@ -118,9 +118,8 @@
viewCommandHandler = new ViewCommandHandler(this, this, this);
storageCommandHandler = new StorageCommandHandler(projectStore, this, MainWindow);
- exportImportCommandHandler = new ExportImportCommandHandler(MainWindow,
- Plugins.SelectMany(p => p.GetFileImporters()),
- Plugins.SelectMany(p => p.GetExportInfos()));
+ importCommandHandler = new GuiImportHandler(MainWindow, Plugins.SelectMany(p => p.GetFileImporters()));
+ exportCommandHandler = new GuiExportHandler(MainWindow, Plugins.SelectMany(p => p.GetExportInfos()));
WindowsApplication.EnableVisualStyles();
ViewPropertyEditor.ViewCommands = ViewCommands;
@@ -201,7 +200,13 @@
{
throw new InvalidOperationException("Call IGui.Run in order to initialize dependencies before getting the ContextMenuBuilder.");
}
- return new ContextMenuBuilder(applicationFeatureCommands, exportImportCommandHandler, ViewCommands, dataObject, treeViewControl);
+
+ return new ContextMenuBuilder(applicationFeatureCommands,
+ importCommandHandler,
+ exportCommandHandler,
+ ViewCommands,
+ dataObject,
+ treeViewControl);
}
#endregion
@@ -416,7 +421,7 @@
{
splashScreen = new SplashScreen
{
- VersionText = SettingsHelper.ApplicationVersion,
+ VersionText = SettingsHelper.ApplicationVersion
};
splashScreen.IsVisibleChanged += delegate
@@ -648,7 +653,8 @@
private ApplicationFeatureCommandHandler applicationFeatureCommands;
private readonly ViewCommandHandler viewCommandHandler;
- private readonly ExportImportCommandHandler exportImportCommandHandler;
+ private readonly GuiImportHandler importCommandHandler;
+ private readonly GuiExportHandler exportCommandHandler;
private StorageCommandHandler storageCommandHandler;
public IApplicationFeatureCommands ApplicationCommands
Index: Core/Common/src/Core.Common.Gui/Properties/Resources.Designer.cs
===================================================================
diff -u -r72da35fee21360783bf87322879144f16d7e7589 -r92ce91281efab19772bd3e2d7ecea2c0a6c8ea97
--- Core/Common/src/Core.Common.Gui/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 72da35fee21360783bf87322879144f16d7e7589)
+++ Core/Common/src/Core.Common.Gui/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 92ce91281efab19772bd3e2d7ecea2c0a6c8ea97)
@@ -1,25 +1,4 @@
-// Copyright (C) Stichting Deltares 2016. All rights reserved.
-//
-// This file is part of Ringtoets.
-//
-// Ringtoets is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with this program. If not, see .
-//
-// All names, logos, and references to "Deltares" are registered trademarks of
-// Stichting Deltares and remain full property of Stichting Deltares at all times.
-// All rights reserved.
-
-//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
//
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
@@ -564,15 +543,6 @@
}
///
- /// Looks up a localized string similar to Kan niet importeren naar {0}..
- ///
- public static string ExportImportCommandHandler_ImportOn_Unable_to_import_on_0_ {
- get {
- return ResourceManager.GetString("ExportImportCommandHandler_ImportOn_Unable_to_import_on_0_", resourceCulture);
- }
- }
-
- ///
/// Looks up a localized string similar to Toetsspoor.
///
public static string FailureMechanismContributionView_GridColumn_Assessment {
@@ -628,12 +598,12 @@
}
///
- /// Looks up a localized string similar to Kan geen 'IExportImportCommandHandler'-afhankelijk element in het contextmenu creëren zonder een 'IExportImportCommandHandler'..
+ /// Looks up a localized string similar to Kan geen 'IExportCommandHandler'-afhankelijk element in het contextmenu creëren zonder een 'IExportCommandHandler'..
///
- public static string GuiContextMenuItemFactory_Can_not_create_gui_context_menu_items_without_exportImport_handler {
+ public static string GuiContextMenuItemFactory_Can_not_create_gui_context_menu_items_without_export_handler {
get {
- return ResourceManager.GetString("GuiContextMenuItemFactory_Can_not_create_gui_context_menu_items_without_exportImp" +
- "ort_handler", resourceCulture);
+ return ResourceManager.GetString("GuiContextMenuItemFactory_Can_not_create_gui_context_menu_items_without_export_ha" +
+ "ndler", resourceCulture);
}
}
@@ -647,6 +617,16 @@
}
///
+ /// Looks up a localized string similar to Kan geen 'IImportCommandHandler'-afhankelijk element in het contextmenu creëren zonder een 'IImportCommandHandler'..
+ ///
+ public static string GuiContextMenuItemFactory_Can_not_create_gui_context_menu_items_without_import_handler {
+ get {
+ return ResourceManager.GetString("GuiContextMenuItemFactory_Can_not_create_gui_context_menu_items_without_import_ha" +
+ "ndler", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to Kan geen 'IViewCommands'-afhankelijk element in het contextmenu creëren zonder een 'IViewCommands'..
///
public static string GuiContextMenuItemFactory_Can_not_create_gui_context_menu_items_without_view_commands {
Index: Core/Common/src/Core.Common.Gui/Properties/Resources.resx
===================================================================
diff -u -r72da35fee21360783bf87322879144f16d7e7589 -r92ce91281efab19772bd3e2d7ecea2c0a6c8ea97
--- Core/Common/src/Core.Common.Gui/Properties/Resources.resx (.../Resources.resx) (revision 72da35fee21360783bf87322879144f16d7e7589)
+++ Core/Common/src/Core.Common.Gui/Properties/Resources.resx (.../Resources.resx) (revision 92ce91281efab19772bd3e2d7ecea2c0a6c8ea97)
@@ -148,9 +148,6 @@
Weergeven/Verbergen
-
- Kan niet importeren naar {0}.
-
..\Resources\openfolderHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
@@ -520,9 +517,12 @@
Het Ringtoetsproject '{0}' is succesvol opgeslagen.
-
- Kan geen 'IExportImportCommandHandler'-afhankelijk element in het contextmenu creëren zonder een 'IExportImportCommandHandler'.
+
+ Kan geen 'IImportCommandHandler'-afhankelijk element in het contextmenu creëren zonder een 'IImportCommandHandler'.
+
+ Kan geen 'IExportCommandHandler'-afhankelijk element in het contextmenu creëren zonder een 'IExportCommandHandler'.
+
Kan geen 'IViewCommands'-afhankelijk element in het contextmenu creëren zonder een 'IViewCommands'.
Fisheye: Tag 92ce91281efab19772bd3e2d7ecea2c0a6c8ea97 refers to a dead (removed) revision in file `Core/Common/test/Core.Common.Gui.Test/Commands/ExportImportCommandHandlerTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Core/Common/test/Core.Common.Gui.Test/Commands/GuiExportHandlerTest.cs
===================================================================
diff -u -rdd84dcabe5561e637e4ade45457437d9c037535b -r92ce91281efab19772bd3e2d7ecea2c0a6c8ea97
--- Core/Common/test/Core.Common.Gui.Test/Commands/GuiExportHandlerTest.cs (.../GuiExportHandlerTest.cs) (revision dd84dcabe5561e637e4ade45457437d9c037535b)
+++ Core/Common/test/Core.Common.Gui.Test/Commands/GuiExportHandlerTest.cs (.../GuiExportHandlerTest.cs) (revision 92ce91281efab19772bd3e2d7ecea2c0a6c8ea97)
@@ -21,6 +21,8 @@
using System;
using System.Collections.Generic;
+using System.Linq;
+using System.Windows.Forms;
using Core.Common.Base.IO;
using Core.Common.Gui.Commands;
using Core.Common.Gui.Forms.MainWindow;
@@ -200,6 +202,67 @@
mockRepository.VerifyAll();
}
+ [Test]
+ public void CanExportFrom_HasNoFileExportersForTarget_ReturnFalse()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var dialogParent = mocks.Stub();
+ mocks.ReplayAll();
+
+ var commandHandler = new GuiExportHandler(dialogParent, Enumerable.Empty());
+
+ // Call
+ var isExportPossible = commandHandler.CanExportFrom(new object());
+
+ // Assert
+ Assert.IsFalse(isExportPossible);
+ mocks.VerifyAll();
+ }
+
+ [Test]
+ public void CanExportFrom_HasOneFileExporterForTarget_ReturnTrue()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var dialogParent = mocks.Stub();
+ mocks.ReplayAll();
+
+ var commandHandler = new GuiExportHandler(dialogParent, new List
+ {
+ new ExportInfo