Index: Core/Common/src/Core.Common.Base/IO/IFileExporter.cs
===================================================================
diff -u -rdd84dcabe5561e637e4ade45457437d9c037535b -r2e73db6bbdd25adf8d0e26a2db9f862e2ed3c191
--- Core/Common/src/Core.Common.Base/IO/IFileExporter.cs (.../IFileExporter.cs) (revision dd84dcabe5561e637e4ade45457437d9c037535b)
+++ Core/Common/src/Core.Common.Base/IO/IFileExporter.cs (.../IFileExporter.cs) (revision 2e73db6bbdd25adf8d0e26a2db9f862e2ed3c191)
@@ -30,7 +30,6 @@
/// This method performs the export routine.
///
/// true if the export was successful, false otherwise.
- /// Implementations of this export method are allowed to throw exceptions of any kind.
bool Export();
}
}
\ No newline at end of file
Index: Core/Common/src/Core.Common.Gui/Commands/GuiExportHandler.cs
===================================================================
diff -u -r77c945bdf8a9d69da89a86c7b943250e51f0cc39 -r2e73db6bbdd25adf8d0e26a2db9f862e2ed3c191
--- Core/Common/src/Core.Common.Gui/Commands/GuiExportHandler.cs (.../GuiExportHandler.cs) (revision 77c945bdf8a9d69da89a86c7b943250e51f0cc39)
+++ Core/Common/src/Core.Common.Gui/Commands/GuiExportHandler.cs (.../GuiExportHandler.cs) (revision 2e73db6bbdd25adf8d0e26a2db9f862e2ed3c191)
@@ -23,6 +23,7 @@
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
+using Core.Common.Base.IO;
using Core.Common.Gui.Forms;
using Core.Common.Gui.Plugin;
using Core.Common.Gui.Properties;
@@ -60,7 +61,7 @@
public void ExportFrom(object source)
{
- var exportInfo = GetSupportedExportInfoUsingDialog(source);
+ ExportInfo exportInfo = GetSupportedExportInfoUsingDialog(source);
if (exportInfo == null)
{
return;
@@ -83,13 +84,13 @@
private ExportInfo GetSupportedExportInfoUsingDialog(object source)
{
- var supportedExportInfos = GetSupportedExportInfos(source).ToArray();
+ ExportInfo[] 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 = source == null ? "null" : source.GetType().FullName;
+ string itemToExportType = source == null ? "null" : source.GetType().FullName;
log.Warn(string.Format(Resources.GuiExportHandler_GetSupportedExporterForItemUsingDialog_No_exporter_for_this_item_0_available, itemToExportType));
return null;
}
@@ -117,7 +118,8 @@
private void ExportItemUsingFileOpenDialog(ExportInfo exportInfo, object source)
{
- var windowTitle = string.Format(Resources.GuiExportHandler_ExporterItemUsingFileOpenDialog_Select_a_DataType_0_file_to_export_to, exportInfo.Name);
+ string windowTitle = string.Format(Resources.GuiExportHandler_ExporterItemUsingFileOpenDialog_Select_a_DataType_0_file_to_export_to,
+ exportInfo.Name);
using (var saveFileDialog = new SaveFileDialog
{
Filter = exportInfo.FileFilter,
@@ -129,7 +131,7 @@
{
log.Info(Resources.GuiExportHandler_ExporterItemUsingFileOpenDialog_Start_exporting);
- var exporter = exportInfo.CreateFileExporter(source, saveFileDialog.FileName);
+ IFileExporter exporter = exportInfo.CreateFileExporter(source, saveFileDialog.FileName);
if (exporter.Export())
{
Index: Core/Common/src/Core.Common.Gui/Commands/GuiImportHandler.cs
===================================================================
diff -u -r77c945bdf8a9d69da89a86c7b943250e51f0cc39 -r2e73db6bbdd25adf8d0e26a2db9f862e2ed3c191
--- Core/Common/src/Core.Common.Gui/Commands/GuiImportHandler.cs (.../GuiImportHandler.cs) (revision 77c945bdf8a9d69da89a86c7b943250e51f0cc39)
+++ Core/Common/src/Core.Common.Gui/Commands/GuiImportHandler.cs (.../GuiImportHandler.cs) (revision 2e73db6bbdd25adf8d0e26a2db9f862e2ed3c191)
@@ -20,6 +20,7 @@
// All rights reserved.
using System.Collections.Generic;
+using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using Core.Common.Base.IO;
@@ -59,7 +60,7 @@
public void ImportOn(object target)
{
- var importer = GetSupportedImporterUsingDialog(target);
+ IFileImporter importer = GetSupportedImporterUsingDialog(target);
if (importer == null)
{
return;
@@ -70,7 +71,7 @@
private IFileImporter GetSupportedImporterUsingDialog(object target)
{
- var importers = fileImporters.Where(fileImporter => fileImporter.CanImportOn(target)).ToArray();
+ IFileImporter[] importers = fileImporters.Where(fileImporter => fileImporter.CanImportOn(target)).ToArray();
if (!importers.Any())
{
@@ -90,8 +91,10 @@
{
foreach (IFileImporter importer in importers)
{
- var category = string.IsNullOrEmpty(importer.Category) ? Resources.GuiImportHandler_GetSupportedImporterForTargetType_Data_Import : importer.Category;
- var itemImage = importer.Image ?? Resources.brick;
+ string category = string.IsNullOrEmpty(importer.Category) ?
+ Resources.GuiImportHandler_GetSupportedImporterForTargetType_Data_Import :
+ importer.Category;
+ Bitmap itemImage = importer.Image ?? Resources.brick;
selectImporterDialog.AddItemType(importer.Name, category, itemImage, null);
}
@@ -121,7 +124,8 @@
{
log.Info(Resources.GuiImportHandler_GetImportedItemsUsingFileOpenDialog_Start_importing_data);
- ActivityProgressDialogRunner.Run(dialogParent, dialog.FileNames.Select(f => new FileImportActivity(importer, target, f)).ToList());
+ FileImportActivity[] importActivitiesToRun = dialog.FileNames.Select(f => new FileImportActivity(importer, target, f)).ToArray();
+ ActivityProgressDialogRunner.Run(dialogParent, importActivitiesToRun);
}
}
}
Index: Core/Common/src/Core.Common.Gui/Plugin/ExportInfo.cs
===================================================================
diff -u -reff4bc47aee9786f42f3aa60728840b0793d6f96 -r2e73db6bbdd25adf8d0e26a2db9f862e2ed3c191
--- Core/Common/src/Core.Common.Gui/Plugin/ExportInfo.cs (.../ExportInfo.cs) (revision eff4bc47aee9786f42f3aa60728840b0793d6f96)
+++ Core/Common/src/Core.Common.Gui/Plugin/ExportInfo.cs (.../ExportInfo.cs) (revision 2e73db6bbdd25adf8d0e26a2db9f862e2ed3c191)
@@ -149,9 +149,9 @@
return new ExportInfo
{
DataType = exportInfo.DataType,
- CreateFileExporter = (data, filePath) => exportInfo.CreateFileExporter != null
- ? exportInfo.CreateFileExporter((TData) data, filePath)
- : null,
+ CreateFileExporter = (data, filePath) => exportInfo.CreateFileExporter != null ?
+ exportInfo.CreateFileExporter((TData) data, filePath) :
+ null,
IsEnabled = data => exportInfo.IsEnabled == null || exportInfo.IsEnabled((TData) data),
Name = exportInfo.Name,
Category = exportInfo.Category,
Index: Core/Common/src/Core.Common.Gui/Plugin/PropertyInfo.cs
===================================================================
diff -u -rdd84dcabe5561e637e4ade45457437d9c037535b -r2e73db6bbdd25adf8d0e26a2db9f862e2ed3c191
--- Core/Common/src/Core.Common.Gui/Plugin/PropertyInfo.cs (.../PropertyInfo.cs) (revision dd84dcabe5561e637e4ade45457437d9c037535b)
+++ Core/Common/src/Core.Common.Gui/Plugin/PropertyInfo.cs (.../PropertyInfo.cs) (revision 2e73db6bbdd25adf8d0e26a2db9f862e2ed3c191)
@@ -148,15 +148,15 @@
{
DataType = typeof(TObject),
PropertyObjectType = typeof(TProperty),
- AdditionalDataCheck = propertyInfo.AdditionalDataCheck != null
- ? o => propertyInfo.AdditionalDataCheck((TObject) o)
- : (Func