[mapguide-commits] r8183 - in trunk/Tools/Maestro: ExtendedModels/LayerDefinition-1.1.0 ExtendedModels/LayerDefinition-1.2.0 ExtendedModels/LayerDefinition-1.3.0 ExtendedModels/LayerDefinition-2.3.0 ExtendedModels/LayerDefinition-2.4.0 ExtendedModels/LoadProcedure-1.1.0 ExtendedModels/LoadProcedure-2.2.0 ExtendedModels/MapDefinition-2.3.0 ExtendedModels/MapDefinition-2.4.0 ExtendedModels/SymbolDefinition-1.1.0 ExtendedModels/SymbolDefinition-2.4.0 ExtendedModels/WatermarkDefinition-2.3.0 ExtendedModels/WebLayout-1.1.0 Maestro.AddIn.ExtendedObjectModels/Editor Maestro.AddIn.ExtendedObjectModels/Templates Maestro.AddIn.Local/Services Maestro.AddIn.Scripting/Services Maestro.Base/Commands Maestro.Base/Commands/SiteExplorer Maestro.Base/Commands/Test Maestro.Base/Editor Maestro.Base/Services Maestro.Base/Services/DragDropHandlers Maestro.Base/Templates Maestro.Base/UI Maestro.Editors Maestro.Editors/Common Maestro.Editors/Diff Maestro.Editors/FeatureSource Maestro.Editors/FeatureSource/Ext ensions Maestro.Editors/Fusion Maestro.Editors/Generic Maestro.Editors/LayerDefinition Maestro.Editors/LayerDefinition/Drawing Maestro.Editors/LayerDefinition/Raster Maestro.Editors/LayerDefinition/Vector Maestro.Editors/LayerDefinition/Vector/Scales Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstanceEditors Maestro.Editors/LayerDefinition/Vector/Thematics Maestro.Editors/MapDefinition Maestro.Editors/Packaging Maestro.Editors/Preview Maestro.Editors/PrintLayout Maestro.Editors/SymbolDefinition Maestro.Editors/WatermarkDefinition Maestro.Editors/WebLayout Maestro.LiveMapEditor Maestro.Packaging MaestroAPITests MaestroFsPreview OSGeo.MapGuide.ExtendedObjectModels OSGeo.MapGuide.MaestroAPI OSGeo.MapGuide.MaestroAPI/Capability OSGeo.MapGuide.MaestroAPI/Commands OSGeo.MapGuide.MaestroAPI/CrossConnection OSGeo.MapGuide.MaestroAPI/Exceptions OSGeo.MapGuide.MaestroAPI/ObjectModels OSGeo.MapGuide.MaestroAPI/Resource OSGeo.MapGuide.MaestroAPI/Resource/Conversion OSGeo.MapGui de.MaestroAPI/Resource/Validation OSGeo.MapGuide.MaestroAPI.Native/Commands
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue Jun 3 04:21:59 PDT 2014
Author: jng
Date: 2014-06-03 04:21:59 -0700 (Tue, 03 Jun 2014)
New Revision: 8183
Modified:
trunk/Tools/Maestro/ExtendedModels/LayerDefinition-1.1.0/LayerDefinitionValidator.cs
trunk/Tools/Maestro/ExtendedModels/LayerDefinition-1.2.0/LayerDefinitionValidator.cs
trunk/Tools/Maestro/ExtendedModels/LayerDefinition-1.3.0/LayerDefinitionValidator.cs
trunk/Tools/Maestro/ExtendedModels/LayerDefinition-2.3.0/LayerDefinitionValidator.cs
trunk/Tools/Maestro/ExtendedModels/LayerDefinition-2.4.0/LayerDefinitionValidator.cs
trunk/Tools/Maestro/ExtendedModels/LoadProcedure-1.1.0/LoadProcedureValidator.cs
trunk/Tools/Maestro/ExtendedModels/LoadProcedure-2.2.0/LoadProcedureValidator.cs
trunk/Tools/Maestro/ExtendedModels/MapDefinition-2.3.0/MapDefinitionValidator.cs
trunk/Tools/Maestro/ExtendedModels/MapDefinition-2.4.0/MapDefinitionValidator.cs
trunk/Tools/Maestro/ExtendedModels/SymbolDefinition-1.1.0/SymbolDefinitionValidator.cs
trunk/Tools/Maestro/ExtendedModels/SymbolDefinition-2.4.0/SymbolDefinitionValidator.cs
trunk/Tools/Maestro/ExtendedModels/WatermarkDefinition-2.3.0/WatermarkImpl.cs
trunk/Tools/Maestro/ExtendedModels/WebLayout-1.1.0/WebLayoutValidator.cs
trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Editor/EditorFactories.cs
trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/VectorLayer110ItemTemplate.cs
trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/VectorLayer120ItemTemplate.cs
trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/VectorLayer130ItemTemplate.cs
trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/VectorLayer230ItemTemplate.cs
trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/VectorLayer240ItemTemplate.cs
trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/WebLayout110ItemTemplate.cs
trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/WebLayout240ItemTemplate.cs
trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/WebLayout260ItemTemplate.cs
trunk/Tools/Maestro/Maestro.AddIn.Local/Services/LocalPreviewer.cs
trunk/Tools/Maestro/Maestro.AddIn.Scripting/Services/ScriptingClasses.cs
trunk/Tools/Maestro/Maestro.Base/Commands/SiteExplorer/RenameCommand.cs
trunk/Tools/Maestro/Maestro.Base/Commands/SiteExplorer/RepointCommand.cs
trunk/Tools/Maestro/Maestro.Base/Commands/Test/OpenResourceCommand.cs
trunk/Tools/Maestro/Maestro.Base/Commands/Test/OpenSymbolBrowserCommand.cs
trunk/Tools/Maestro/Maestro.Base/Commands/Test/TestCommands.cs
trunk/Tools/Maestro/Maestro.Base/Commands/TranslateLayoutCommand.cs
trunk/Tools/Maestro/Maestro.Base/Editor/FeatureSourceEditor.cs
trunk/Tools/Maestro/Maestro.Base/Editor/IEditorFactory.cs
trunk/Tools/Maestro/Maestro.Base/Editor/LayerDefinitionEditor.cs
trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlerService.cs
trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlers/DwfFileHandler.cs
trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlers/PackageFileHandler.cs
trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlers/SdfFileHandler.cs
trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlers/ShpFileHandler.cs
trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlers/SltFileHandler.cs
trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlers/XmlResFileHandler.cs
trunk/Tools/Maestro/Maestro.Base/Services/IDragDropHandler.cs
trunk/Tools/Maestro/Maestro.Base/Services/OpenResourceManager.cs
trunk/Tools/Maestro/Maestro.Base/Templates/ApplicationDefinitionItemTemplate.cs
trunk/Tools/Maestro/Maestro.Base/Templates/DrawingLayerDefinitionItemTemplate.cs
trunk/Tools/Maestro/Maestro.Base/Templates/RasterLayerDefinitionItemTemplate.cs
trunk/Tools/Maestro/Maestro.Base/Templates/VectorLayerDefinitionItemTemplate.cs
trunk/Tools/Maestro/Maestro.Base/Templates/WebLayoutItemTemplate.cs
trunk/Tools/Maestro/Maestro.Base/UI/ProfilingDialog.cs
trunk/Tools/Maestro/Maestro.Base/UI/RepositoryTreeModel.cs
trunk/Tools/Maestro/Maestro.Base/UI/ResourceIconCache.cs
trunk/Tools/Maestro/Maestro.Editors/Common/EditorWindow.cs
trunk/Tools/Maestro/Maestro.Editors/Common/RepointerDialog.cs
trunk/Tools/Maestro/Maestro.Editors/Common/RepositoryTreeModel.cs
trunk/Tools/Maestro/Maestro.Editors/Common/RepositoryView.cs
trunk/Tools/Maestro/Maestro.Editors/Common/ResourcePicker.cs
trunk/Tools/Maestro/Maestro.Editors/Common/SymbolPicker.cs
trunk/Tools/Maestro/Maestro.Editors/Diff/CompareResourceDialog.cs
trunk/Tools/Maestro/Maestro.Editors/FeatureSource/CreateLayersFromFeatureSourceDialog.cs
trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Extensions/JoinSettings.cs
trunk/Tools/Maestro/Maestro.Editors/Fusion/MapCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/Fusion/MapSettingsCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorDialog.cs
trunk/Tools/Maestro/Maestro.Editors/IEditorService.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Drawing/DrawingLayerSettingsCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/LayerPropertiesSectionCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Raster/RasterLayerSettingsSectionCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstanceEditors/ReferenceCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/VectorLayerSettingsSectionCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LayerPropertiesCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LiveMapDefinitionEditorCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LiveMapEditorDrawOrder.cs
trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LiveMapEditorLegend.cs
trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LiveMapEditorRepositoryView.cs
trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapLayersSectionCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/Packaging/PackageEditorDialog.cs
trunk/Tools/Maestro/Maestro.Editors/Preview/DefaultResourcePreviewer.cs
trunk/Tools/Maestro/Maestro.Editors/Preview/LocalMapPreviewer.cs
trunk/Tools/Maestro/Maestro.Editors/Preview/ResourcePreviewEngine.cs
trunk/Tools/Maestro/Maestro.Editors/PrintLayout/LogoDialog.cs
trunk/Tools/Maestro/Maestro.Editors/RepositoryIcons.cs
trunk/Tools/Maestro/Maestro.Editors/ResourceEditorServiceBase.cs
trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/CompoundSymbolDefinitionEditorCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/ExtractSymbolLibraryDialog.cs
trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/SimpleSymbolReferenceCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/SymbolEditorService.cs
trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkCollectionEditorCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkInstanceEditor.cs
trunk/Tools/Maestro/Maestro.Editors/WebLayout/WebLayoutSettingsCtrl.cs
trunk/Tools/Maestro/Maestro.LiveMapEditor/MainForm.cs
trunk/Tools/Maestro/Maestro.Packaging/PackageBuilder.cs
trunk/Tools/Maestro/MaestroAPITests/CapabilityTests.cs
trunk/Tools/Maestro/MaestroAPITests/ResourceTests.cs
trunk/Tools/Maestro/MaestroFsPreview/MainForm.cs
trunk/Tools/Maestro/OSGeo.MapGuide.ExtendedObjectModels/ModelSetup.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Commands/LocalGetResourceContents.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Capability/ConnectionCapabilities.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Commands/ExecuteLoadProcedure.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CrossConnection/ResourceMigrator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Exceptions/UnsupportedResourceTypeException.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/IConnectionCapabilities.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/IServerConnection.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/ApplicationDefinition.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/DrawingSource.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/FeatureSource.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/IRepositoryItem.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LoadProcedure.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/MapDefinition.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/ObjectFactory.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/PrintLayout.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/ResourceItems.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/SymbolDefinition.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/SymbolLibrary.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/UntypedResource.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/VectorLayerDefinitionImpl.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/WebLayout.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Conversion/ImageSymbolConverter.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/IResource.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/ResourceContentVersionChecker.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/ResourceIdentifier.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/ResourceTypeDescriptor.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ApplicationDefinitionValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseLoadProcedureValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseMapDefinitionValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseSymbolDefinitionValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseWebLayoutValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/DrawingSourceValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/FeatureSourceValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/LayerDefinitionValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/LoadProcedureValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/MapDefinitionValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/PrintLayoutValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ResourceValidatorSet.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/SymbolDefinitionValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/SymbolLibraryValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/WebLayoutValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ResourceTypeRegistry.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/XmlValidator.cs
Log:
#2454: First attempt at future-proofing Maestro. For this to work, we had to replace most references to the ResourceTypes enum with strings, allowing for future resource types that are introduced to be used with the Maestro API. The existing ResourceTypes now simply serves as a hint as to what Maestro officially supports.
Naturally, this has inevitably caused wholesale API breakage across the board requiring many ResourceTypes -> string method signature changes, which have all been patched up with this submission.
Modified: trunk/Tools/Maestro/ExtendedModels/LayerDefinition-1.1.0/LayerDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/ExtendedModels/LayerDefinition-1.1.0/LayerDefinitionValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/ExtendedModels/LayerDefinition-1.1.0/LayerDefinitionValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -31,7 +31,7 @@
{
public override ResourceTypeDescriptor SupportedResourceAndVersion
{
- get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition, "1.1.0"); }
+ get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition.ToString(), "1.1.0"); }
}
}
}
Modified: trunk/Tools/Maestro/ExtendedModels/LayerDefinition-1.2.0/LayerDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/ExtendedModels/LayerDefinition-1.2.0/LayerDefinitionValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/ExtendedModels/LayerDefinition-1.2.0/LayerDefinitionValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -31,7 +31,7 @@
{
public override ResourceTypeDescriptor SupportedResourceAndVersion
{
- get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition, "1.2.0"); }
+ get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition.ToString(), "1.2.0"); }
}
}
}
Modified: trunk/Tools/Maestro/ExtendedModels/LayerDefinition-1.3.0/LayerDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/ExtendedModels/LayerDefinition-1.3.0/LayerDefinitionValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/ExtendedModels/LayerDefinition-1.3.0/LayerDefinitionValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -31,7 +31,7 @@
{
public override ResourceTypeDescriptor SupportedResourceAndVersion
{
- get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition, "1.3.0"); }
+ get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition.ToString(), "1.3.0"); }
}
}
}
Modified: trunk/Tools/Maestro/ExtendedModels/LayerDefinition-2.3.0/LayerDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/ExtendedModels/LayerDefinition-2.3.0/LayerDefinitionValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/ExtendedModels/LayerDefinition-2.3.0/LayerDefinitionValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -31,7 +31,7 @@
{
public override ResourceTypeDescriptor SupportedResourceAndVersion
{
- get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition, "2.3.0"); }
+ get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition.ToString(), "2.3.0"); }
}
}
}
Modified: trunk/Tools/Maestro/ExtendedModels/LayerDefinition-2.4.0/LayerDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/ExtendedModels/LayerDefinition-2.4.0/LayerDefinitionValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/ExtendedModels/LayerDefinition-2.4.0/LayerDefinitionValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -31,7 +31,7 @@
{
public override ResourceTypeDescriptor SupportedResourceAndVersion
{
- get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition, "2.4.0"); }
+ get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition.ToString(), "2.4.0"); }
}
}
}
Modified: trunk/Tools/Maestro/ExtendedModels/LoadProcedure-1.1.0/LoadProcedureValidator.cs
===================================================================
--- trunk/Tools/Maestro/ExtendedModels/LoadProcedure-1.1.0/LoadProcedureValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/ExtendedModels/LoadProcedure-1.1.0/LoadProcedureValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -29,7 +29,7 @@
{
public override ResourceTypeDescriptor SupportedResourceAndVersion
{
- get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LoadProcedure, "1.1.0"); }
+ get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LoadProcedure.ToString(), "1.1.0"); }
}
}
}
Modified: trunk/Tools/Maestro/ExtendedModels/LoadProcedure-2.2.0/LoadProcedureValidator.cs
===================================================================
--- trunk/Tools/Maestro/ExtendedModels/LoadProcedure-2.2.0/LoadProcedureValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/ExtendedModels/LoadProcedure-2.2.0/LoadProcedureValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -29,7 +29,7 @@
{
public override ResourceTypeDescriptor SupportedResourceAndVersion
{
- get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LoadProcedure, "2.2.0"); }
+ get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LoadProcedure.ToString(), "2.2.0"); }
}
}
}
Modified: trunk/Tools/Maestro/ExtendedModels/MapDefinition-2.3.0/MapDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/ExtendedModels/MapDefinition-2.3.0/MapDefinitionValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/ExtendedModels/MapDefinition-2.3.0/MapDefinitionValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -29,7 +29,7 @@
{
public override OSGeo.MapGuide.MaestroAPI.Resource.ResourceTypeDescriptor SupportedResourceAndVersion
{
- get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.MapDefinition, "2.3.0"); }
+ get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.MapDefinition.ToString(), "2.3.0"); }
}
}
}
Modified: trunk/Tools/Maestro/ExtendedModels/MapDefinition-2.4.0/MapDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/ExtendedModels/MapDefinition-2.4.0/MapDefinitionValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/ExtendedModels/MapDefinition-2.4.0/MapDefinitionValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -29,7 +29,7 @@
{
public override OSGeo.MapGuide.MaestroAPI.Resource.ResourceTypeDescriptor SupportedResourceAndVersion
{
- get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.MapDefinition, "2.4.0"); }
+ get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.MapDefinition.ToString(), "2.4.0"); }
}
}
}
Modified: trunk/Tools/Maestro/ExtendedModels/SymbolDefinition-1.1.0/SymbolDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/ExtendedModels/SymbolDefinition-1.1.0/SymbolDefinitionValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/ExtendedModels/SymbolDefinition-1.1.0/SymbolDefinitionValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -30,7 +30,7 @@
{
public override ResourceTypeDescriptor SupportedResourceAndVersion
{
- get { return new ResourceTypeDescriptor(ResourceTypes.SymbolDefinition, "1.1.0"); }
+ get { return new ResourceTypeDescriptor(ResourceTypes.SymbolDefinition.ToString(), "1.1.0"); }
}
}
}
Modified: trunk/Tools/Maestro/ExtendedModels/SymbolDefinition-2.4.0/SymbolDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/ExtendedModels/SymbolDefinition-2.4.0/SymbolDefinitionValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/ExtendedModels/SymbolDefinition-2.4.0/SymbolDefinitionValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -30,7 +30,7 @@
{
public override ResourceTypeDescriptor SupportedResourceAndVersion
{
- get { return new ResourceTypeDescriptor(ResourceTypes.SymbolDefinition, "2.4.0"); }
+ get { return new ResourceTypeDescriptor(ResourceTypes.SymbolDefinition.ToString(), "2.4.0"); }
}
}
}
Modified: trunk/Tools/Maestro/ExtendedModels/WatermarkDefinition-2.3.0/WatermarkImpl.cs
===================================================================
--- trunk/Tools/Maestro/ExtendedModels/WatermarkDefinition-2.3.0/WatermarkImpl.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/ExtendedModels/WatermarkDefinition-2.3.0/WatermarkImpl.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -91,11 +91,11 @@
#endif
[XmlIgnore]
- public ResourceTypes ResourceType
+ public string ResourceType
{
get
{
- return ResourceTypes.WatermarkDefinition;
+ return ResourceTypes.WatermarkDefinition.ToString();
}
}
Modified: trunk/Tools/Maestro/ExtendedModels/WebLayout-1.1.0/WebLayoutValidator.cs
===================================================================
--- trunk/Tools/Maestro/ExtendedModels/WebLayout-1.1.0/WebLayoutValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/ExtendedModels/WebLayout-1.1.0/WebLayoutValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -36,11 +36,11 @@
public override ResourceTypeDescriptor SupportedResourceAndVersion
{
#if WL260
- get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout, "2.6.0"); }
+ get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout.ToString(), "2.6.0"); }
#elif WL240
- get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout, "2.4.0"); }
+ get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout.ToString(), "2.4.0"); }
#else
- get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout, "1.1.0"); }
+ get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout.ToString(), "1.1.0"); }
#endif
}
}
Modified: trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Editor/EditorFactories.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Editor/EditorFactories.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Editor/EditorFactories.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -31,7 +31,7 @@
public WebLayout110EditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout, "1.1.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout.ToString(), "1.1.0"); //NOXLATE
}
public IEditorViewContent Create()
@@ -46,7 +46,7 @@
public WebLayout240EditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout, "2.4.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout.ToString(), "2.4.0"); //NOXLATE
}
public IEditorViewContent Create()
@@ -61,7 +61,7 @@
public WebLayout260EditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout, "2.6.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout.ToString(), "2.6.0"); //NOXLATE
}
public IEditorViewContent Create()
@@ -76,7 +76,7 @@
public LayerDefinition110EditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition, "1.1.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition.ToString(), "1.1.0"); //NOXLATE
}
public IEditorViewContent Create()
@@ -92,7 +92,7 @@
public LayerDefinition120EditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition, "1.2.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition.ToString(), "1.2.0"); //NOXLATE
}
public IEditorViewContent Create()
@@ -108,7 +108,7 @@
public LayerDefinition130EditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition, "1.3.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition.ToString(), "1.3.0"); //NOXLATE
}
public IEditorViewContent Create()
@@ -124,7 +124,7 @@
public LayerDefinition230EditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition, "2.3.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition.ToString(), "2.3.0"); //NOXLATE
}
public IEditorViewContent Create()
@@ -140,7 +140,7 @@
public LayerDefinition240EditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition, "2.4.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition.ToString(), "2.4.0"); //NOXLATE
}
public IEditorViewContent Create()
@@ -156,7 +156,7 @@
public MapDefinition230EditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.MapDefinition, "2.3.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.MapDefinition.ToString(), "2.3.0"); //NOXLATE
}
public IEditorViewContent Create()
@@ -172,7 +172,7 @@
public MapDefinition240EditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.MapDefinition, "2.4.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.MapDefinition.ToString(), "2.4.0"); //NOXLATE
}
public IEditorViewContent Create()
@@ -188,7 +188,7 @@
public WatermarkDefinition230EditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.WatermarkDefinition, "2.3.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.WatermarkDefinition.ToString(), "2.3.0"); //NOXLATE
}
public IEditorViewContent Create()
@@ -204,7 +204,7 @@
public WatermarkDefinition240EditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.WatermarkDefinition, "2.4.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.WatermarkDefinition.ToString(), "2.4.0"); //NOXLATE
}
public IEditorViewContent Create()
@@ -220,7 +220,7 @@
public LoadProcedure110EditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LoadProcedure, "1.1.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LoadProcedure.ToString(), "1.1.0"); //NOXLATE
}
public IEditorViewContent Create()
@@ -236,7 +236,7 @@
public LoadProcedure220EditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LoadProcedure, "2.2.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LoadProcedure.ToString(), "2.2.0"); //NOXLATE
}
public IEditorViewContent Create()
@@ -252,7 +252,7 @@
public SymbolDefinition110EditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.SymbolDefinition, "1.1.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.SymbolDefinition.ToString(), "1.1.0"); //NOXLATE
}
public IEditorViewContent Create()
@@ -267,7 +267,7 @@
public SymbolDefinition240EditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.SymbolDefinition, "2.4.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.SymbolDefinition.ToString(), "2.4.0"); //NOXLATE
}
public IEditorViewContent Create()
Modified: trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/VectorLayer110ItemTemplate.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/VectorLayer110ItemTemplate.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/VectorLayer110ItemTemplate.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -50,7 +50,7 @@
public override OSGeo.MapGuide.MaestroAPI.Resource.IResource CreateItem(string startPoint, OSGeo.MapGuide.MaestroAPI.IServerConnection conn)
{
- using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.FeatureSource, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.FeatureSource.ToString(), ResourcePickerMode.OpenResource))
{
picker.SetStartingPoint(startPoint);
if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
Modified: trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/VectorLayer120ItemTemplate.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/VectorLayer120ItemTemplate.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/VectorLayer120ItemTemplate.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -50,7 +50,7 @@
public override OSGeo.MapGuide.MaestroAPI.Resource.IResource CreateItem(string startPoint, OSGeo.MapGuide.MaestroAPI.IServerConnection conn)
{
- using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.FeatureSource, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.FeatureSource.ToString(), ResourcePickerMode.OpenResource))
{
picker.SetStartingPoint(startPoint);
if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
Modified: trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/VectorLayer130ItemTemplate.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/VectorLayer130ItemTemplate.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/VectorLayer130ItemTemplate.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -50,7 +50,7 @@
public override OSGeo.MapGuide.MaestroAPI.Resource.IResource CreateItem(string startPoint, OSGeo.MapGuide.MaestroAPI.IServerConnection conn)
{
- using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.FeatureSource, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.FeatureSource.ToString(), ResourcePickerMode.OpenResource))
{
picker.SetStartingPoint(startPoint);
if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
Modified: trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/VectorLayer230ItemTemplate.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/VectorLayer230ItemTemplate.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/VectorLayer230ItemTemplate.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -50,7 +50,7 @@
public override OSGeo.MapGuide.MaestroAPI.Resource.IResource CreateItem(string startPoint, OSGeo.MapGuide.MaestroAPI.IServerConnection conn)
{
- using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.FeatureSource, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.FeatureSource.ToString(), ResourcePickerMode.OpenResource))
{
picker.SetStartingPoint(startPoint);
if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
Modified: trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/VectorLayer240ItemTemplate.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/VectorLayer240ItemTemplate.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/VectorLayer240ItemTemplate.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -50,7 +50,7 @@
public override OSGeo.MapGuide.MaestroAPI.Resource.IResource CreateItem(string startPoint, OSGeo.MapGuide.MaestroAPI.IServerConnection conn)
{
- using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.FeatureSource, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.FeatureSource.ToString(), ResourcePickerMode.OpenResource))
{
picker.SetStartingPoint(startPoint);
if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
Modified: trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/WebLayout110ItemTemplate.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/WebLayout110ItemTemplate.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/WebLayout110ItemTemplate.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -53,7 +53,7 @@
public override IResource CreateItem(string startPoint, IServerConnection conn)
{
//This is to just ensure we have a functional WebLayout when it's created
- using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.MapDefinition, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.MapDefinition.ToString(), ResourcePickerMode.OpenResource))
{
picker.SetStartingPoint(startPoint);
if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
Modified: trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/WebLayout240ItemTemplate.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/WebLayout240ItemTemplate.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/WebLayout240ItemTemplate.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -53,7 +53,7 @@
public override IResource CreateItem(string startPoint, IServerConnection conn)
{
//This is to just ensure we have a functional WebLayout when it's created
- using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.MapDefinition, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.MapDefinition.ToString(), ResourcePickerMode.OpenResource))
{
picker.SetStartingPoint(startPoint);
if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
Modified: trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/WebLayout260ItemTemplate.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/WebLayout260ItemTemplate.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Templates/WebLayout260ItemTemplate.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -53,7 +53,7 @@
public override IResource CreateItem(string startPoint, IServerConnection conn)
{
//This is to just ensure we have a functional WebLayout when it's created
- using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.MapDefinition, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.MapDefinition.ToString(), ResourcePickerMode.OpenResource))
{
picker.SetStartingPoint(startPoint);
if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/Services/LocalPreviewer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Local/Services/LocalPreviewer.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.AddIn.Local/Services/LocalPreviewer.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -39,9 +39,9 @@
public bool IsPreviewable(OSGeo.MapGuide.MaestroAPI.Resource.IResource res)
{
var rt = res.ResourceType;
- return (rt == ResourceTypes.LayerDefinition ||
- rt == ResourceTypes.MapDefinition ||
- rt == ResourceTypes.WatermarkDefinition);
+ return (rt == ResourceTypes.LayerDefinition.ToString() ||
+ rt == ResourceTypes.MapDefinition.ToString() ||
+ rt == ResourceTypes.WatermarkDefinition.ToString());
}
/// <summary>
@@ -59,7 +59,7 @@
IMapDefinition mapDef = null;
var conn = res.CurrentConnection;
- if (res.ResourceType == ResourceTypes.LayerDefinition)
+ if (res.ResourceType == ResourceTypes.LayerDefinition.ToString())
{
var ldf = (ILayerDefinition)res;
string wkt;
@@ -73,11 +73,11 @@
edSvc.ResourceService.SetResourceXmlData(resId, ResourceTypeRegistry.Serialize(res));
mapDef.AddLayer(null, "PreviewLayer", resId);
}
- else if (res.ResourceType == ResourceTypes.MapDefinition)
+ else if (res.ResourceType == ResourceTypes.MapDefinition.ToString())
{
mapDef = (IMapDefinition)res;
}
- else if (res.ResourceType == ResourceTypes.WatermarkDefinition)
+ else if (res.ResourceType == ResourceTypes.WatermarkDefinition.ToString())
{
string resId = "Session:" + edSvc.SessionID + "//" + Guid.NewGuid() + "." + res.ResourceType.ToString();
edSvc.ResourceService.SetResourceXmlData(resId, ResourceTypeRegistry.Serialize(res));
Modified: trunk/Tools/Maestro/Maestro.AddIn.Scripting/Services/ScriptingClasses.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Scripting/Services/ScriptingClasses.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.AddIn.Scripting/Services/ScriptingClasses.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -167,7 +167,7 @@
{
Func<string> picker = () =>
{
- using (var diag = new ResourcePicker(conn.ResourceService, (ResourceTypes)Enum.Parse(typeof(ResourceTypes), resourceType), ResourcePickerMode.OpenResource))
+ using (var diag = new ResourcePicker(conn.ResourceService, resourceType, ResourcePickerMode.OpenResource))
{
if (diag.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
@@ -198,7 +198,7 @@
{
Func<string> picker = () =>
{
- using (var diag = new ResourcePicker(conn.ResourceService, (ResourceTypes)Enum.Parse(typeof(ResourceTypes), resourceType), ResourcePickerMode.SaveResource))
+ using (var diag = new ResourcePicker(conn.ResourceService, resourceType, ResourcePickerMode.SaveResource))
{
if (diag.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
Modified: trunk/Tools/Maestro/Maestro.Base/Commands/SiteExplorer/RenameCommand.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Commands/SiteExplorer/RenameCommand.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/Commands/SiteExplorer/RenameCommand.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -25,6 +25,7 @@
using Maestro.Base.UI;
using Maestro.Shared.UI;
using OSGeo.MapGuide.MaestroAPI;
+using OSGeo.MapGuide.MaestroAPI.Resource;
namespace Maestro.Base.Commands.SiteExplorer
{
@@ -118,8 +119,7 @@
//Need to refresh the model because it still is called by the old name
- var rid = new OSGeo.MapGuide.MaestroAPI.Resource.ResourceIdentifier(oldid);
- var folder = rid.ParentFolder;
+ var folder = ResourceIdentifier.GetParentFolder(oldid, false);
exp.RefreshModel(conn.DisplayName, folder);
}
}
Modified: trunk/Tools/Maestro/Maestro.Base/Commands/SiteExplorer/RepointCommand.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Commands/SiteExplorer/RepointCommand.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/Commands/SiteExplorer/RepointCommand.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -56,9 +56,9 @@
{
var selected = exp.SelectedItems[0];
var resId = new ResourceIdentifier(selected.ResourceId);
- if (resId.ResourceType != ResourceTypes.WebLayout &&
- resId.ResourceType != ResourceTypes.ApplicationDefinition &&
- resId.ResourceType != ResourceTypes.LoadProcedure)
+ if (resId.ResourceType != ResourceTypes.WebLayout.ToString() &&
+ resId.ResourceType != ResourceTypes.ApplicationDefinition.ToString() &&
+ resId.ResourceType != ResourceTypes.LoadProcedure.ToString())
{
DoRepointResource(wb, conn, resId);
}
Modified: trunk/Tools/Maestro/Maestro.Base/Commands/Test/OpenResourceCommand.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Commands/Test/OpenResourceCommand.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/Commands/Test/OpenResourceCommand.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -100,7 +100,7 @@
var mgr = ServiceRegistry.GetService<ServerConnectionManager>();
var conn = mgr.GetConnection(exp.ConnectionName);
- var picker = new ResourcePicker(conn.ResourceService, OSGeo.MapGuide.MaestroAPI.ResourceTypes.FeatureSource, ResourcePickerMode.OpenResource);
+ var picker = new ResourcePicker(conn.ResourceService, OSGeo.MapGuide.MaestroAPI.ResourceTypes.FeatureSource.ToString(), ResourcePickerMode.OpenResource);
if (picker.ShowDialog(wb) == System.Windows.Forms.DialogResult.OK)
{
MessageService.ShowMessage(picker.ResourceID);
Modified: trunk/Tools/Maestro/Maestro.Base/Commands/Test/OpenSymbolBrowserCommand.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Commands/Test/OpenSymbolBrowserCommand.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/Commands/Test/OpenSymbolBrowserCommand.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -37,7 +37,7 @@
var mgr = ServiceRegistry.GetService<ServerConnectionManager>();
var conn = mgr.GetConnection(exp.ConnectionName);
- var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.SymbolLibrary, ResourcePickerMode.OpenResource);
+ var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.SymbolLibrary.ToString(), ResourcePickerMode.OpenResource);
if (picker.ShowDialog(wb) == System.Windows.Forms.DialogResult.OK)
{
var browser = new SymbolPicker(picker.ResourceID, conn);
Modified: trunk/Tools/Maestro/Maestro.Base/Commands/Test/TestCommands.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Commands/Test/TestCommands.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/Commands/Test/TestCommands.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -57,7 +57,7 @@
var mgr = ServiceRegistry.GetService<ServerConnectionManager>();
var conn = mgr.GetConnection(exp.ConnectionName);
- var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.FeatureSource, ResourcePickerMode.SaveResource);
+ var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.FeatureSource.ToString(), ResourcePickerMode.SaveResource);
if (picker.ShowDialog(wb) == System.Windows.Forms.DialogResult.OK)
{
MessageService.ShowMessage(picker.ResourceID);
Modified: trunk/Tools/Maestro/Maestro.Base/Commands/TranslateLayoutCommand.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Commands/TranslateLayoutCommand.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/Commands/TranslateLayoutCommand.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -38,17 +38,17 @@
if (ed != null)
{
var rt = ed.EditorService.GetEditedResource().ResourceType;
- if (rt == OSGeo.MapGuide.MaestroAPI.ResourceTypes.ApplicationDefinition ||
- rt == OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout)
+ if (rt == OSGeo.MapGuide.MaestroAPI.ResourceTypes.ApplicationDefinition.ToString() ||
+ rt == OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout.ToString())
{
var doc = new XmlDocument();
doc.LoadXml(ed.GetXmlContent());
List<string> tags = new List<string>();
- if (rt == OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout)
+ if (rt == OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout.ToString())
tags.AddRange(new string[] { "Title", "Tooltip", "Description", "Label", "Prompt" }); //NOXLATE
- else if (rt == OSGeo.MapGuide.MaestroAPI.ResourceTypes.ApplicationDefinition)
+ else if (rt == OSGeo.MapGuide.MaestroAPI.ResourceTypes.ApplicationDefinition.ToString())
tags.AddRange(new string[] { "Title", "Label", "Tooltip", "StatusText", "EmptyText" }); //NOXLATE
var diag = new LabelLocalizationDialog(doc, tags.ToArray());
if (diag.ShowDialog() == System.Windows.Forms.DialogResult.OK)
Modified: trunk/Tools/Maestro/Maestro.Base/Editor/FeatureSourceEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/FeatureSourceEditor.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/FeatureSourceEditor.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -81,13 +81,13 @@
foreach (var r in refs.ResourceId)
{
ResourceIdentifier rid = new ResourceIdentifier(r);
- if (rid.ResourceType == OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition)
+ if (rid.ResourceType == OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition.ToString())
{
var lrefs = _edsvc.ResourceService.EnumerateResourceReferences(r);
foreach (var lr in lrefs.ResourceId)
{
ResourceIdentifier rid2 = new ResourceIdentifier(lr);
- if (rid2.ResourceType == OSGeo.MapGuide.MaestroAPI.ResourceTypes.MapDefinition)
+ if (rid2.ResourceType == OSGeo.MapGuide.MaestroAPI.ResourceTypes.MapDefinition.ToString())
{
var mdf = (IMapDefinition)_edsvc.ResourceService.GetResource(lr);
if (mdf.BaseMap != null)
Modified: trunk/Tools/Maestro/Maestro.Base/Editor/IEditorFactory.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/IEditorFactory.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/IEditorFactory.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -52,7 +52,7 @@
public FusionEditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.ApplicationDefinition, "1.0.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.ApplicationDefinition.ToString(), "1.0.0"); //NOXLATE
}
public IEditorViewContent Create()
@@ -67,7 +67,7 @@
public DrawingSourceEditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.DrawingSource, "1.0.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.DrawingSource.ToString(), "1.0.0"); //NOXLATE
}
public IEditorViewContent Create()
@@ -82,7 +82,7 @@
public FeatureSourceEditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.FeatureSource, "1.0.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.FeatureSource.ToString(), "1.0.0"); //NOXLATE
}
public IEditorViewContent Create()
@@ -97,7 +97,7 @@
public LayerDefinitionEditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition, "1.0.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LayerDefinition.ToString(), "1.0.0"); //NOXLATE
}
public IEditorViewContent Create()
@@ -112,7 +112,7 @@
public LoadProcedureEditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LoadProcedure, "1.0.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LoadProcedure.ToString(), "1.0.0"); //NOXLATE
}
public IEditorViewContent Create()
@@ -127,7 +127,7 @@
public MapDefinitionEditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.MapDefinition, "1.0.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.MapDefinition.ToString(), "1.0.0"); //NOXLATE
}
public IEditorViewContent Create()
@@ -142,7 +142,7 @@
public PrintLayoutEditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.PrintLayout, "1.0.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.PrintLayout.ToString(), "1.0.0"); //NOXLATE
}
public IEditorViewContent Create()
@@ -157,7 +157,7 @@
public SymbolDefinitionEditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.SymbolDefinition, "1.0.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.SymbolDefinition.ToString(), "1.0.0"); //NOXLATE
}
public IEditorViewContent Create()
@@ -172,7 +172,7 @@
public WebLayoutEditorFactory()
{
- this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout, "1.0.0"); //NOXLATE
+ this.ResourceTypeAndVersion = new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout.ToString(), "1.0.0"); //NOXLATE
}
public IEditorViewContent Create()
Modified: trunk/Tools/Maestro/Maestro.Base/Editor/LayerDefinitionEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/LayerDefinitionEditor.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/LayerDefinitionEditor.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -110,7 +110,7 @@
foreach (var r in refs.ResourceId)
{
var resId = new ResourceIdentifier(r);
- if (resId.ResourceType == OSGeo.MapGuide.MaestroAPI.ResourceTypes.MapDefinition)
+ if (resId.ResourceType == OSGeo.MapGuide.MaestroAPI.ResourceTypes.MapDefinition.ToString())
{
var mdf = (IMapDefinition)_edsvc.ResourceService.GetResource(r);
if (mdf.BaseMap != null)
Modified: trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlerService.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlerService.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlerService.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -31,7 +31,7 @@
public override void Initialize()
{
base.Initialize();
- _handlers = new Dictionary<string, List<IDragDropHandler>>();
+ _handlers = new List<IDragDropHandler>();
//Find and register drag and drop handlers
List<IDragDropHandler> handlers = AddInTree.BuildItems<IDragDropHandler>("/Maestro/DragDropHandlers", this); //NOXLATE
@@ -44,7 +44,7 @@
}
}
- private Dictionary<string, List<IDragDropHandler>> _handlers;
+ private List<IDragDropHandler> _handlers;
/// <summary>
/// Registers a drag and drop handler.
@@ -52,14 +52,7 @@
/// <param name="handler">The handler.</param>
public void RegisterHandler(IDragDropHandler handler)
{
- foreach (string fileExt in handler.FileExtensions)
- {
- string ext = fileExt.ToUpper();
- if (!_handlers.ContainsKey(ext))
- _handlers[ext] = new List<IDragDropHandler>();
-
- _handlers[ext].Add(handler);
- }
+ _handlers.Add(handler);
}
/// <summary>
@@ -69,20 +62,14 @@
/// <returns>A list of registered handlers</returns>
public IList<IDragDropHandler> GetHandlersForFile(string file)
{
- string ext = Path.GetExtension(file).ToUpper();
- if (_handlers.ContainsKey(ext))
- return _handlers[ext];
-
- return new List<IDragDropHandler>();
+ var matches = new List<IDragDropHandler>();
+ foreach (var h in _handlers)
+ {
+ string ext = Path.GetExtension(file).ToUpper();
+ if (h.CanHandleFileExtension(ext))
+ matches.Add(h);
+ }
+ return matches;
}
-
- /// <summary>
- /// Gets the list of file extensions being handled
- /// </summary>
- /// <returns></returns>
- public ICollection<string> GetHandledExtensions()
- {
- return _handlers.Keys;
- }
}
}
Modified: trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlers/DwfFileHandler.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlers/DwfFileHandler.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlers/DwfFileHandler.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -39,11 +39,6 @@
string[] extensions = { ".dwf" }; //NOXLATE
- public string[] FileExtensions
- {
- get { return extensions; }
- }
-
public bool HandleDrop(IServerConnection conn, string file, string folderId)
{
try
@@ -84,5 +79,10 @@
return false;
}
}
+
+ public bool CanHandleFileExtension(string fileExtension)
+ {
+ return HandlerUtil.ExtensionInList(extensions, fileExtension);
+ }
}
}
Modified: trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlers/PackageFileHandler.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlers/PackageFileHandler.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlers/PackageFileHandler.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -38,11 +38,6 @@
string[] extensions = { ".mgp" }; //NOXLATE
- public string[] FileExtensions
- {
- get { return extensions; }
- }
-
public bool HandleDrop(IServerConnection conn, string file, string folderId)
{
try
@@ -75,5 +70,10 @@
return false;
}
}
+
+ public bool CanHandleFileExtension(string fileExtension)
+ {
+ return Array.IndexOf(extensions, fileExtension) >= 0;
+ }
}
}
Modified: trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlers/SdfFileHandler.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlers/SdfFileHandler.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlers/SdfFileHandler.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -38,11 +38,6 @@
string[] extensions = { ".sdf" }; //NOXLATE
- public string[] FileExtensions
- {
- get { return extensions; }
- }
-
public bool HandleDrop(IServerConnection conn, string file, string folderId)
{
try
@@ -77,5 +72,10 @@
return false;
}
}
+
+ public bool CanHandleFileExtension(string fileExtension)
+ {
+ return HandlerUtil.ExtensionInList(extensions, fileExtension);
+ }
}
}
Modified: trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlers/ShpFileHandler.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlers/ShpFileHandler.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlers/ShpFileHandler.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -38,11 +38,6 @@
private string[] extensions = { ".shp" }; //NOXLATE
- public string[] FileExtensions
- {
- get { return extensions; }
- }
-
public bool HandleDrop(IServerConnection conn, string file, string folderId)
{
try
@@ -95,5 +90,10 @@
return false;
}
}
+
+ public bool CanHandleFileExtension(string fileExtension)
+ {
+ return HandlerUtil.ExtensionInList(extensions, fileExtension);
+ }
}
}
Modified: trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlers/SltFileHandler.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlers/SltFileHandler.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlers/SltFileHandler.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -38,11 +38,6 @@
string[] extensions = { ".sqlite", ".db", ".slt" }; //NOXLATE
- public string[] FileExtensions
- {
- get { return extensions; }
- }
-
public bool HandleDrop(IServerConnection conn, string file, string folderId)
{
try
@@ -77,5 +72,10 @@
return false;
}
}
+
+ public bool CanHandleFileExtension(string fileExtension)
+ {
+ return HandlerUtil.ExtensionInList(extensions, fileExtension);
+ }
}
}
Modified: trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlers/XmlResFileHandler.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlers/XmlResFileHandler.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/Services/DragDropHandlers/XmlResFileHandler.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -36,21 +36,6 @@
get { return Strings.XmlResHandlerAction; }
}
- private string[] extensions = { ".xml", //NOXLATE
- ".FeatureSource", //NOXLATE
- ".LayerDefinition", //NOXLATE
- ".MapDefinition", //NOXLATE
- ".WebLayout", //NOXLATE
- ".SymbolDefinition", //NOXLATE
- ".ApplicationDefinition", //NOXLATE
- ".PrintLayout", //NOXLATE
- };
-
- public string[] FileExtensions
- {
- get { return extensions; }
- }
-
public bool HandleDrop(IServerConnection conn, string file, string folderId)
{
try
@@ -58,22 +43,37 @@
var wb = Workbench.Instance;
var exp = wb.ActiveSiteExplorer;
- //The easiest way to tell if this XML file is legit
- var res = ResourceTypeRegistry.Deserialize(File.ReadAllText(file));
-
+ string xml = File.ReadAllText(file);
int counter = 0;
string name = Path.GetFileNameWithoutExtension(file);
- string resId = folderId + name + "." + res.ResourceType.ToString(); //NOXLATE
-
- while (conn.ResourceService.ResourceExists(resId))
+
+ try
{
- counter++;
- resId = folderId + name + " (" + counter + ")." + res.ResourceType.ToString(); //NOXLATE
+ //The easiest way to tell if this XML file is legit
+ var res = ResourceTypeRegistry.Deserialize(xml);
+ string resId = folderId + name + "." + res.ResourceType.ToString(); //NOXLATE
+ while (conn.ResourceService.ResourceExists(resId))
+ {
+ counter++;
+ resId = folderId + name + " (" + counter + ")." + res.ResourceType.ToString(); //NOXLATE
+ }
+ res.ResourceID = resId;
+ conn.ResourceService.SaveResource(res);
}
-
- res.ResourceID = resId;
- conn.ResourceService.SaveResource(res);
-
+ catch //We may be working with an unknown resource type or schema version here so try blind before bailing
+ {
+ string resType = Path.GetExtension(file);
+ string resId = folderId + name + "." + resType; //NOXLATE
+ while (conn.ResourceService.ResourceExists(resId))
+ {
+ counter++;
+ resId = folderId + name + " (" + counter + ")." + resType; //NOXLATE
+ }
+ using (var ms = new MemoryStream(Encoding.UTF8.GetBytes(xml)))
+ {
+ conn.ResourceService.SetResourceXmlData(resId, ms);
+ }
+ }
return true;
}
catch (Exception ex)
@@ -82,5 +82,10 @@
return false;
}
}
+
+ public bool CanHandleFileExtension(string fileExtension)
+ {
+ return true;
+ }
}
}
Modified: trunk/Tools/Maestro/Maestro.Base/Services/IDragDropHandler.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Services/IDragDropHandler.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/Services/IDragDropHandler.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -35,9 +35,11 @@
string HandlerAction { get; }
/// <summary>
- /// Gets the file extensions this handler can handle
+ /// Gets whether this handler can handle the given file extension
/// </summary>
- string[] FileExtensions { get; }
+ /// <param name="fileExtension"></param>
+ /// <returns></returns>
+ bool CanHandleFileExtension(string fileExtension);
/// <summary>
/// Handles the file drop
@@ -48,4 +50,12 @@
/// <returns>true if the drop was successfully handled</returns>
bool HandleDrop(IServerConnection conn, string file, string folderId);
}
+
+ internal class HandlerUtil
+ {
+ public static bool ExtensionInList(string[] extensions, string fileExtension)
+ {
+ return Array.FindIndex(extensions, t => t.IndexOf(fileExtension, StringComparison.InvariantCultureIgnoreCase) >= 0) >= 0;
+ }
+ }
}
Modified: trunk/Tools/Maestro/Maestro.Base/Services/OpenResourceManager.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Services/OpenResourceManager.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/Services/OpenResourceManager.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -121,7 +121,7 @@
return null;
}
- private IEditorFactory GetRegisteredEditor(ResourceTypes type, string version)
+ private IEditorFactory GetRegisteredEditor(string type, string version)
{
var rtd = new ResourceTypeDescriptor(type, version);
return GetRegisteredEditor(rtd);
Modified: trunk/Tools/Maestro/Maestro.Base/Templates/ApplicationDefinitionItemTemplate.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Templates/ApplicationDefinitionItemTemplate.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/Templates/ApplicationDefinitionItemTemplate.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -52,7 +52,7 @@
public override IResource CreateItem(string startPoint, IServerConnection conn)
{
//This is to just ensure we have a functional template when it's created
- using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.MapDefinition, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.MapDefinition.ToString(), ResourcePickerMode.OpenResource))
{
picker.SetStartingPoint(startPoint);
if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
Modified: trunk/Tools/Maestro/Maestro.Base/Templates/DrawingLayerDefinitionItemTemplate.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Templates/DrawingLayerDefinitionItemTemplate.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/Templates/DrawingLayerDefinitionItemTemplate.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -43,7 +43,7 @@
public override IResource CreateItem(string startPoint, IServerConnection conn)
{
- using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.DrawingSource, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.DrawingSource.ToString(), ResourcePickerMode.OpenResource))
{
picker.SetStartingPoint(startPoint);
if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
Modified: trunk/Tools/Maestro/Maestro.Base/Templates/RasterLayerDefinitionItemTemplate.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Templates/RasterLayerDefinitionItemTemplate.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/Templates/RasterLayerDefinitionItemTemplate.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -51,7 +51,7 @@
public override IResource CreateItem(string startPoint, IServerConnection conn)
{
- using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.FeatureSource, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.FeatureSource.ToString(), ResourcePickerMode.OpenResource))
{
picker.SetStartingPoint(startPoint);
if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
Modified: trunk/Tools/Maestro/Maestro.Base/Templates/VectorLayerDefinitionItemTemplate.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Templates/VectorLayerDefinitionItemTemplate.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/Templates/VectorLayerDefinitionItemTemplate.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -43,7 +43,7 @@
public override IResource CreateItem(string startPoint, IServerConnection conn)
{
- using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.FeatureSource, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.FeatureSource.ToString(), ResourcePickerMode.OpenResource))
{
picker.SetStartingPoint(startPoint);
if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
Modified: trunk/Tools/Maestro/Maestro.Base/Templates/WebLayoutItemTemplate.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Templates/WebLayoutItemTemplate.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/Templates/WebLayoutItemTemplate.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -43,7 +43,7 @@
public override IResource CreateItem(string startPoint, IServerConnection conn)
{
//This is to just ensure we have a functional WebLayout when it's created
- using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.MapDefinition, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(conn.ResourceService, ResourceTypes.MapDefinition.ToString(), ResourcePickerMode.OpenResource))
{
picker.SetStartingPoint(startPoint);
if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
Modified: trunk/Tools/Maestro/Maestro.Base/UI/ProfilingDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/UI/ProfilingDialog.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/UI/ProfilingDialog.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -424,15 +424,15 @@
private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
{
- if (m_item.ResourceType == ResourceTypes.FeatureSource)
+ if (m_item.ResourceType == ResourceTypes.FeatureSource.ToString())
{
ProfileFeatureSource(m_item as IFeatureSource);
}
- else if (m_item.ResourceType == ResourceTypes.LayerDefinition)
+ else if (m_item.ResourceType == ResourceTypes.LayerDefinition.ToString())
{
ProfileLayerDefinition(m_item as ILayerDefinition);
}
- else if (m_item.ResourceType == ResourceTypes.MapDefinition)
+ else if (m_item.ResourceType == ResourceTypes.MapDefinition.ToString())
{
ProfileMapDefinition(m_item as IMapDefinition);
}
Modified: trunk/Tools/Maestro/Maestro.Base/UI/RepositoryTreeModel.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/UI/RepositoryTreeModel.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/UI/RepositoryTreeModel.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -50,7 +50,7 @@
this.ModifiedDate = item.ModifiedDate;
this.Owner = item.Owner;
this.ResourceId = item.ResourceId;
- this.ResourceType = item.ResourceType.ToString();
+ this.ResourceType = item.ResourceType;
this.Name = item.Name; //set name last because update logic requires other properties be set already
@@ -62,37 +62,37 @@
{
switch (item.ResourceType)
{
- case ResourceTypes.DrawingSource:
+ case "DrawingSource":
this.Icon = Properties.Resources.blueprints;
break;
- case ResourceTypes.FeatureSource:
+ case "FeatureSource":
this.Icon = Properties.Resources.database_share;
break;
- case ResourceTypes.Folder:
+ case "Folder":
this.Icon = Properties.Resources.folder_horizontal;
break;
- case ResourceTypes.LayerDefinition:
+ case "LayerDefinition":
this.Icon = Properties.Resources.layer;
break;
- case ResourceTypes.MapDefinition:
+ case "MapDefinition":
this.Icon = Properties.Resources.map;
break;
- case ResourceTypes.WebLayout:
+ case "WebLayout":
this.Icon = Properties.Resources.application_browser;
break;
- case ResourceTypes.ApplicationDefinition:
+ case "ApplicationDefinition":
this.Icon = Properties.Resources.applications_stack;
break;
- case ResourceTypes.SymbolLibrary:
+ case "SymbolLibrary":
this.Icon = Properties.Resources.images_stack;
break;
- case ResourceTypes.PrintLayout:
+ case "PrintLayout":
this.Icon = Properties.Resources.printer;
break;
- case ResourceTypes.SymbolDefinition:
+ case "SymbolDefinition":
this.Icon = Properties.Resources.marker;
break;
- case ResourceTypes.WatermarkDefinition:
+ case "WatermarkDefinition":
this.Icon = Properties.Resources.water;
break;
default:
@@ -266,7 +266,7 @@
if (IsRoot)
return;
- string parentid = ResourceIdentifier.GetParentFolder(this.ResourceId);
+ string parentid = ResourceIdentifier.GetParentFolder(this.ResourceId, false);
this.ResourceId = parentid + this.NameQualified + ((IsFolder) ? "/" : string.Empty); //NOXLATE
NotifyNodesChanged();
}
@@ -682,7 +682,7 @@
if (!ResourceIdentifier.IsFolderResource(resId))
{
//Fix extension to last component
- components[components.Length - 1] = components[components.Length - 1] + "." + ResourceIdentifier.GetResourceType(resId).ToString();
+ components[components.Length - 1] = components[components.Length - 1] + "." + ResourceIdentifier.GetResourceTypeAsString(resId);
}
RepositoryItem current = rootNode;
for (int i = 0; i < components.Length; i++)
Modified: trunk/Tools/Maestro/Maestro.Base/UI/ResourceIconCache.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/UI/ResourceIconCache.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Base/UI/ResourceIconCache.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -114,18 +114,18 @@
/// <returns></returns>
public string GetImageKeyFromResourceID(string resourceId)
{
- var rt = ResourceIdentifier.GetResourceType(resourceId);
+ var rt = ResourceIdentifier.GetResourceTypeAsString(resourceId);
switch (rt)
{
- case ResourceTypes.DrawingSource:
- case ResourceTypes.FeatureSource:
- case ResourceTypes.Folder:
- case ResourceTypes.LayerDefinition:
- case ResourceTypes.MapDefinition:
- case ResourceTypes.WebLayout:
- case ResourceTypes.ApplicationDefinition:
- case ResourceTypes.SymbolLibrary:
- case ResourceTypes.PrintLayout:
+ case "DrawingSource":
+ case "FeatureSource":
+ case "Folder":
+ case "LayerDefinition":
+ case "MapDefinition":
+ case "WebLayout":
+ case "ApplicationDefinition":
+ case "SymbolLibrary":
+ case "PrintLayout":
return rt.ToString();
default:
return UNKNOWN;
@@ -139,7 +139,7 @@
/// <returns></returns>
public int GetImageIndexFromResourceID(string resourceId)
{
- int idx = _small.Images.IndexOfKey(ResourceIdentifier.GetResourceType(resourceId).ToString());
+ int idx = _small.Images.IndexOfKey(ResourceIdentifier.GetResourceTypeAsString(resourceId));
if (idx < 0)
return _small.Images.IndexOfKey(UNKNOWN);
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/EditorWindow.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/EditorWindow.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/EditorWindow.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -123,7 +123,7 @@
_svc = new DefaultResourceEditorService(resourceId, conn);
_svc.DirtyStateChanged += OnDirtyStateChanged;
_ed.Dock = DockStyle.Fill;
- btnPreview.Enabled = ResourcePreviewEngine.IsPreviewableType(ResourceIdentifier.GetResourceType(resourceId));
+ btnPreview.Enabled = ResourcePreviewEngine.IsPreviewableType(ResourceIdentifier.GetResourceTypeAsString(resourceId));
this.Controls.Add(_ed);
_ed.Bind(_svc);
_ed.ReadyForEditing();
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/RepointerDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/RepointerDialog.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/RepointerDialog.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -79,7 +79,7 @@
/// </summary>
public string Target { get { return txtTarget.Text; } }
- internal ResourceTypes ResourceType
+ internal string ResourceType
{
get;
private set;
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/RepositoryTreeModel.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/RepositoryTreeModel.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/RepositoryTreeModel.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -213,15 +213,15 @@
}
}
- private HashSet<ResourceTypes> _filteredTypes = new HashSet<ResourceTypes>();
+ private HashSet<string> _filteredTypes = new HashSet<string>();
- public void AddResourceTypeFilter(ResourceTypes rt) { _filteredTypes.Add(rt); }
+ public void AddResourceTypeFilter(string rt) { _filteredTypes.Add(rt); }
public void ClearResourceTypeFilters() { _filteredTypes.Clear(); }
public bool HasFilteredTypes() { return _filteredTypes.Count > 0; }
- public bool IsFilteredType(ResourceTypes rt) { return _filteredTypes.Contains(rt); }
+ public bool IsFilteredType(string rt) { return _filteredTypes.Contains(rt); }
public System.Collections.IEnumerable GetChildren(RepositoryModelItem item)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/RepositoryView.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/RepositoryView.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/RepositoryView.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -123,7 +123,7 @@
/// Adds a resource type to filter on
/// </summary>
/// <param name="rt"></param>
- public void AddResourceTypeFilter(ResourceTypes rt) { if (_model != null) _model.AddResourceTypeFilter(rt); }
+ public void AddResourceTypeFilter(string rt) { if (_model != null) _model.AddResourceTypeFilter(rt); }
/// <summary>
/// Clears all applied resource type filters
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/ResourcePicker.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/ResourcePicker.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/ResourcePicker.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -41,25 +41,25 @@
/// </summary>
public partial class ResourcePicker : Form
{
- private ResourceTypes[] _resTypes;
+ private string[] _resTypes;
private ResourcePicker()
{
InitializeComponent();
- _resTypes = new ResourceTypes[]
+ _resTypes = new string[]
{
- ResourceTypes.ApplicationDefinition,
- ResourceTypes.DrawingSource,
- ResourceTypes.FeatureSource,
- ResourceTypes.Folder,
- ResourceTypes.LayerDefinition,
- ResourceTypes.LoadProcedure,
- ResourceTypes.MapDefinition,
- ResourceTypes.PrintLayout,
- ResourceTypes.SymbolDefinition,
- ResourceTypes.SymbolLibrary,
- ResourceTypes.WebLayout,
- ResourceTypes.WatermarkDefinition
+ ResourceTypes.ApplicationDefinition.ToString(),
+ ResourceTypes.DrawingSource.ToString(),
+ ResourceTypes.FeatureSource.ToString(),
+ ResourceTypes.Folder.ToString(),
+ ResourceTypes.LayerDefinition.ToString(),
+ ResourceTypes.LoadProcedure.ToString(),
+ ResourceTypes.MapDefinition.ToString(),
+ ResourceTypes.PrintLayout.ToString(),
+ ResourceTypes.SymbolDefinition.ToString(),
+ ResourceTypes.SymbolLibrary.ToString(),
+ ResourceTypes.WebLayout.ToString(),
+ ResourceTypes.WatermarkDefinition.ToString()
};
cmbResourceFilter.DataSource = _resTypes;
RepositoryIcons.PopulateImageList(resImageList);
@@ -157,16 +157,16 @@
/// You cannot select folders in this mode. Attempting to set <see cref="SelectFoldersOnly"/> to
/// true will throw an <see cref="InvalidOperationException"/>
/// </summary>
- /// <param name="resSvc">The res SVC.</param>
- /// <param name="resFilter">The res filter.</param>
+ /// <param name="resSvc">The resource service.</param>
+ /// <param name="resTypeFilter">The resource type to filter on.</param>
/// <param name="mode">The mode.</param>
- public ResourcePicker(IResourceService resSvc, ResourceTypes resFilter, ResourcePickerMode mode)
+ public ResourcePicker(IResourceService resSvc, string resTypeFilter, ResourcePickerMode mode)
: this(resSvc, mode)
{
if (mode == ResourcePickerMode.OpenFolder)
throw new InvalidOperationException(string.Format(Strings.ModeNotAllowed, mode));
- this.Filter = resFilter;
+ this.Filter = resTypeFilter;
this.UseFilter = true;
_resourceMode = true;
@@ -178,12 +178,12 @@
/// is locked to that particular resource type, otherwise all resource type can be
/// selected
/// </summary>
- public ResourceTypes Filter
+ public string Filter
{
- get { return (ResourceTypes)cmbResourceFilter.SelectedItem; }
+ get { return cmbResourceFilter.SelectedItem.ToString(); }
set
{
- if (Array.IndexOf<ResourceTypes>(_resTypes, value) < 0)
+ if (Array.IndexOf<string>(_resTypes, value) < 0)
throw new InvalidOperationException("Cannot use specified resource type as filter: " + value); //LOCALIZE
cmbResourceFilter.SelectedItem = value;
@@ -288,7 +288,7 @@
}
else
{
- if (ResourceIdentifier.GetResourceType(txtResourceId.Text) != (ResourceTypes)cmbResourceFilter.SelectedItem)
+ if (ResourceIdentifier.GetResourceTypeAsString(txtResourceId.Text) != cmbResourceFilter.SelectedItem.ToString())
{
MessageBox.Show(Strings.InvalidResourceIdNotSpecifiedType);
return;
@@ -356,7 +356,7 @@
try
{
- var rt = ResourceIdentifier.GetResourceType(doc.ResourceId);
+ var rt = ResourceIdentifier.GetResourceTypeAsString(doc.ResourceId);
li.ImageIndex = RepositoryIcons.GetImageIndexForResourceType(rt);
}
catch
@@ -391,7 +391,7 @@
private bool IsPreviewable(ResourceListResourceDocument doc)
{
- return doc.ResourceType == ResourceTypes.SymbolDefinition;
+ return doc.ResourceType == ResourceTypes.SymbolDefinition.ToString();
}
private void txtName_TextChanged(object sender, EventArgs e)
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/SymbolPicker.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/SymbolPicker.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/SymbolPicker.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -66,7 +66,7 @@
public SymbolPicker(string symbolLibrary, IServerConnection conn)
: this(conn)
{
- if (ResourceIdentifier.GetResourceType(symbolLibrary) != OSGeo.MapGuide.MaestroAPI.ResourceTypes.SymbolLibrary)
+ if (ResourceIdentifier.GetResourceTypeAsString(symbolLibrary) != OSGeo.MapGuide.MaestroAPI.ResourceTypes.SymbolLibrary.ToString())
throw new ArgumentException(string.Format(Strings.ErrorInvalidSymbolLibraryResourceId, symbolLibrary));
txtSymbolLibrary.Text = symbolLibrary;
@@ -227,7 +227,7 @@
private void btnBrowse_Click(object sender, EventArgs e)
{
- using (var picker = new ResourcePicker(_conn.ResourceService, ResourceTypes.SymbolLibrary, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(_conn.ResourceService, ResourceTypes.SymbolLibrary.ToString(), ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == DialogResult.OK)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/Diff/CompareResourceDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Diff/CompareResourceDialog.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/Diff/CompareResourceDialog.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -139,7 +139,7 @@
return;
}
- ResourceTypes resType = ResourceIdentifier.GetResourceType(this.Source);
+ var resType = ResourceIdentifier.GetResourceTypeAsString(this.Source);
using (var picker = new ResourcePicker(_resSvc, resType, ResourcePickerMode.OpenResource))
{
Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/CreateLayersFromFeatureSourceDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/CreateLayersFromFeatureSourceDialog.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/CreateLayersFromFeatureSourceDialog.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -139,7 +139,7 @@
private void btnFeatureSource_Click(object sender, EventArgs e)
{
- using (var picker = new ResourcePicker(_conn.ResourceService, ResourceTypes.FeatureSource, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(_conn.ResourceService, ResourceTypes.FeatureSource.ToString(), ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Extensions/JoinSettings.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Extensions/JoinSettings.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Extensions/JoinSettings.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -85,7 +85,7 @@
private void btnBrowse_Click(object sender, EventArgs e)
{
- string resId = _edSvc.SelectResource(OSGeo.MapGuide.MaestroAPI.ResourceTypes.FeatureSource);
+ string resId = _edSvc.SelectResource(OSGeo.MapGuide.MaestroAPI.ResourceTypes.FeatureSource.ToString());
if (!string.IsNullOrEmpty(resId))
{
txtFeatureSource.Text = resId;
Modified: trunk/Tools/Maestro/Maestro.Editors/Fusion/MapCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Fusion/MapCtrl.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/Fusion/MapCtrl.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -369,7 +369,7 @@
private void btnBrowseMdf_Click(object sender, EventArgs e)
{
- using (var picker = new ResourcePicker(_edsvc.ResourceService, ResourceTypes.MapDefinition, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(_edsvc.ResourceService, ResourceTypes.MapDefinition.ToString(), ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == DialogResult.OK)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/Fusion/MapSettingsCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Fusion/MapSettingsCtrl.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/Fusion/MapSettingsCtrl.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -179,7 +179,7 @@
private void btnAddMap_Click(object sender, EventArgs e)
{
- using (var picker = new ResourcePicker(_edsvc.ResourceService, ResourceTypes.MapDefinition, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(_edsvc.ResourceService, ResourceTypes.MapDefinition.ToString(), ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == DialogResult.OK)
{
@@ -237,7 +237,7 @@
foreach (var r in rids)
{
- if (r.ResourceType != ResourceTypes.MapDefinition)
+ if (r.ResourceType != ResourceTypes.MapDefinition.ToString())
continue;
AddMapDefinition(r.ToString(), r.Name);
Modified: trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -104,8 +104,11 @@
/// <param name="xsdPath"></param>
public void LoadAutoCompletionData(string xsdPath)
{
- txtXmlContent.SchemaCompletionDataItems = Maestro.Editors.Generic.XmlEditor.AutoCompletion.XmlSchemaManager.Instance.SchemaCompletionDataItems;
- txtXmlContent.DefaultSchemaCompletionData = new XmlEditor.AutoCompletion.XmlSchemaCompletionData(xsdPath);
+ if (File.Exists(xsdPath))
+ {
+ txtXmlContent.SchemaCompletionDataItems = Maestro.Editors.Generic.XmlEditor.AutoCompletion.XmlSchemaManager.Instance.SchemaCompletionDataItems;
+ txtXmlContent.DefaultSchemaCompletionData = new XmlEditor.AutoCompletion.XmlSchemaCompletionData(xsdPath);
+ }
}
private string _origText;
Modified: trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorDialog.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorDialog.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -96,7 +96,7 @@
/// <summary>
/// Gets the type of the edited resource
/// </summary>
- public ResourceTypes ResourceType
+ public string ResourceType
{
get;
private set;
@@ -107,7 +107,7 @@
/// </summary>
/// <param name="xml"></param>
/// <param name="type"></param>
- public void SetXmlContent(string xml, ResourceTypes type)
+ public void SetXmlContent(string xml, string type)
{
_ed.XmlContent = xml;
this.ResourceType = type;
Modified: trunk/Tools/Maestro/Maestro.Editors/IEditorService.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/IEditorService.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/IEditorService.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -92,7 +92,7 @@
/// </summary>
/// <param name="resType"></param>
/// <returns></returns>
- string SelectResource(ResourceTypes resType);
+ string SelectResource(string resType);
/// <summary>
/// Invokes a prompt to select a folder
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Drawing/DrawingLayerSettingsCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Drawing/DrawingLayerSettingsCtrl.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Drawing/DrawingLayerSettingsCtrl.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -203,8 +203,8 @@
private void btnBrowse_Click(object sender, EventArgs e)
{
- using (var picker = new ResourcePicker(_service.ResourceService,
- OSGeo.MapGuide.MaestroAPI.ResourceTypes.DrawingSource,
+ using (var picker = new ResourcePicker(_service.ResourceService,
+ OSGeo.MapGuide.MaestroAPI.ResourceTypes.DrawingSource.ToString(),
ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == DialogResult.OK)
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/LayerPropertiesSectionCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/LayerPropertiesSectionCtrl.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/LayerPropertiesSectionCtrl.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -122,7 +122,7 @@
else
{
MessageBox.Show(string.Format(Strings.PromptRepairBrokenFeatureSource, _vl.ResourceId));
- using (var picker = new ResourcePicker(_edsvc.ResourceService, ResourceTypes.FeatureSource, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(_edsvc.ResourceService, ResourceTypes.FeatureSource.ToString(), ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == DialogResult.OK)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Raster/RasterLayerSettingsSectionCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Raster/RasterLayerSettingsSectionCtrl.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Raster/RasterLayerSettingsSectionCtrl.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -105,7 +105,7 @@
private void btnBrowseFeatureSource_Click(object sender, EventArgs e)
{
- using (var picker = new ResourcePicker(_edsvc.ResourceService, ResourceTypes.FeatureSource, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(_edsvc.ResourceService, ResourceTypes.FeatureSource.ToString(), ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == DialogResult.OK)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstanceEditors/ReferenceCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstanceEditors/ReferenceCtrl.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstanceEditors/ReferenceCtrl.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -48,8 +48,8 @@
private void btnBrowse_Click(object sender, EventArgs e)
{
- using (var picker = new ResourcePicker(_resSvc,
- ResourceTypes.SymbolDefinition,
+ using (var picker = new ResourcePicker(_resSvc,
+ ResourceTypes.SymbolDefinition.ToString(),
ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == DialogResult.OK)
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -248,7 +248,7 @@
private void referenceToolStripMenuItem_Click(object sender, EventArgs e)
{
- using (var picker = new ResourcePicker(_edSvc.ResourceService, ResourceTypes.SymbolDefinition, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(_edSvc.ResourceService, ResourceTypes.SymbolDefinition.ToString(), ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == DialogResult.OK)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -1587,7 +1587,7 @@
private void btnBrowseFeatureSource_Click(object sender, EventArgs e)
{
- using (var picker = new ResourcePicker(m_editor.ResourceService, ResourceTypes.FeatureSource, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(m_editor.ResourceService, ResourceTypes.FeatureSource.ToString(), ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/VectorLayerSettingsSectionCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/VectorLayerSettingsSectionCtrl.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/VectorLayerSettingsSectionCtrl.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -269,7 +269,7 @@
private void btnBrowseFeatureSource_Click(object sender, EventArgs e)
{
- using (var picker = new ResourcePicker(_edsvc.ResourceService, ResourceTypes.FeatureSource, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(_edsvc.ResourceService, ResourceTypes.FeatureSource.ToString(), ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == DialogResult.OK)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LayerPropertiesCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LayerPropertiesCtrl.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LayerPropertiesCtrl.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -78,7 +78,7 @@
private void btnBrowse_Click(object sender, EventArgs e)
{
- using (var picker = new ResourcePicker(_resSvc, ResourceTypes.LayerDefinition, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(_resSvc, ResourceTypes.LayerDefinition.ToString(), ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == DialogResult.OK)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LiveMapDefinitionEditorCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LiveMapDefinitionEditorCtrl.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LiveMapDefinitionEditorCtrl.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -116,12 +116,12 @@
_shadowCopy = (IMapDefinition)service.GetEditedResource();
_mapSvc = (IMappingService)_shadowCopy.CurrentConnection.GetService((int)ServiceType.Mapping);
_rtMap = _mapSvc.CreateMap(_shadowCopy);
- repoView.Init(service.ResourceService, new ResourceTypes[] {
- ResourceTypes.LayerDefinition,
- ResourceTypes.FeatureSource
- }, new ResourceTypes[] {
- ResourceTypes.LayerDefinition,
- ResourceTypes.FeatureSource
+ repoView.Init(service.ResourceService, new string[] {
+ ResourceTypes.LayerDefinition.ToString(),
+ ResourceTypes.FeatureSource.ToString()
+ }, new string[] {
+ ResourceTypes.LayerDefinition.ToString(),
+ ResourceTypes.FeatureSource.ToString()
});
ReloadViewer();
@@ -176,7 +176,7 @@
private void repoView_RequestAddToMap(object sender, EventArgs e)
{
var item = repoView.SelectedItem;
- if (item != null && item.ResourceType == ResourceTypes.LayerDefinition)
+ if (item != null && item.ResourceType == ResourceTypes.LayerDefinition.ToString())
{
var layer = _mapSvc.CreateMapLayer(_rtMap, ((ILayerDefinition)this.EditorService.ResourceService.GetResource(item.ResourceId)));
layer.Name = LiveMapEditorLegend.GenerateUniqueName(ResourceIdentifier.GetName(item.ResourceId), _rtMap.Layers);
Modified: trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LiveMapEditorDrawOrder.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LiveMapEditorDrawOrder.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LiveMapEditorDrawOrder.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -215,7 +215,7 @@
var layer = e.Data.GetData(typeof(RuntimeMapLayer)) as RuntimeMapLayer;
if (layer != null)
e.Effect = DragDropEffects.Move;
- else if (res != null && ResourceIdentifier.GetResourceType(res.ResourceID) == ResourceTypes.LayerDefinition)
+ else if (res != null && ResourceIdentifier.GetResourceTypeAsString(res.ResourceID) == ResourceTypes.LayerDefinition.ToString())
e.Effect = DragDropEffects.Copy;
}
@@ -242,7 +242,7 @@
OnLayerSelected(layer);
this.Viewer.RefreshMap();
}
- else if (res != null && ResourceIdentifier.GetResourceType(res.ResourceID) == ResourceTypes.LayerDefinition)
+ else if (res != null && ResourceIdentifier.GetResourceTypeAsString(res.ResourceID) == ResourceTypes.LayerDefinition.ToString())
{
var conn = _map.CurrentConnection;
var mapSvc = (IMappingService)conn.GetService((int)ServiceType.Mapping);
Modified: trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LiveMapEditorLegend.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LiveMapEditorLegend.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LiveMapEditorLegend.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -111,7 +111,7 @@
var map = this.Viewer.GetMap();
if (map != null)
{
- using (var picker = new ResourcePicker(map.CurrentConnection.ResourceService, ResourceTypes.LayerDefinition, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(map.CurrentConnection.ResourceService, ResourceTypes.LayerDefinition.ToString(), ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == DialogResult.OK)
{
@@ -139,7 +139,7 @@
var grp = node.Tag as GroupNodeMetadata;
if (grp != null)
{
- using (var picker = new ResourcePicker(map.CurrentConnection.ResourceService, ResourceTypes.LayerDefinition, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(map.CurrentConnection.ResourceService, ResourceTypes.LayerDefinition.ToString(), ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == DialogResult.OK)
{
@@ -205,7 +205,7 @@
private void AddLayerDefinition(ResourceDragMessage message, GroupNodeMetadata groupMeta)
{
- if (ResourceIdentifier.GetResourceType(message.ResourceID) == ResourceTypes.LayerDefinition)
+ if (ResourceIdentifier.GetResourceTypeAsString(message.ResourceID) == ResourceTypes.LayerDefinition.ToString())
{
var map = this.Viewer.GetMap();
var conn = map.CurrentConnection;
Modified: trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LiveMapEditorRepositoryView.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LiveMapEditorRepositoryView.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LiveMapEditorRepositoryView.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -43,10 +43,10 @@
public LiveMapEditorRepositoryView()
{
InitializeComponent();
- _editableTypes = new HashSet<ResourceTypes>();
+ _editableTypes = new HashSet<string>();
}
- private HashSet<ResourceTypes> _editableTypes;
+ private HashSet<string> _editableTypes;
/// <summary>
/// Initializes this view
@@ -54,7 +54,7 @@
/// <param name="resSvc">The resource service</param>
/// <param name="visibleType">An array of resource types that will be visible</param>
/// <param name="editableTypes">An array of resource types that are editable when selected</param>
- public void Init(IResourceService resSvc, ResourceTypes[] visibleType, ResourceTypes[] editableTypes)
+ public void Init(IResourceService resSvc, string[] visibleType, string[] editableTypes)
{
_editableTypes.Clear();
foreach (var rt in editableTypes)
@@ -116,7 +116,7 @@
{
var item = repoView.SelectedItem;
var condition = (item != null && !item.IsFolder);
- btnAddToMap.Enabled = condition && (item.ResourceType == ResourceTypes.LayerDefinition);
+ btnAddToMap.Enabled = condition && (item.ResourceType == ResourceTypes.LayerDefinition.ToString());
btnEdit.Enabled = condition && IsEditableType(item.ResourceType);
btnRefresh.Enabled = !condition;
var h = this.ItemSelected;
@@ -124,7 +124,7 @@
h(this, EventArgs.Empty);
}
- private bool IsEditableType(ResourceTypes rt)
+ private bool IsEditableType(string rt)
{
return _editableTypes.Contains(rt);
}
Modified: trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapLayersSectionCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapLayersSectionCtrl.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapLayersSectionCtrl.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -656,7 +656,7 @@
private void btnGRPAddLayer_Click(object sender, EventArgs e)
{
- using (var picker = new ResourcePicker(_edSvc.ResourceService, ResourceTypes.LayerDefinition, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(_edSvc.ResourceService, ResourceTypes.LayerDefinition.ToString(), ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == DialogResult.OK)
{
@@ -786,7 +786,7 @@
private void btnDLAddLayer_Click(object sender, EventArgs e)
{
- using (var picker = new ResourcePicker(_edSvc.ResourceService, ResourceTypes.LayerDefinition, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(_edSvc.ResourceService, ResourceTypes.LayerDefinition.ToString(), ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == DialogResult.OK)
{
@@ -1113,7 +1113,7 @@
private void btnAddBaseLayer_Click(object sender, EventArgs e)
{
- using (var picker = new ResourcePicker(_edSvc.ResourceService, ResourceTypes.LayerDefinition, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(_edSvc.ResourceService, ResourceTypes.LayerDefinition.ToString(), ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == DialogResult.OK)
{
@@ -1441,7 +1441,7 @@
}
//But only of the Layer Definition kind
- if (rids.Length == 1 && rids[0].ResourceId.ResourceType != ResourceTypes.LayerDefinition)
+ if (rids.Length == 1 && rids[0].ResourceId.ResourceType != ResourceTypes.LayerDefinition.ToString())
{
e.Effect = DragDropEffects.None;
return;
@@ -1450,7 +1450,7 @@
//Even in multiples
foreach (var r in rids)
{
- if (r.ResourceId.ResourceType != ResourceTypes.LayerDefinition)
+ if (r.ResourceId.ResourceType != ResourceTypes.LayerDefinition.ToString())
{
e.Effect = DragDropEffects.None;
return;
@@ -1488,7 +1488,7 @@
int added = 0;
foreach (var rid in rids)
{
- if (rid.ResourceId.ResourceType == ResourceTypes.LayerDefinition)
+ if (rid.ResourceId.ResourceType == ResourceTypes.LayerDefinition.ToString())
{
var name = GenerateLayerName(rid.ResourceId.ToString(), _map);
var layer = _map.AddLayer(parent == null ? null : parent.Name, name, rid.ResourceId.ToString());
@@ -1654,7 +1654,7 @@
int added = 0;
foreach (var rid in rids)
{
- if (rid.ResourceId.ResourceType == ResourceTypes.LayerDefinition)
+ if (rid.ResourceId.ResourceType == ResourceTypes.LayerDefinition.ToString())
{
var name = GenerateLayerName(rid.ResourceId.ToString(), _map);
//var layer = _map.AddLayer(parent == null ? null : parent.Name, name, rid.ToString());
@@ -1776,7 +1776,7 @@
foreach (var rid in rids)
{
- if (rid.ResourceId.ResourceType == ResourceTypes.LayerDefinition)
+ if (rid.ResourceId.ResourceType == ResourceTypes.LayerDefinition.ToString())
{
group.AddLayer(GenerateBaseLayerName(rid.ResourceId.ToString(), _map.BaseMap), rid.ResourceId.ToString());
added++;
Modified: trunk/Tools/Maestro/Maestro.Editors/Packaging/PackageEditorDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Packaging/PackageEditorDialog.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/Packaging/PackageEditorDialog.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -131,7 +131,7 @@
{
TreeNode n = cur.Nodes.Add(parts[parts.Length - 1]);
n.Tag = ri;
- n.ImageIndex = n.SelectedImageIndex = RepositoryIcons.GetImageIndexForResourceType(ResourceIdentifier.GetResourceType(ri.ResourcePath));
+ n.ImageIndex = n.SelectedImageIndex = RepositoryIcons.GetImageIndexForResourceType(ResourceIdentifier.GetResourceTypeAsString(ri.ResourcePath));
}
else
cur.Tag = ri;
@@ -385,7 +385,7 @@
var dlg = new AddResourceEntryDialog();
if (dlg.ShowDialog(this) == DialogResult.OK)
{
- int imageindex = RepositoryIcons.GetImageIndexForResourceType((ResourceTypes)Enum.Parse(typeof(ResourceTypes), Path.GetExtension(dlg.ResourceName).Replace(".", "")));
+ int imageindex = RepositoryIcons.GetImageIndexForResourceType(Path.GetExtension(dlg.ResourceName).Replace(".", ""));
TreeNode n = new TreeNode(dlg.ResourceName, imageindex, imageindex);
ResourceItem i = new ResourceItem("", dlg.HeaderFilepath, dlg.ContentFilepath);
i.EntryType = EntryTypeEnum.Added;
Modified: trunk/Tools/Maestro/Maestro.Editors/Preview/DefaultResourcePreviewer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Preview/DefaultResourcePreviewer.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/Preview/DefaultResourcePreviewer.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -95,7 +95,7 @@
edSvc.ResourceService.CopyResource(res.ResourceID, resId, true);
var previewCopy = edSvc.ResourceService.GetResource(resId);
- if (previewCopy.ResourceType == ResourceTypes.SymbolDefinition && conn.SiteVersion >= new Version(2, 0))
+ if (previewCopy.ResourceType == ResourceTypes.SymbolDefinition.ToString() && conn.SiteVersion >= new Version(2, 0))
{
return GenerateSymbolDefinitionPreview(conn, previewCopy, 100, 100);
}
@@ -177,7 +177,7 @@
var rt = res.ResourceType;
if (res.CurrentConnection.Capabilities.SupportsResourcePreviews)
{
- if (rt == ResourceTypes.SymbolDefinition)
+ if (rt == ResourceTypes.SymbolDefinition.ToString())
{
return res.CurrentConnection.SiteVersion >= new Version(2, 0) && Array.IndexOf(res.CurrentConnection.Capabilities.SupportedServices, (int)ServiceType.Mapping) >= 0;
}
Modified: trunk/Tools/Maestro/Maestro.Editors/Preview/LocalMapPreviewer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Preview/LocalMapPreviewer.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/Preview/LocalMapPreviewer.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -78,9 +78,9 @@
private static bool IsLocalPreviewableType(IResource res)
{
- return res.ResourceType == ResourceTypes.LayerDefinition ||
- res.ResourceType == ResourceTypes.MapDefinition ||
- res.ResourceType == ResourceTypes.WatermarkDefinition;
+ return res.ResourceType == ResourceTypes.LayerDefinition.ToString() ||
+ res.ResourceType == ResourceTypes.MapDefinition.ToString() ||
+ res.ResourceType == ResourceTypes.WatermarkDefinition.ToString();
}
/// <summary>
@@ -115,7 +115,7 @@
IMapDefinition previewMdf = null;
switch (res.ResourceType)
{
- case ResourceTypes.LayerDefinition:
+ case "LayerDefinition":
{
ILayerDefinition ldf = (ILayerDefinition)res;
string layerName = string.Empty;
@@ -126,12 +126,12 @@
previewMdf = ResourcePreviewEngine.CreateLayerPreviewMapDefinition(ldf, edSvc.SessionID, layerName, conn);
}
break;
- case ResourceTypes.WatermarkDefinition:
+ case "WatermarkDefinition":
{
previewMdf = ResourcePreviewEngine.CreateWatermarkPreviewMapDefinition((IWatermarkDefinition)res);
}
break;
- case ResourceTypes.MapDefinition:
+ case "MapDefinition":
{
previewMdf = (IMapDefinition)res;
}
Modified: trunk/Tools/Maestro/Maestro.Editors/Preview/ResourcePreviewEngine.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Preview/ResourcePreviewEngine.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/Preview/ResourcePreviewEngine.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -372,34 +372,34 @@
{
switch (res.ResourceType)
{
- case ResourceTypes.FeatureSource:
+ case "FeatureSource":
return GenerateFeatureSourcePreviewUrl(res, locale);
- case ResourceTypes.ApplicationDefinition:
+ case "ApplicationDefinition":
return GenerateFlexLayoutPreviewUrl(res, locale);
- case ResourceTypes.LayerDefinition:
+ case "LayerDefinition":
return GenerateLayerPreviewUrl(res, locale);
- case ResourceTypes.MapDefinition:
+ case "MapDefinition":
return GenerateMapPreviewUrl(res, locale);
- case ResourceTypes.WebLayout:
+ case "WebLayout":
return GenerateWebLayoutPreviewUrl(res, locale);
- case ResourceTypes.WatermarkDefinition:
+ case "WatermarkDefinition":
return GenerateWatermarkPreviewUrl((IWatermarkDefinition)res, locale);
default:
throw new InvalidOperationException(Strings.UnpreviewableResourceType);
}
}
- private static ResourceTypes[] PREVIEWABLE_RESOURCE_TYPES = new ResourceTypes[]
+ private static string[] PREVIEWABLE_RESOURCE_TYPES = new string[]
{
- ResourceTypes.FeatureSource,
- ResourceTypes.ApplicationDefinition,
- ResourceTypes.LayerDefinition,
- ResourceTypes.MapDefinition,
- ResourceTypes.WebLayout,
- ResourceTypes.WatermarkDefinition
+ ResourceTypes.FeatureSource.ToString(),
+ ResourceTypes.ApplicationDefinition.ToString(),
+ ResourceTypes.LayerDefinition.ToString(),
+ ResourceTypes.MapDefinition.ToString(),
+ ResourceTypes.WebLayout.ToString(),
+ ResourceTypes.WatermarkDefinition.ToString()
};
- internal static bool IsPreviewableType(OSGeo.MapGuide.MaestroAPI.ResourceTypes rt)
+ internal static bool IsPreviewableType(string rt)
{
return Array.IndexOf(PREVIEWABLE_RESOURCE_TYPES, rt) >= 0;
}
Modified: trunk/Tools/Maestro/Maestro.Editors/PrintLayout/LogoDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/PrintLayout/LogoDialog.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/PrintLayout/LogoDialog.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -117,7 +117,7 @@
private void btnBrowseSymbolLibrary_Click(object sender, EventArgs e)
{
- using (var picker = new ResourcePicker(_conn.ResourceService, ResourceTypes.SymbolLibrary, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(_conn.ResourceService, ResourceTypes.SymbolLibrary.ToString(), ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == DialogResult.OK)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/RepositoryIcons.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/RepositoryIcons.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/RepositoryIcons.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -93,33 +93,33 @@
/// </summary>
/// <param name="resType">Type of the resource.</param>
/// <returns></returns>
- public static int GetImageIndexForResourceType(ResourceTypes resType)
+ public static int GetImageIndexForResourceType(string resType)
{
switch (resType)
{
- case ResourceTypes.ApplicationDefinition:
+ case "ApplicationDefinition":
return RES_APPLICATIONDEFINITION;
- case ResourceTypes.DrawingSource:
+ case "DrawingSource":
return RES_DRAWINGSOURCE;
- case ResourceTypes.FeatureSource:
+ case "FeatureSource":
return RES_FEATURESOURCE;
- case ResourceTypes.Folder:
+ case "Folder":
return RES_FOLDER;
- case ResourceTypes.LayerDefinition:
+ case "LayerDefinition":
return RES_LAYERDEFINITION;
- case ResourceTypes.LoadProcedure:
+ case "LoadProcedure":
return RES_LOADPROCEDURE;
- case ResourceTypes.MapDefinition:
+ case "MapDefinition":
return RES_MAPDEFINITION;
- case ResourceTypes.PrintLayout:
+ case "PrintLayout":
return RES_PRINTLAYOUT;
- case ResourceTypes.SymbolDefinition:
+ case "SymbolDefinition":
return RES_SYMBOLDEFINITION;
- case ResourceTypes.SymbolLibrary:
+ case "SymbolLibrary":
return RES_SYMBOLLIBRARY;
- case ResourceTypes.WatermarkDefinition:
+ case "WatermarkDefinition":
return RES_WATERMARK;
- case ResourceTypes.WebLayout:
+ case "WebLayout":
return RES_WEBLAYOUT;
default:
throw new ArgumentException();
Modified: trunk/Tools/Maestro/Maestro.Editors/ResourceEditorServiceBase.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/ResourceEditorServiceBase.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/ResourceEditorServiceBase.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -117,7 +117,7 @@
{
if (_editCopy == null)
{
- string copy = _conn.GenerateSessionResourceId(ResourceIdentifier.GetResourceType(this.ResourceID));
+ string copy = _conn.GenerateSessionResourceId(ResourceIdentifier.GetResourceTypeAsString(this.ResourceID));
_conn.ResourceService.CopyResource(this.ResourceID, copy, true);
@@ -204,7 +204,7 @@
/// </summary>
/// <param name="resType"></param>
/// <returns></returns>
- public string SelectResource(OSGeo.MapGuide.MaestroAPI.ResourceTypes resType)
+ public string SelectResource(string resType)
{
var picker = new ResourcePicker(_conn.ResourceService, resType, ResourcePickerMode.OpenResource);
if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
Modified: trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/CompoundSymbolDefinitionEditorCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/CompoundSymbolDefinitionEditorCtrl.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/CompoundSymbolDefinitionEditorCtrl.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -128,7 +128,7 @@
private void symbolReferenceToolStripMenuItem_Click(object sender, EventArgs e)
{
using (var picker = new ResourcePicker(_edSvc.ResourceService,
- ResourceTypes.SymbolDefinition,
+ ResourceTypes.SymbolDefinition.ToString(),
ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == DialogResult.OK)
Modified: trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/ExtractSymbolLibraryDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/ExtractSymbolLibraryDialog.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/ExtractSymbolLibraryDialog.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -80,7 +80,7 @@
private void btnSource_Click(object sender, EventArgs e)
{
- using (var picker = new ResourcePicker(_conn.ResourceService, ResourceTypes.SymbolLibrary, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(_conn.ResourceService, ResourceTypes.SymbolLibrary.ToString(), ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == DialogResult.OK)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/SimpleSymbolReferenceCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/SimpleSymbolReferenceCtrl.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/SimpleSymbolReferenceCtrl.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -60,7 +60,7 @@
private void btnBrowse_Click(object sender, EventArgs e)
{
using (var picker = new ResourcePicker(_resSvc,
- ResourceTypes.SymbolDefinition,
+ ResourceTypes.SymbolDefinition.ToString(),
ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == DialogResult.OK)
Modified: trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/SymbolEditorService.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/SymbolEditorService.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/SymbolEditorService.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -96,7 +96,7 @@
return _inner.SelectAnyResource();
}
- public string SelectResource(ResourceTypes resType)
+ public string SelectResource(string resType)
{
return _inner.SelectResource(resType);
}
Modified: trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkCollectionEditorCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkCollectionEditorCtrl.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkCollectionEditorCtrl.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -58,7 +58,7 @@
private void btnAdd_Click(object sender, EventArgs e)
{
- using (var picker = new ResourcePicker(_edSvc.ResourceService, ResourceTypes.WatermarkDefinition, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(_edSvc.ResourceService, ResourceTypes.WatermarkDefinition.ToString(), ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == DialogResult.OK)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkInstanceEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkInstanceEditor.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkInstanceEditor.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -126,7 +126,7 @@
private void btnBrowse_Click(object sender, EventArgs e)
{
- using (var picker = new ResourcePicker(_edSvc.ResourceService, ResourceTypes.WatermarkDefinition, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(_edSvc.ResourceService, ResourceTypes.WatermarkDefinition.ToString(), ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == DialogResult.OK)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/WebLayout/WebLayoutSettingsCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/WebLayout/WebLayoutSettingsCtrl.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Editors/WebLayout/WebLayoutSettingsCtrl.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -228,7 +228,7 @@
private void btnBrowse_Click(object sender, EventArgs e)
{
- using (var picker = new ResourcePicker(_edsvc.ResourceService, ResourceTypes.MapDefinition, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(_edsvc.ResourceService, ResourceTypes.MapDefinition.ToString(), ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == DialogResult.OK)
{
Modified: trunk/Tools/Maestro/Maestro.LiveMapEditor/MainForm.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.LiveMapEditor/MainForm.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.LiveMapEditor/MainForm.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -201,7 +201,7 @@
{
ClearExistingEditor();
- using (var picker = new ResourcePicker(_conn.ResourceService, ResourceTypes.MapDefinition, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(_conn.ResourceService, ResourceTypes.MapDefinition.ToString(), ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
@@ -229,7 +229,7 @@
private void DoSaveAs()
{
- using (var picker = new ResourcePicker(_conn.ResourceService, ResourceTypes.MapDefinition, ResourcePickerMode.SaveResource))
+ using (var picker = new ResourcePicker(_conn.ResourceService, ResourceTypes.MapDefinition.ToString(), ResourcePickerMode.SaveResource))
{
if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
Modified: trunk/Tools/Maestro/Maestro.Packaging/PackageBuilder.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Packaging/PackageBuilder.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/Maestro.Packaging/PackageBuilder.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -425,7 +425,11 @@
manifest.Operations = new ResourcePackageManifestOperations();
manifest.Operations.Operation = new System.ComponentModel.BindingList<ResourcePackageManifestOperationsOperation>();
- var allowed = new List<ResourceTypes>(allowedExtensions);
+ var allowed = new List<string>();
+ foreach (var rt in allowedExtensions)
+ {
+ allowed.Add(rt.ToString());
+ }
var files = new List<string>();
var folders = new List<string>();
var resourceData = new Dictionary<string, List<ResourceDataListResourceData>>();
Modified: trunk/Tools/Maestro/MaestroAPITests/CapabilityTests.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/CapabilityTests.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/MaestroAPITests/CapabilityTests.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -58,54 +58,54 @@
{
try
{
- caps.GetMaxSupportedResourceVersion(type);
+ caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.Fail("MGOS 1.0.0 doesn't support fusion!");
}
catch (UnsupportedResourceTypeException ex)
{
- Assert.AreEqual(ex.ResourceType, ResourceTypes.ApplicationDefinition);
+ Assert.AreEqual(ex.ResourceType, ResourceTypes.ApplicationDefinition.ToString());
}
}
break;
case ResourceTypes.DrawingSource:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.FeatureSource:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.LayerDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.LoadProcedure:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.MapDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.PrintLayout:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.SymbolLibrary:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
@@ -113,18 +113,18 @@
{
try
{
- caps.GetMaxSupportedResourceVersion(type);
+ caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.Fail("MGOS 1.0.0 doesn't support advanced symbology!");
}
catch (UnsupportedResourceTypeException ex)
{
- Assert.AreEqual(ex.ResourceType, ResourceTypes.SymbolDefinition);
+ Assert.AreEqual(ex.ResourceType, ResourceTypes.SymbolDefinition.ToString());
}
}
break;
case ResourceTypes.WebLayout:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
@@ -195,54 +195,54 @@
{
try
{
- caps.GetMaxSupportedResourceVersion(type);
+ caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.Fail("MGOS 1.1.0 doesn't support fusion!");
}
catch (UnsupportedResourceTypeException ex)
{
- Assert.AreEqual(ex.ResourceType, ResourceTypes.ApplicationDefinition);
+ Assert.AreEqual(ex.ResourceType, ResourceTypes.ApplicationDefinition.ToString());
}
}
break;
case ResourceTypes.DrawingSource:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.FeatureSource:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.LayerDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.LoadProcedure:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.MapDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.PrintLayout:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.SymbolLibrary:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
@@ -250,18 +250,18 @@
{
try
{
- caps.GetMaxSupportedResourceVersion(type);
+ caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.Fail("MGOS 1.1.0 doesn't support advanced symbology!");
}
catch (UnsupportedResourceTypeException ex)
{
- Assert.AreEqual(ex.ResourceType, ResourceTypes.SymbolDefinition);
+ Assert.AreEqual(ex.ResourceType, ResourceTypes.SymbolDefinition.ToString());
}
}
break;
case ResourceTypes.WebLayout:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
@@ -332,66 +332,66 @@
{
try
{
- caps.GetMaxSupportedResourceVersion(type);
+ caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.Fail("MGOS 1.2.0 doesn't support fusion!");
}
catch (UnsupportedResourceTypeException ex)
{
- Assert.AreEqual(ex.ResourceType, ResourceTypes.ApplicationDefinition);
+ Assert.AreEqual(ex.ResourceType, ResourceTypes.ApplicationDefinition.ToString());
}
}
break;
case ResourceTypes.DrawingSource:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.FeatureSource:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.LayerDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 1, 0));
}
break;
case ResourceTypes.LoadProcedure:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.MapDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.PrintLayout:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.SymbolLibrary:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.SymbolDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.WebLayout:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
@@ -460,61 +460,61 @@
{
case ResourceTypes.ApplicationDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.DrawingSource:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.FeatureSource:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.LayerDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 2, 0));
}
break;
case ResourceTypes.LoadProcedure:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 1, 0));
}
break;
case ResourceTypes.MapDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.PrintLayout:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.SymbolLibrary:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.SymbolDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 1, 0));
}
break;
case ResourceTypes.WebLayout:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
@@ -580,61 +580,61 @@
{
case ResourceTypes.ApplicationDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.DrawingSource:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.FeatureSource:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.LayerDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 3, 0));
}
break;
case ResourceTypes.LoadProcedure:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 1, 0));
}
break;
case ResourceTypes.MapDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.PrintLayout:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.SymbolLibrary:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.SymbolDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 1, 0));
}
break;
case ResourceTypes.WebLayout:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
@@ -700,61 +700,61 @@
{
case ResourceTypes.ApplicationDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.DrawingSource:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.FeatureSource:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.LayerDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 3, 0));
}
break;
case ResourceTypes.LoadProcedure:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(2, 2, 0));
}
break;
case ResourceTypes.MapDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.PrintLayout:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.SymbolLibrary:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.SymbolDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 1, 0));
}
break;
case ResourceTypes.WebLayout:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 1, 0));
}
break;
@@ -820,67 +820,67 @@
{
case ResourceTypes.ApplicationDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.DrawingSource:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.FeatureSource:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.LayerDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(2, 3, 0));
}
break;
case ResourceTypes.LoadProcedure:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(2, 2, 0));
}
break;
case ResourceTypes.MapDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(2, 3, 0));
}
break;
case ResourceTypes.PrintLayout:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.SymbolLibrary:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.SymbolDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 1, 0));
}
break;
case ResourceTypes.WatermarkDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(2, 3, 0));
}
break;
case ResourceTypes.WebLayout:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 1, 0));
}
break;
@@ -946,67 +946,67 @@
{
case ResourceTypes.ApplicationDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.DrawingSource:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.FeatureSource:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.LayerDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(2, 4, 0));
}
break;
case ResourceTypes.LoadProcedure:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(2, 2, 0));
}
break;
case ResourceTypes.MapDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(2, 4, 0));
}
break;
case ResourceTypes.PrintLayout:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.SymbolLibrary:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.SymbolDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(2, 4, 0));
}
break;
case ResourceTypes.WatermarkDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(2, 4, 0));
}
break;
case ResourceTypes.WebLayout:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(2, 4, 0));
}
break;
@@ -1072,67 +1072,67 @@
{
case ResourceTypes.ApplicationDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.DrawingSource:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.FeatureSource:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.LayerDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(2, 4, 0));
}
break;
case ResourceTypes.LoadProcedure:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(2, 2, 0));
}
break;
case ResourceTypes.MapDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(2, 4, 0));
}
break;
case ResourceTypes.PrintLayout:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.SymbolLibrary:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.SymbolDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(2, 4, 0));
}
break;
case ResourceTypes.WatermarkDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(2, 4, 0));
}
break;
case ResourceTypes.WebLayout:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(2, 4, 0));
}
break;
@@ -1198,67 +1198,67 @@
{
case ResourceTypes.ApplicationDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.DrawingSource:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.FeatureSource:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.LayerDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(2, 4, 0));
}
break;
case ResourceTypes.LoadProcedure:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(2, 2, 0));
}
break;
case ResourceTypes.MapDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(2, 4, 0));
}
break;
case ResourceTypes.PrintLayout:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.SymbolLibrary:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(1, 0, 0));
}
break;
case ResourceTypes.SymbolDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(2, 4, 0));
}
break;
case ResourceTypes.WatermarkDefinition:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(2, 4, 0));
}
break;
case ResourceTypes.WebLayout:
{
- var version = caps.GetMaxSupportedResourceVersion(type);
+ var version = caps.GetMaxSupportedResourceVersion(type.ToString());
Assert.AreEqual(version, new Version(2, 6, 0));
}
break;
Modified: trunk/Tools/Maestro/MaestroAPITests/ResourceTests.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/ResourceTests.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/MaestroAPITests/ResourceTests.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -68,7 +68,7 @@
Stub.On(conn).GetProperty("Capabilities").Will(Return.Value(caps));
foreach (var rt in Enum.GetValues(typeof(ResourceTypes)))
{
- Stub.On(caps).Method("GetMaxSupportedResourceVersion").With(rt).Will(Return.Value(new Version(1, 0, 0)));
+ Stub.On(caps).Method("GetMaxSupportedResourceVersion").With(rt.ToString()).Will(Return.Value(new Version(1, 0, 0)));
}
var app = ObjectFactory.DeserializeEmbeddedFlexLayout(conn);
@@ -117,7 +117,7 @@
Stub.On(conn).GetProperty("Capabilities").Will(Return.Value(caps));
foreach (var rt in Enum.GetValues(typeof(ResourceTypes)))
{
- Stub.On(caps).Method("GetMaxSupportedResourceVersion").With(rt).Will(Return.Value(new Version(1, 0, 0)));
+ Stub.On(caps).Method("GetMaxSupportedResourceVersion").With(rt.ToString()).Will(Return.Value(new Version(1, 0, 0)));
}
//Verify that only valid resource identifiers can be assigned to certain resource types.
@@ -573,40 +573,40 @@
[Test]
public void TestResourceTypeDescriptor()
{
- var rtd = new ResourceTypeDescriptor(ResourceTypes.ApplicationDefinition, "1.0.0");
+ var rtd = new ResourceTypeDescriptor(ResourceTypes.ApplicationDefinition.ToString(), "1.0.0");
Assert.AreEqual(rtd.XsdName, "ApplicationDefinition-1.0.0.xsd");
- rtd = new ResourceTypeDescriptor(ResourceTypes.DrawingSource, "1.0.0");
+ rtd = new ResourceTypeDescriptor(ResourceTypes.DrawingSource.ToString(), "1.0.0");
Assert.AreEqual(rtd.XsdName, "DrawingSource-1.0.0.xsd");
- rtd = new ResourceTypeDescriptor(ResourceTypes.FeatureSource, "1.0.0");
+ rtd = new ResourceTypeDescriptor(ResourceTypes.FeatureSource.ToString(), "1.0.0");
Assert.AreEqual(rtd.XsdName, "FeatureSource-1.0.0.xsd");
- rtd = new ResourceTypeDescriptor(ResourceTypes.LayerDefinition, "1.0.0");
+ rtd = new ResourceTypeDescriptor(ResourceTypes.LayerDefinition.ToString(), "1.0.0");
Assert.AreEqual(rtd.XsdName, "LayerDefinition-1.0.0.xsd");
- rtd = new ResourceTypeDescriptor(ResourceTypes.LayerDefinition, "1.1.0");
+ rtd = new ResourceTypeDescriptor(ResourceTypes.LayerDefinition.ToString(), "1.1.0");
Assert.AreEqual(rtd.XsdName, "LayerDefinition-1.1.0.xsd");
- rtd = new ResourceTypeDescriptor(ResourceTypes.LoadProcedure, "1.0.0");
+ rtd = new ResourceTypeDescriptor(ResourceTypes.LoadProcedure.ToString(), "1.0.0");
Assert.AreEqual(rtd.XsdName, "LoadProcedure-1.0.0.xsd");
- rtd = new ResourceTypeDescriptor(ResourceTypes.MapDefinition, "1.0.0");
+ rtd = new ResourceTypeDescriptor(ResourceTypes.MapDefinition.ToString(), "1.0.0");
Assert.AreEqual(rtd.XsdName, "MapDefinition-1.0.0.xsd");
- rtd = new ResourceTypeDescriptor(ResourceTypes.DrawingSource, "1.0.0");
+ rtd = new ResourceTypeDescriptor(ResourceTypes.DrawingSource.ToString(), "1.0.0");
Assert.AreEqual(rtd.XsdName, "DrawingSource-1.0.0.xsd");
- rtd = new ResourceTypeDescriptor(ResourceTypes.PrintLayout, "1.0.0");
+ rtd = new ResourceTypeDescriptor(ResourceTypes.PrintLayout.ToString(), "1.0.0");
Assert.AreEqual(rtd.XsdName, "PrintLayout-1.0.0.xsd");
- rtd = new ResourceTypeDescriptor(ResourceTypes.SymbolDefinition, "1.0.0");
+ rtd = new ResourceTypeDescriptor(ResourceTypes.SymbolDefinition.ToString(), "1.0.0");
Assert.AreEqual(rtd.XsdName, "SymbolDefinition-1.0.0.xsd");
- rtd = new ResourceTypeDescriptor(ResourceTypes.SymbolLibrary, "1.0.0");
+ rtd = new ResourceTypeDescriptor(ResourceTypes.SymbolLibrary.ToString(), "1.0.0");
Assert.AreEqual(rtd.XsdName, "SymbolLibrary-1.0.0.xsd");
- rtd = new ResourceTypeDescriptor(ResourceTypes.WebLayout, "1.0.0");
+ rtd = new ResourceTypeDescriptor(ResourceTypes.WebLayout.ToString(), "1.0.0");
Assert.AreEqual(rtd.XsdName, "WebLayout-1.0.0.xsd");
}
@@ -1085,7 +1085,7 @@
Stub.On(conn).GetProperty("Capabilities").Will(Return.Value(caps));
foreach (var rt in Enum.GetValues(typeof(ResourceTypes)))
{
- Stub.On(caps).Method("GetMaxSupportedResourceVersion").With(rt).Will(Return.Value(new Version(1, 0, 0)));
+ Stub.On(caps).Method("GetMaxSupportedResourceVersion").With(rt.ToString()).Will(Return.Value(new Version(1, 0, 0)));
}
IMapDefinition mdf = ObjectFactory.CreateMapDefinition(conn, "Test");
Modified: trunk/Tools/Maestro/MaestroFsPreview/MainForm.cs
===================================================================
--- trunk/Tools/Maestro/MaestroFsPreview/MainForm.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/MaestroFsPreview/MainForm.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -50,7 +50,7 @@
private void btnBrowse_Click(object sender, EventArgs e)
{
- using (var picker = new ResourcePicker(_edSvc.ResourceService, ResourceTypes.FeatureSource, ResourcePickerMode.OpenResource))
+ using (var picker = new ResourcePicker(_edSvc.ResourceService, ResourceTypes.FeatureSource.ToString(), ResourcePickerMode.OpenResource))
{
if (picker.ShowDialog() == DialogResult.OK)
{
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.ExtendedObjectModels/ModelSetup.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ExtendedObjectModels/ModelSetup.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ExtendedObjectModels/ModelSetup.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -88,7 +88,7 @@
//Layer Definition 1.1.0
ResourceValidatorSet.RegisterValidator(new Ldf110.LayerDefinitionValidator());
ResourceTypeRegistry.RegisterResource(
- new ResourceTypeDescriptor(ResourceTypes.LayerDefinition, "1.1.0"),
+ new ResourceTypeDescriptor(ResourceTypes.LayerDefinition.ToString(), "1.1.0"),
new ResourceSerializationCallback(Ldf110.LdfEntryPoint.Serialize),
new ResourceDeserializationCallback(Ldf110.LdfEntryPoint.Deserialize));
ObjectFactory.RegisterLayerFactoryMethod(new Version(1, 1, 0), new LayerCreatorFunc(Ldf110.LdfEntryPoint.CreateDefault));
@@ -96,7 +96,7 @@
//Layer Definition 1.2.0
ResourceValidatorSet.RegisterValidator(new Ldf120.LayerDefinitionValidator());
ResourceTypeRegistry.RegisterResource(
- new ResourceTypeDescriptor(ResourceTypes.LayerDefinition, "1.2.0"),
+ new ResourceTypeDescriptor(ResourceTypes.LayerDefinition.ToString(), "1.2.0"),
new ResourceSerializationCallback(Ldf120.LdfEntryPoint.Serialize),
new ResourceDeserializationCallback(Ldf120.LdfEntryPoint.Deserialize));
ObjectFactory.RegisterLayerFactoryMethod(new Version(1, 2, 0), new LayerCreatorFunc(Ldf120.LdfEntryPoint.CreateDefault));
@@ -104,7 +104,7 @@
//Layer Definition 1.3.0
ResourceValidatorSet.RegisterValidator(new Ldf130.LayerDefinitionValidator());
ResourceTypeRegistry.RegisterResource(
- new ResourceTypeDescriptor(ResourceTypes.LayerDefinition, "1.3.0"),
+ new ResourceTypeDescriptor(ResourceTypes.LayerDefinition.ToString(), "1.3.0"),
new ResourceSerializationCallback(Ldf130.LdfEntryPoint.Serialize),
new ResourceDeserializationCallback(Ldf130.LdfEntryPoint.Deserialize));
ObjectFactory.RegisterLayerFactoryMethod(new Version(1, 3, 0), new LayerCreatorFunc(Ldf130.LdfEntryPoint.CreateDefault));
@@ -112,7 +112,7 @@
//Layer Definition 2.3.0
ResourceValidatorSet.RegisterValidator(new Ldf230.LayerDefinitionValidator());
ResourceTypeRegistry.RegisterResource(
- new ResourceTypeDescriptor(ResourceTypes.LayerDefinition, "2.3.0"),
+ new ResourceTypeDescriptor(ResourceTypes.LayerDefinition.ToString(), "2.3.0"),
new ResourceSerializationCallback(Ldf230.LdfEntryPoint.Serialize),
new ResourceDeserializationCallback(Ldf230.LdfEntryPoint.Deserialize));
ObjectFactory.RegisterLayerFactoryMethod(new Version(2, 3, 0), new LayerCreatorFunc(Ldf230.LdfEntryPoint.CreateDefault));
@@ -120,7 +120,7 @@
//Layer Definition 2.4.0
ResourceValidatorSet.RegisterValidator(new Ldf240.LayerDefinitionValidator());
ResourceTypeRegistry.RegisterResource(
- new ResourceTypeDescriptor(ResourceTypes.LayerDefinition, "2.4.0"),
+ new ResourceTypeDescriptor(ResourceTypes.LayerDefinition.ToString(), "2.4.0"),
new ResourceSerializationCallback(Ldf240.LdfEntryPoint.Serialize),
new ResourceDeserializationCallback(Ldf240.LdfEntryPoint.Deserialize));
ObjectFactory.RegisterLayerFactoryMethod(new Version(2, 4, 0), new LayerCreatorFunc(Ldf240.LdfEntryPoint.CreateDefault));
@@ -128,7 +128,7 @@
//Load Procedure 1.1.0
ResourceValidatorSet.RegisterValidator(new Lp110.LoadProcedureValidator());
ResourceTypeRegistry.RegisterResource(
- new ResourceTypeDescriptor(ResourceTypes.LoadProcedure, "1.1.0"),
+ new ResourceTypeDescriptor(ResourceTypes.LoadProcedure.ToString(), "1.1.0"),
new ResourceSerializationCallback(Lp110.LoadProcEntryPoint.Serialize),
new ResourceDeserializationCallback(Lp110.LoadProcEntryPoint.Deserialize));
@@ -138,7 +138,7 @@
//Load Procedure 2.2.0
ResourceValidatorSet.RegisterValidator(new Lp220.LoadProcedureValidator());
ResourceTypeRegistry.RegisterResource(
- new ResourceTypeDescriptor(ResourceTypes.LoadProcedure, "2.2.0"),
+ new ResourceTypeDescriptor(ResourceTypes.LoadProcedure.ToString(), "2.2.0"),
new ResourceSerializationCallback(Lp220.LoadProcEntryPoint.Serialize),
new ResourceDeserializationCallback(Lp220.LoadProcEntryPoint.Deserialize));
ObjectFactory.RegisterLoadProcedureFactoryMethod(LoadType.Sqlite, new LoadProcCreatorFunc(Lp220.LoadProcEntryPoint.CreateDefaultSqlite));
@@ -146,7 +146,7 @@
//Web Layout 1.1.0
ResourceValidatorSet.RegisterValidator(new WL110.WebLayoutValidator());
ResourceTypeRegistry.RegisterResource(
- new ResourceTypeDescriptor(ResourceTypes.WebLayout, "1.1.0"),
+ new ResourceTypeDescriptor(ResourceTypes.WebLayout.ToString(), "1.1.0"),
new ResourceSerializationCallback(WL110.WebLayoutEntryPoint.Serialize),
new ResourceDeserializationCallback(WL110.WebLayoutEntryPoint.Deserialize));
ObjectFactory.RegisterWebLayoutFactoryMethod(new Version(1, 1, 0), new WebLayoutCreatorFunc(WL110.WebLayoutEntryPoint.CreateDefault));
@@ -154,7 +154,7 @@
//Web Layout 2.4.0
ResourceValidatorSet.RegisterValidator(new WL240.WebLayoutValidator());
ResourceTypeRegistry.RegisterResource(
- new ResourceTypeDescriptor(ResourceTypes.WebLayout, "2.4.0"),
+ new ResourceTypeDescriptor(ResourceTypes.WebLayout.ToString(), "2.4.0"),
new ResourceSerializationCallback(WL240.WebLayoutEntryPoint.Serialize),
new ResourceDeserializationCallback(WL240.WebLayoutEntryPoint.Deserialize));
ObjectFactory.RegisterWebLayoutFactoryMethod(new Version(2, 4, 0), new WebLayoutCreatorFunc(WL240.WebLayoutEntryPoint.CreateDefault));
@@ -162,7 +162,7 @@
//Web Layout 2.6.0
ResourceValidatorSet.RegisterValidator(new WL260.WebLayoutValidator());
ResourceTypeRegistry.RegisterResource(
- new ResourceTypeDescriptor(ResourceTypes.WebLayout, "2.6.0"),
+ new ResourceTypeDescriptor(ResourceTypes.WebLayout.ToString(), "2.6.0"),
new ResourceSerializationCallback(WL260.WebLayoutEntryPoint.Serialize),
new ResourceDeserializationCallback(WL260.WebLayoutEntryPoint.Deserialize));
ObjectFactory.RegisterWebLayoutFactoryMethod(new Version(2, 6, 0), new WebLayoutCreatorFunc(WL260.WebLayoutEntryPoint.CreateDefault));
@@ -170,7 +170,7 @@
//Symbol Definition 1.1.0
ResourceValidatorSet.RegisterValidator(new Sym110.SymbolDefinitionValidator());
ResourceTypeRegistry.RegisterResource(
- new ResourceTypeDescriptor(ResourceTypes.SymbolDefinition, "1.1.0"),
+ new ResourceTypeDescriptor(ResourceTypes.SymbolDefinition.ToString(), "1.1.0"),
new ResourceSerializationCallback(Sym110.SymbolDefEntryPoint.Serialize),
new ResourceDeserializationCallback(Sym110.SymbolDefEntryPoint.Deserialize));
ObjectFactory.RegisterCompoundSymbolFactoryMethod(new Version(1, 1, 0), new CompoundSymbolDefCreatorFunc(Sym110.SymbolDefEntryPoint.CreateDefaultCompound));
@@ -179,7 +179,7 @@
//Symbol Definition 2.4.0
ResourceValidatorSet.RegisterValidator(new Sym240.SymbolDefinitionValidator());
ResourceTypeRegistry.RegisterResource(
- new ResourceTypeDescriptor(ResourceTypes.SymbolDefinition, "2.4.0"),
+ new ResourceTypeDescriptor(ResourceTypes.SymbolDefinition.ToString(), "2.4.0"),
new ResourceSerializationCallback(Sym240.SymbolDefEntryPoint.Serialize),
new ResourceDeserializationCallback(Sym240.SymbolDefEntryPoint.Deserialize));
ObjectFactory.RegisterCompoundSymbolFactoryMethod(new Version(2, 4, 0), new CompoundSymbolDefCreatorFunc(Sym240.SymbolDefEntryPoint.CreateDefaultCompound));
@@ -188,7 +188,7 @@
//Map Definition 2.3.0
ResourceValidatorSet.RegisterValidator(new Mdf230.MapDefinitionValidator());
ResourceTypeRegistry.RegisterResource(
- new ResourceTypeDescriptor(ResourceTypes.MapDefinition, "2.3.0"),
+ new ResourceTypeDescriptor(ResourceTypes.MapDefinition.ToString(), "2.3.0"),
new ResourceSerializationCallback(Mdf230.MdfEntryPoint.Serialize),
new ResourceDeserializationCallback(Mdf230.MdfEntryPoint.Deserialize));
ObjectFactory.RegisterMapDefinitionFactoryMethod(new Version(2, 3, 0), new MapDefinitionCreatorFunc(Mdf230.MdfEntryPoint.CreateDefault));
@@ -196,21 +196,21 @@
//Map Definition 2.4.0
ResourceValidatorSet.RegisterValidator(new Mdf240.MapDefinitionValidator());
ResourceTypeRegistry.RegisterResource(
- new ResourceTypeDescriptor(ResourceTypes.MapDefinition, "2.4.0"),
+ new ResourceTypeDescriptor(ResourceTypes.MapDefinition.ToString(), "2.4.0"),
new ResourceSerializationCallback(Mdf240.MdfEntryPoint.Serialize),
new ResourceDeserializationCallback(Mdf240.MdfEntryPoint.Deserialize));
ObjectFactory.RegisterMapDefinitionFactoryMethod(new Version(2, 4, 0), new MapDefinitionCreatorFunc(Mdf240.MdfEntryPoint.CreateDefault));
//Watermark Definition 2.3.0
ResourceTypeRegistry.RegisterResource(
- new ResourceTypeDescriptor(ResourceTypes.WatermarkDefinition, "2.3.0"),
+ new ResourceTypeDescriptor(ResourceTypes.WatermarkDefinition.ToString(), "2.3.0"),
new ResourceSerializationCallback(Wdf230.WdfEntryPoint.Serialize),
new ResourceDeserializationCallback(Wdf230.WdfEntryPoint.Deserialize));
ObjectFactory.RegisterWatermarkDefinitionFactoryMethod(new Version(2, 3, 0), new WatermarkCreatorFunc(Wdf230.WdfEntryPoint.CreateDefault));
//Watermark Definition 2.4.0
ResourceTypeRegistry.RegisterResource(
- new ResourceTypeDescriptor(ResourceTypes.WatermarkDefinition, "2.4.0"),
+ new ResourceTypeDescriptor(ResourceTypes.WatermarkDefinition.ToString(), "2.4.0"),
new ResourceSerializationCallback(Wdf240.WdfEntryPoint.Serialize),
new ResourceDeserializationCallback(Wdf240.WdfEntryPoint.Deserialize));
ObjectFactory.RegisterWatermarkDefinitionFactoryMethod(new Version(2, 4, 0), new WatermarkCreatorFunc(Wdf240.WdfEntryPoint.CreateDefault));
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Capability/ConnectionCapabilities.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Capability/ConnectionCapabilities.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Capability/ConnectionCapabilities.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -49,33 +49,33 @@
/// </summary>
/// <param name="resourceType"></param>
/// <returns></returns>
- public virtual Version GetMaxSupportedResourceVersion(ResourceTypes resourceType)
+ public virtual Version GetMaxSupportedResourceVersion(string resourceType)
{
Version ver = new Version(1, 0, 0);
switch (resourceType)
{
- case ResourceTypes.ApplicationDefinition:
+ case "ApplicationDefinition":
if (!SupportsFusion())
- throw new UnsupportedResourceTypeException(ResourceTypes.ApplicationDefinition);
+ throw new UnsupportedResourceTypeException("ApplicationDefinition");
break;
- case ResourceTypes.WatermarkDefinition:
+ case "WatermarkDefinition":
ver = GetMaxWatermarkDefinitionVersion();
break;
- case ResourceTypes.MapDefinition:
+ case "MapDefinition":
ver = GetMaxMapDefinitionVersion();
break;
- case ResourceTypes.LayerDefinition:
+ case "LayerDefinition":
ver = GetMaxLayerDefinitionVersion();
break;
- case ResourceTypes.LoadProcedure:
+ case "LoadProcedure":
ver = GetMaxLoadProcedureVersion();
break;
- case ResourceTypes.WebLayout:
+ case "WebLayout":
ver = GetMaxWebLayoutVersion();
break;
- case ResourceTypes.SymbolDefinition:
+ case "SymbolDefinition":
if (!SupportsAdvancedSymbols())
- throw new UnsupportedResourceTypeException(ResourceTypes.SymbolDefinition);
+ throw new UnsupportedResourceTypeException("SymbolDefinition");
else
ver = GetMaxSymbolDefinitionVersion();
break;
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Commands/ExecuteLoadProcedure.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Commands/ExecuteLoadProcedure.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Commands/ExecuteLoadProcedure.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -105,7 +105,7 @@
if (!ResourceIdentifier.Validate(this.ResourceID))
throw new ArgumentException("Invalid resource id: " + this.ResourceID);
- if (ResourceIdentifier.GetResourceType(this.ResourceID) != ResourceTypes.LoadProcedure)
+ if (ResourceIdentifier.GetResourceTypeAsString(this.ResourceID) != ResourceTypes.LoadProcedure.ToString())
throw new ArgumentException("Not a load procedure resource id: " + this.ResourceID);
ILoadProcedure proc = (ILoadProcedure)this.Parent.ResourceService.GetResource(resourceID);
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CrossConnection/ResourceMigrator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CrossConnection/ResourceMigrator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CrossConnection/ResourceMigrator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -212,7 +212,7 @@
int progress = 0;
foreach (var resId in resourceIds)
{
- string targetId = folderId + ResourceIdentifier.GetName(resId) + "." + ResourceIdentifier.GetResourceType(resId); //NOXLATE
+ string targetId = folderId + ResourceIdentifier.GetName(resId) + "." + ResourceIdentifier.GetResourceTypeAsString(resId); //NOXLATE
string message = string.Empty;
IResource res = _source.ResourceService.GetResource(resId);
@@ -294,7 +294,7 @@
int progress = 0;
foreach (var resId in resourceIds)
{
- string targetId = folderId + ResourceIdentifier.GetName(resId) + "." + ResourceIdentifier.GetResourceType(resId); //NOXLATE
+ string targetId = folderId + ResourceIdentifier.GetName(resId) + "." + ResourceIdentifier.GetResourceTypeAsString(resId); //NOXLATE
string message = string.Empty;
IResource res = _source.ResourceService.GetResource(resId);
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Exceptions/UnsupportedResourceTypeException.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Exceptions/UnsupportedResourceTypeException.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Exceptions/UnsupportedResourceTypeException.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -39,21 +39,21 @@
/// <summary>
/// Initializes a new instance of the <see cref="UnsupportedResourceTypeException"/> class.
/// </summary>
- /// <param name="rt">The rt.</param>
- public UnsupportedResourceTypeException(ResourceTypes rt) { this.ResourceType = rt; }
+ /// <param name="rt">The resource type.</param>
+ public UnsupportedResourceTypeException(string rt) { this.ResourceType = rt; }
/// <summary>
/// Initializes a new instance of the <see cref="UnsupportedResourceTypeException"/> class.
/// </summary>
- /// <param name="rt">The rt.</param>
+ /// <param name="rt">The resource type.</param>
/// <param name="message">The message.</param>
- public UnsupportedResourceTypeException(ResourceTypes rt, string message) : base(message) { this.ResourceType = rt; }
+ public UnsupportedResourceTypeException(string rt, string message) : base(message) { this.ResourceType = rt; }
/// <summary>
/// Initializes a new instance of the <see cref="UnsupportedResourceTypeException"/> class.
/// </summary>
- /// <param name="rt">The rt.</param>
+ /// <param name="rt">The resource type.</param>
/// <param name="message">The message.</param>
/// <param name="inner">The inner.</param>
- public UnsupportedResourceTypeException(ResourceTypes rt, string message, Exception inner) : base(message, inner) { this.ResourceType = rt; }
+ public UnsupportedResourceTypeException(string rt, string message, Exception inner) : base(message, inner) { this.ResourceType = rt; }
/// <summary>
/// Initializes a new instance of the <see cref="UnsupportedResourceTypeException"/> class.
/// </summary>
@@ -74,6 +74,6 @@
/// Gets or sets the type of the resource.
/// </summary>
/// <value>The type of the resource.</value>
- public ResourceTypes ResourceType { get; private set; }
+ public string ResourceType { get; private set; }
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/IConnectionCapabilities.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/IConnectionCapabilities.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/IConnectionCapabilities.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -34,7 +34,7 @@
/// </summary>
/// <param name="resourceType"></param>
/// <returns></returns>
- Version GetMaxSupportedResourceVersion(ResourceTypes resourceType);
+ Version GetMaxSupportedResourceVersion(string resourceType);
/// <summary>
/// Indicates whether the current connection can be used between multiple threads
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/IServerConnection.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/IServerConnection.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/IServerConnection.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -257,7 +257,7 @@
/// <param name="conn">The conn.</param>
/// <param name="resType">Type of the res.</param>
/// <returns></returns>
- public static string GenerateSessionResourceId(this IServerConnection conn, ResourceTypes resType)
+ public static string GenerateSessionResourceId(this IServerConnection conn, string resType)
{
Guid id = Guid.NewGuid();
return conn.GenerateSessionResourceId(id.ToString(), resType);
@@ -270,9 +270,9 @@
/// <param name="name">The name.</param>
/// <param name="resType">Type of the res.</param>
/// <returns></returns>
- public static string GenerateSessionResourceId(this IServerConnection conn, string name, ResourceTypes resType)
+ public static string GenerateSessionResourceId(this IServerConnection conn, string name, string resType)
{
- return "Session:" + conn.SessionID + "//" + name + "." + resType.ToString(); //NOXLATE
+ return "Session:" + conn.SessionID + "//" + name + "." + resType; //NOXLATE
}
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/ApplicationDefinition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/ApplicationDefinition.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/ApplicationDefinition.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -147,11 +147,11 @@
}
[XmlIgnore]
- public ResourceTypes ResourceType
+ public string ResourceType
{
get
{
- return ResourceTypes.ApplicationDefinition;
+ return ResourceTypes.ApplicationDefinition.ToString();
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/DrawingSource.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/DrawingSource.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/DrawingSource.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -67,11 +67,11 @@
}
[XmlIgnore]
- public ResourceTypes ResourceType
+ public string ResourceType
{
get
{
- return ResourceTypes.DrawingSource;
+ return ResourceTypes.DrawingSource.ToString();
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/FeatureSource.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/FeatureSource.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/FeatureSource.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -68,11 +68,11 @@
}
[XmlIgnore]
- public ResourceTypes ResourceType
+ public string ResourceType
{
get
{
- return ResourceTypes.FeatureSource;
+ return ResourceTypes.FeatureSource.ToString();
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/IRepositoryItem.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/IRepositoryItem.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/IRepositoryItem.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -46,7 +46,7 @@
/// Gets the type of the resource.
/// </summary>
/// <value>The type of the resource.</value>
- ResourceTypes ResourceType { get; }
+ string ResourceType { get; }
/// <summary>
/// Gets a value indicating whether this instance is folder.
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LoadProcedure.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LoadProcedure.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LoadProcedure.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -76,11 +76,11 @@
}
[XmlIgnore]
- public ResourceTypes ResourceType
+ public string ResourceType
{
get
{
- return ResourceTypes.LoadProcedure;
+ return ResourceTypes.LoadProcedure.ToString();
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/MapDefinition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/MapDefinition.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/MapDefinition.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -166,11 +166,11 @@
}
[XmlIgnore]
- public virtual ResourceTypes ResourceType
+ public virtual string ResourceType
{
get
{
- return ResourceTypes.MapDefinition;
+ return ResourceTypes.MapDefinition.ToString();
}
}
@@ -278,7 +278,7 @@
Check.NotEmpty(layerName, "layerName"); //NOXLATE
Check.NotEmpty(layerDefinitionId, "layerDefinitionId"); //NOXLATE
Check.Precondition(ResourceIdentifier.Validate(layerDefinitionId), "ResourceIdentifier.Validate(layerDefinitionId)"); //NOXLATE
- Check.Precondition(ResourceIdentifier.GetResourceType(layerDefinitionId) == ResourceTypes.LayerDefinition, "ResourceIdentifier.GetResourceType(layerDefinitionId) == ResourceTypes.LayerDefinition"); //NOXLATE
+ Check.Precondition(ResourceIdentifier.GetResourceTypeAsString(layerDefinitionId) == ResourceTypes.LayerDefinition.ToString(), "ResourceIdentifier.GetResourceTypeAsString(layerDefinitionId) == ResourceTypes.LayerDefinition.ToString()"); //NOXLATE
if (!string.IsNullOrEmpty(groupName))
{
Check.Precondition(this.GetGroupByName(groupName) != null, "There should be an existing group for <groupName>"); //NOXLATE
@@ -348,7 +348,7 @@
Check.NotEmpty(layerName, "layerName"); //NOXLATE
Check.NotEmpty(layerDefinitionId, "layerDefinitionId"); //NOXLATE
Check.Precondition(ResourceIdentifier.Validate(layerDefinitionId), "ResourceIdentifier.Validate(layerDefinitionId)"); //NOXLATE
- Check.Precondition(ResourceIdentifier.GetResourceType(layerDefinitionId) == ResourceTypes.LayerDefinition, "ResourceIdentifier.GetResourceType(layerDefinitionId) == ResourceTypes.LayerDefinition"); //NOXLATE
+ Check.Precondition(ResourceIdentifier.GetResourceTypeAsString(layerDefinitionId) == ResourceTypes.LayerDefinition.ToString(), "ResourceIdentifier.GetResourceTypeAsString(layerDefinitionId) == ResourceTypes.LayerDefinition.ToString()"); //NOXLATE
if (!string.IsNullOrEmpty(groupName))
{
Check.NotNull(this.GetGroupByName(groupName), "Group for <groupName>"); //NOXLATE
@@ -374,7 +374,7 @@
Check.NotEmpty(layerName, "layerName"); //NOXLATE
Check.NotEmpty(layerDefinitionId, "layerDefinitionId"); //NOXLATE
Check.Precondition(ResourceIdentifier.Validate(layerDefinitionId), "ResourceIdentifier.Validate(layerDefinitionId)"); //NOXLATE
- Check.Precondition(ResourceIdentifier.GetResourceType(layerDefinitionId) == ResourceTypes.LayerDefinition, "ResourceIdentifier.GetResourceType(layerDefinitionId) == ResourceTypes.LayerDefinition"); //NOXLATE
+ Check.Precondition(ResourceIdentifier.GetResourceTypeAsString(layerDefinitionId) == ResourceTypes.LayerDefinition.ToString(), "ResourceIdentifier.GetResourceTypeAsString(layerDefinitionId) == ResourceTypes.LayerDefinition.ToString()"); //NOXLATE
if (!string.IsNullOrEmpty(groupName))
{
Check.NotNull(this.GetGroupByName(groupName), "Group for <groupName>"); //NOXLATE
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/ObjectFactory.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/ObjectFactory.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/ObjectFactory.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -258,7 +258,7 @@
/// <returns></returns>
public static IWebLayout CreateWebLayout(IServerConnection owner, string mapDefinitionId)
{
- var ver = owner.Capabilities.GetMaxSupportedResourceVersion(ResourceTypes.WebLayout);
+ var ver = owner.Capabilities.GetMaxSupportedResourceVersion(ResourceTypes.WebLayout.ToString());
return CreateWebLayout(owner, ver, mapDefinitionId);
}
@@ -270,7 +270,7 @@
/// <returns></returns>
public static ILayerDefinition CreateDefaultLayer(IServerConnection owner, LayerType type)
{
- var ver = owner.Capabilities.GetMaxSupportedResourceVersion(ResourceTypes.LayerDefinition);
+ var ver = owner.Capabilities.GetMaxSupportedResourceVersion(ResourceTypes.LayerDefinition.ToString());
return CreateDefaultLayer(owner, type, ver);
}
@@ -354,7 +354,7 @@
public static IWatermarkDefinition CreateWatermark(IServerConnection owner, SymbolDefinitionType type)
{
Check.NotNull(owner, "owner"); //NOXLATE
- return CreateWatermark(owner, type, owner.Capabilities.GetMaxSupportedResourceVersion(ResourceTypes.WatermarkDefinition));
+ return CreateWatermark(owner, type, owner.Capabilities.GetMaxSupportedResourceVersion(ResourceTypes.WatermarkDefinition.ToString()));
}
/// <summary>
@@ -438,7 +438,7 @@
{
Check.NotNull(owner, "owner"); //NOXLATE
- return CreateMapDefinition(owner, owner.Capabilities.GetMaxSupportedResourceVersion(ResourceTypes.MapDefinition), name);
+ return CreateMapDefinition(owner, owner.Capabilities.GetMaxSupportedResourceVersion(ResourceTypes.MapDefinition.ToString()), name);
}
/// <summary>
@@ -452,7 +452,7 @@
{
Check.NotNull(owner, "owner"); //NOXLATE
- return CreateMapDefinition(owner, owner.Capabilities.GetMaxSupportedResourceVersion(ResourceTypes.MapDefinition), name, coordinateSystemWkt);
+ return CreateMapDefinition(owner, owner.Capabilities.GetMaxSupportedResourceVersion(ResourceTypes.MapDefinition.ToString()), name, coordinateSystemWkt);
}
/// <summary>
@@ -467,7 +467,7 @@
{
Check.NotNull(owner, "owner"); //NOXLATE
- return CreateMapDefinition(owner, owner.Capabilities.GetMaxSupportedResourceVersion(ResourceTypes.MapDefinition), name, coordinateSystemWkt, env);
+ return CreateMapDefinition(owner, owner.Capabilities.GetMaxSupportedResourceVersion(ResourceTypes.MapDefinition.ToString()), name, coordinateSystemWkt, env);
}
/// <summary>
@@ -713,7 +713,7 @@
/// <returns></returns>
public static ISimpleSymbolDefinition CreateSimpleSymbol(IServerConnection owner, string name, string description)
{
- var ver = owner.Capabilities.GetMaxSupportedResourceVersion(ResourceTypes.SymbolDefinition);
+ var ver = owner.Capabilities.GetMaxSupportedResourceVersion(ResourceTypes.SymbolDefinition.ToString());
return CreateSimpleSymbol(owner, ver, name, description);
}
@@ -748,7 +748,7 @@
/// <returns></returns>
public static ICompoundSymbolDefinition CreateCompoundSymbol(IServerConnection owner, string name, string description)
{
- var ver = owner.Capabilities.GetMaxSupportedResourceVersion(ResourceTypes.SymbolDefinition);
+ var ver = owner.Capabilities.GetMaxSupportedResourceVersion(ResourceTypes.SymbolDefinition.ToString());
return CreateCompoundSymbol(owner, ver, name, description);
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/PrintLayout.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/PrintLayout.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/PrintLayout.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -66,11 +66,11 @@
}
[XmlIgnore]
- public ResourceTypes ResourceType
+ public string ResourceType
{
get
{
- return ResourceTypes.PrintLayout;
+ return ResourceTypes.PrintLayout.ToString();
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/ResourceItems.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/ResourceItems.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/ResourceItems.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -55,7 +55,7 @@
public bool HasChildren { get { return false; } } //Documents don't have child resources
[XmlIgnore]
- public ResourceTypes ResourceType { get { return ResourceIdentifier.GetResourceType(this.ResourceId); } }
+ public string ResourceType { get { return ResourceIdentifier.GetResourceTypeAsString(this.ResourceId); } }
[XmlIgnore]
public bool IsFolder { get { return false; } }
@@ -79,7 +79,7 @@
public bool HasChildren { get { return int.Parse(this.NumberOfDocuments) > 0 || int.Parse(this.NumberOfFolders) > 0; } }
[XmlIgnore]
- public ResourceTypes ResourceType { get { return ResourceTypes.Folder; } }
+ public string ResourceType { get { return ResourceTypes.Folder.ToString(); } }
[XmlIgnore]
public bool IsFolder { get { return true; } }
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/SymbolDefinition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/SymbolDefinition.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/SymbolDefinition.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -85,11 +85,11 @@
}
[XmlIgnore]
- public ResourceTypes ResourceType
+ public string ResourceType
{
get
{
- return ResourceTypes.SymbolDefinition;
+ return ResourceTypes.SymbolDefinition.ToString();
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/SymbolLibrary.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/SymbolLibrary.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/SymbolLibrary.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -66,11 +66,11 @@
}
[XmlIgnore]
- public ResourceTypes ResourceType
+ public string ResourceType
{
get
{
- return ResourceTypes.SymbolLibrary;
+ return ResourceTypes.SymbolLibrary.ToString();
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/UntypedResource.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/UntypedResource.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/UntypedResource.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -33,14 +33,14 @@
/// </summary>
public class UntypedResource : IResource
{
- internal UntypedResource(string xml, ResourceTypes resourceType, string version)
+ internal UntypedResource(string xml, string resourceType, string version)
{
this.XmlContent = xml;
this.ResourceType = resourceType;
this.ResourceVersion = new Version(version);
}
- internal UntypedResource(string xml, ResourceTypes resourceType, Version version)
+ internal UntypedResource(string xml, string resourceType, Version version)
{
this.XmlContent = xml;
this.ResourceType = resourceType;
@@ -77,7 +77,7 @@
/// <summary>
/// Gets the resource type
/// </summary>
- public ResourceTypes ResourceType
+ public string ResourceType
{
get;
private set;
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/VectorLayerDefinitionImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/VectorLayerDefinitionImpl.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/VectorLayerDefinitionImpl.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -1689,11 +1689,11 @@
}
[XmlIgnore]
- public ResourceTypes ResourceType
+ public string ResourceType
{
get
{
- return ResourceTypes.LayerDefinition;
+ return ResourceTypes.LayerDefinition.ToString();
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/WebLayout.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/WebLayout.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/WebLayout.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -128,11 +128,11 @@
}
[XmlIgnore]
- public ResourceTypes ResourceType
+ public string ResourceType
{
get
{
- return ResourceTypes.WebLayout;
+ return ResourceTypes.WebLayout.ToString();
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -401,7 +401,7 @@
virtual public IResource GetResource(string resourceID)
{
var stream = GetResourceXmlData(resourceID);
- var rt = ResourceIdentifier.GetResourceType(resourceID);
+ var rt = ResourceIdentifier.GetResourceTypeAsString(resourceID);
IResource o = ResourceTypeRegistry.Deserialize(rt, stream);
o.CurrentConnection = GetInterface();
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Conversion/ImageSymbolConverter.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Conversion/ImageSymbolConverter.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Conversion/ImageSymbolConverter.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -51,7 +51,7 @@
{
Check.NotNull(conn, "conn"); //NOXLATE
Check.NotEmpty(symbolLibId, "symbolLibId"); //NOXLATE
- Check.Precondition(ResourceIdentifier.GetResourceType(symbolLibId) == ResourceTypes.SymbolLibrary, "ResourceIdentifier.GetResourceType(symbolLibId) == ResourceTypes.SymbolLibrary"); //NOXLATE
+ Check.Precondition(ResourceIdentifier.GetResourceTypeAsString(symbolLibId) == ResourceTypes.SymbolLibrary.ToString(), "ResourceIdentifier.GetResourceTypeAsString(symbolLibId) == ResourceTypes.SymbolLibrary.ToString()"); //NOXLATE
Check.Precondition(Array.IndexOf(conn.Capabilities.SupportedServices, (int)ServiceType.Drawing) >= 0, "Array.IndexOf(conn.Capabilities.SupportedServices, (int)ServiceType.Drawing) >= 0"); //NOXLATE
_symbolLibId = symbolLibId;
_conn = conn;
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/IResource.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/IResource.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/IResource.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -55,7 +55,7 @@
/// Gets the type of the resource.
/// </summary>
/// <value>The type of the resource.</value>
- ResourceTypes ResourceType { get; }
+ string ResourceType { get; }
/// <summary>
/// Serializes this instance to XML and returns the XML content. It is not recommended to call this method directly
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/ResourceContentVersionChecker.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/ResourceContentVersionChecker.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/ResourceContentVersionChecker.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -99,7 +99,7 @@
version = xsd.Substring(start + 1, xsd.Length - end);
string typeStr = xsd.Substring(0, start);
- return new ResourceTypeDescriptor((ResourceTypes)Enum.Parse(typeof(ResourceTypes), typeStr), version);
+ return new ResourceTypeDescriptor(typeStr, version);
}
finally
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/ResourceIdentifier.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/ResourceIdentifier.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/ResourceIdentifier.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -205,9 +205,9 @@
/// <summary>
/// Gets the resource type
/// </summary>
- public ResourceTypes ResourceType
+ public string ResourceType
{
- get { return GetResourceType(m_id); }
+ get { return GetResourceTypeAsString(m_id); }
}
/// <summary>
@@ -381,11 +381,22 @@
}
/// <summary>
- /// Gets the type of the resource.
+ /// Gets the type of this resource.
/// </summary>
+ /// <remarks>Use this method over <see cref="M:OSGeo.MapGuide.MaestroAPI.Resource.ResourceIdentifier.GetResourceType"/> if the Maestro API may not be aware of the new resource type</remarks>
+ /// <param name="identifier"></param>
+ /// <returns></returns>
+ public static string GetResourceTypeAsString(string identifier)
+ {
+ return GetExtension(identifier);
+ }
+
+ /// <summary>
+ /// Gets the known type of the resource.
+ /// </summary>
/// <param name="identifier">The identifier.</param>
/// <returns></returns>
- public static ResourceTypes GetResourceType(string identifier)
+ private static ResourceTypes GetResourceType(string identifier)
{
var ext = GetExtension(identifier);
if (ext == "Map") //NOXLATE
@@ -452,8 +463,9 @@
/// Determines if a resource identifier is valid
/// </summary>
/// <param name="identifier">The identifier to validate</param>
+ /// <param name="strict">If true, will check if the type of the resource id is one that is supported by Maestro</param>
/// <returns>A value indicating if the identifier is valid</returns>
- public static bool Validate(string identifier)
+ public static bool Validate(string identifier, bool strict = true)
{
try
{
@@ -467,7 +479,10 @@
if (IsFolderResource(identifier))
return true;
- var rt = GetResourceType(identifier);
+ if (strict)
+ {
+ var rt = GetResourceType(identifier);
+ }
}
catch
{
@@ -565,10 +580,11 @@
/// Gets the parent folder.
/// </summary>
/// <param name="identifier">The identifier.</param>
+ /// <param name="strict">If true, the type of the identifier must be one that is supported by Maestro</param>
/// <returns></returns>
- public static string GetParentFolder(string identifier)
+ public static string GetParentFolder(string identifier, bool strict = true)
{
- if (!Validate(identifier))
+ if (!Validate(identifier, strict))
throw new Exception(Strings.ErrorInvalidResourceIdentifier);
identifier = Normalize(identifier);
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/ResourceTypeDescriptor.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/ResourceTypeDescriptor.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/ResourceTypeDescriptor.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -33,11 +33,7 @@
/// </summary>
/// <param name="resType">Type of the res.</param>
/// <param name="ver">The ver.</param>
- public ResourceTypeDescriptor(ResourceTypes resType, string ver)
- : this(resType.ToString(), ver)
- { }
-
- private ResourceTypeDescriptor(string resType, string ver)
+ public ResourceTypeDescriptor(string resType, string ver)
{
Check.NotEmpty(resType, "resType"); //NOXLATE
Check.NotEmpty(ver, "ver"); //NOXLATE
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ApplicationDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ApplicationDefinitionValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ApplicationDefinitionValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -44,7 +44,7 @@
/// <returns></returns>
public ValidationIssue[] Validate(ResourceValidationContext context, IResource resource, bool recurse)
{
- if (resource.ResourceType != OSGeo.MapGuide.MaestroAPI.ResourceTypes.ApplicationDefinition)
+ if (resource.ResourceType != OSGeo.MapGuide.MaestroAPI.ResourceTypes.ApplicationDefinition.ToString())
return null;
//TODO: Other items to check for
@@ -198,7 +198,7 @@
/// <value></value>
public ResourceTypeDescriptor SupportedResourceAndVersion
{
- get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.ApplicationDefinition, "1.0.0"); }
+ get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.ApplicationDefinition.ToString(), "1.0.0"); }
}
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseLoadProcedureValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseLoadProcedureValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseLoadProcedureValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -47,7 +47,7 @@
if (context.IsAlreadyValidated(resource.ResourceID))
return null;
- if (resource.ResourceType != OSGeo.MapGuide.MaestroAPI.ResourceTypes.LoadProcedure)
+ if (resource.ResourceType != OSGeo.MapGuide.MaestroAPI.ResourceTypes.LoadProcedure.ToString())
return null;
if (resource.ResourceVersion != new Version(1, 0, 0))
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseMapDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseMapDefinitionValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseMapDefinitionValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -70,7 +70,7 @@
if (context.IsAlreadyValidated(resource.ResourceID))
return null;
- if (resource.ResourceType != ResourceTypes.MapDefinition)
+ if (resource.ResourceType != ResourceTypes.MapDefinition.ToString())
return null;
List<ValidationIssue> issues = new List<ValidationIssue>();
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseSymbolDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseSymbolDefinitionValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseSymbolDefinitionValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -47,7 +47,7 @@
if (context.IsAlreadyValidated(resource.ResourceID))
return null;
- if (resource.ResourceType != ResourceTypes.SymbolDefinition)
+ if (resource.ResourceType != ResourceTypes.SymbolDefinition.ToString())
return null;
var issues = new List<ValidationIssue>();
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseWebLayoutValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseWebLayoutValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseWebLayoutValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -54,7 +54,7 @@
if (context.IsAlreadyValidated(resource.ResourceID))
return null;
- if (resource.ResourceType != OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout)
+ if (resource.ResourceType != OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout.ToString())
return null;
List<ValidationIssue> issues = new List<ValidationIssue>();
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/DrawingSourceValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/DrawingSourceValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/DrawingSourceValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -46,7 +46,7 @@
if (context.IsAlreadyValidated(resource.ResourceID))
return null;
- if (resource.ResourceType != ResourceTypes.DrawingSource)
+ if (resource.ResourceType != ResourceTypes.DrawingSource.ToString())
return null;
var issues = new List<ValidationIssue>();
@@ -69,7 +69,7 @@
/// <value></value>
public ResourceTypeDescriptor SupportedResourceAndVersion
{
- get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.DrawingSource, "1.0.0"); } //NOXLATE
+ get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.DrawingSource.ToString(), "1.0.0"); } //NOXLATE
}
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/FeatureSourceValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/FeatureSourceValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/FeatureSourceValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -51,7 +51,7 @@
if (context.IsAlreadyValidated(resource.ResourceID))
return null;
- if (resource.ResourceType != ResourceTypes.FeatureSource)
+ if (resource.ResourceType != ResourceTypes.FeatureSource.ToString())
return null;
List<ValidationIssue> issues = new List<ValidationIssue>();
@@ -219,7 +219,7 @@
/// <value></value>
public ResourceTypeDescriptor SupportedResourceAndVersion
{
- get { return new ResourceTypeDescriptor(ResourceTypes.FeatureSource, "1.0.0"); } //NOXLATE
+ get { return new ResourceTypeDescriptor(ResourceTypes.FeatureSource.ToString(), "1.0.0"); } //NOXLATE
}
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/LayerDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/LayerDefinitionValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/LayerDefinitionValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -38,7 +38,7 @@
/// <value>The supported resource and version.</value>
public override ResourceTypeDescriptor SupportedResourceAndVersion
{
- get { return new ResourceTypeDescriptor(ResourceTypes.LayerDefinition, "1.0.0"); }
+ get { return new ResourceTypeDescriptor(ResourceTypes.LayerDefinition.ToString(), "1.0.0"); }
}
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/LoadProcedureValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/LoadProcedureValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/LoadProcedureValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -36,7 +36,7 @@
/// <value></value>
public override ResourceTypeDescriptor SupportedResourceAndVersion
{
- get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LoadProcedure, "1.0.0"); }
+ get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.LoadProcedure.ToString(), "1.0.0"); }
}
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/MapDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/MapDefinitionValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/MapDefinitionValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -42,7 +42,7 @@
/// <value></value>
public override ResourceTypeDescriptor SupportedResourceAndVersion
{
- get { return new ResourceTypeDescriptor(ResourceTypes.MapDefinition, "1.0.0"); }
+ get { return new ResourceTypeDescriptor(ResourceTypes.MapDefinition.ToString(), "1.0.0"); }
}
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/PrintLayoutValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/PrintLayoutValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/PrintLayoutValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -55,7 +55,7 @@
if (context.IsAlreadyValidated(resource.ResourceID))
return null;
- if (resource.ResourceType != ResourceTypes.PrintLayout)
+ if (resource.ResourceType != ResourceTypes.PrintLayout.ToString())
return null;
//TODO: What problems could there possibly be?
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ResourceValidatorSet.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ResourceValidatorSet.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ResourceValidatorSet.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -110,7 +110,7 @@
/// <returns>
/// <c>true</c> if the specified resource types has validator; otherwise, <c>false</c>.
/// </returns>
- public static bool HasValidator(ResourceTypes resourceTypes, Version version)
+ public static bool HasValidator(string resourceTypes, Version version)
{
bool found = false;
var find = new ResourceTypeDescriptor(resourceTypes, version.ToString());
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/SymbolDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/SymbolDefinitionValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/SymbolDefinitionValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -37,7 +37,7 @@
/// <value></value>
public override ResourceTypeDescriptor SupportedResourceAndVersion
{
- get { return new ResourceTypeDescriptor(ResourceTypes.SymbolDefinition, "1.0.0"); } //NOXLATE
+ get { return new ResourceTypeDescriptor(ResourceTypes.SymbolDefinition.ToString(), "1.0.0"); } //NOXLATE
}
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/SymbolLibraryValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/SymbolLibraryValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/SymbolLibraryValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -54,7 +54,7 @@
if (context.IsAlreadyValidated(resource.ResourceID))
return null;
- if (resource.ResourceType != ResourceTypes.SymbolLibrary)
+ if (resource.ResourceType != ResourceTypes.SymbolLibrary.ToString())
return null;
//TODO: What problems could there possibly be?
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/WebLayoutValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/WebLayoutValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/WebLayoutValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -39,7 +39,7 @@
/// <value></value>
public override ResourceTypeDescriptor SupportedResourceAndVersion
{
- get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout, "1.0.0"); } //NOXLATE
+ get { return new ResourceTypeDescriptor(OSGeo.MapGuide.MaestroAPI.ResourceTypes.WebLayout.ToString(), "1.0.0"); } //NOXLATE
}
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ResourceTypeRegistry.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ResourceTypeRegistry.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ResourceTypeRegistry.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -224,7 +224,7 @@
/// <param name="resourceType">Type of the resource.</param>
/// <param name="stream">The stream.</param>
/// <returns></returns>
- public static IResource Deserialize(ResourceTypes resourceType, Stream stream)
+ public static IResource Deserialize(string resourceType, Stream stream)
{
//UGLY: We have to peek inside the stream to determine the version number
@@ -299,9 +299,7 @@
if (!_serializers.ContainsKey(rd))
{
- var rtype = (ResourceTypes)Enum.Parse(typeof(ResourceTypes), rd.ResourceType);
- return new UntypedResource(xml, rtype, rd.Version);
- //throw new SerializationException(Strings.ERR_NO_SERIALIZER + rd.ToString());
+ return new UntypedResource(xml, rd.ResourceType, rd.Version);
}
return _serializers[rd].Deserialize(xml);
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/XmlValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/XmlValidator.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/XmlValidator.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -173,7 +173,7 @@
if (pc != null)
xsds.Add("PlatformCommon-1.0.0.xsd", pc); //NOXLATE
- if (res.ResourceType == ResourceTypes.LayerDefinition)
+ if (res.ResourceType == ResourceTypes.LayerDefinition.ToString())
{
string version = res.ResourceVersion.ToString();
if (version.StartsWith("1.1.0")) //NOXLATE
@@ -206,7 +206,7 @@
}
}
- if (res.ResourceType == ResourceTypes.WatermarkDefinition)
+ if (res.ResourceType == ResourceTypes.WatermarkDefinition.ToString())
{
string version = res.ResourceVersion.ToString();
if (version.StartsWith("2.3.0")) //NOXLATE
@@ -223,7 +223,7 @@
}
}
- if (res.ResourceType == ResourceTypes.MapDefinition)
+ if (res.ResourceType == ResourceTypes.MapDefinition.ToString())
{
string version = res.ResourceVersion.ToString();
if (version.StartsWith("2.3.0"))
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Commands/LocalGetResourceContents.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Commands/LocalGetResourceContents.cs 2014-06-03 08:06:01 UTC (rev 8182)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Commands/LocalGetResourceContents.cs 2014-06-03 11:21:59 UTC (rev 8183)
@@ -76,7 +76,7 @@
var resId = ids.GetItem(i);
using (var ms = new MemoryStream(Encoding.UTF8.GetBytes(result.GetItem(i))))
{
- ResourceTypes resType = ResourceIdentifier.GetResourceType(resId);
+ var resType = ResourceIdentifier.GetResourceTypeAsString(resId);
IResource r = ResourceTypeRegistry.Deserialize(resType, ms);
r.CurrentConnection = this.Parent;
More information about the mapguide-commits
mailing list