[mapguide-commits] r8738 - in trunk/Tools/Maestro: Maestro Maestro.AddIn.ExtendedObjectModels/Editor Maestro.AddIn.Rest/Model Maestro.AddIn.Rest/UI Maestro.AddIn.Scripting/Lang/Python Maestro.AddIn.Scripting/UI Maestro.AddInManager Maestro.Base/UI Maestro.Editors Maestro.Editors/Common Maestro.Editors/Common/Expression Maestro.Editors/Diagnostics Maestro.Editors/Diff Maestro.Editors/FeatureSource Maestro.Editors/FeatureSource/Extensions Maestro.Editors/FeatureSource/Providers/Odbc Maestro.Editors/FeatureSource/Providers/Odbc/OverrideEditor Maestro.Editors/Fusion Maestro.Editors/Fusion/MapEditors Maestro.Editors/Generic Maestro.Editors/Generic/XmlEditor Maestro.Editors/Generic/XmlEditor/AutoCompletion Maestro.Editors/LayerDefinition/Drawing Maestro.Editors/LayerDefinition/Vector Maestro.Editors/LayerDefinition/Vector/GridEditor Maestro.Editors/LayerDefinition/Vector/Scales Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstanceEditors Maestro.Editors/LayerDefinition/Vector/StyleEditors Mae stro.Editors/LayerDefinition/Vector/Thematics Maestro.Editors/LoadProcedure Maestro.Editors/MapDefinition Maestro.Editors/MapDefinition/Live Maestro.Editors/Preview Maestro.Editors/PrintLayout Maestro.Editors/SymbolDefinition Maestro.Editors/SymbolDefinition/GraphicsEditors Maestro.Editors/TileSetDefinition Maestro.Editors/TileSetDefinition/Providers Maestro.Editors/WatermarkDefinition Maestro.Editors/WebLayout Maestro.LiveMapEditor Maestro.Login Maestro.MapViewer Maestro.Packaging Maestro.Shared.UI MaestroFsPreview MgCooker OSGeo.FDO.Expressions OSGeo.MapGuide.MaestroAPI OSGeo.MapGuide.MaestroAPI/Mapping OSGeo.MapGuide.MaestroAPI.Http OSGeo.MapGuide.MaestroAPI.Http/Commands OSGeo.MapGuide.MaestroAPI.Local OSGeo.MapGuide.MaestroAPI.Native OSGeo.MapGuide.MaestroAPI.Native/Commands RtMapInspector SignMapGuideApi
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue Aug 11 08:11:47 PDT 2015
Author: jng
Date: 2015-08-11 08:11:47 -0700 (Tue, 11 Aug 2015)
New Revision: 8738
Modified:
trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Editor/EditorFactories.cs
trunk/Tools/Maestro/Maestro.AddIn.Rest/Model/RestSourceContext.cs
trunk/Tools/Maestro/Maestro.AddIn.Rest/UI/NewRepresentationDialog.cs
trunk/Tools/Maestro/Maestro.AddIn.Scripting/Lang/Python/PythonConsole.cs
trunk/Tools/Maestro/Maestro.AddIn.Scripting/Lang/Python/PythonConsoleCompletionDataProvider.cs
trunk/Tools/Maestro/Maestro.AddIn.Scripting/Lang/Python/PythonOutputStream.cs
trunk/Tools/Maestro/Maestro.AddIn.Scripting/UI/IronPythonRepl.cs
trunk/Tools/Maestro/Maestro.AddInManager/AddInControl.cs
trunk/Tools/Maestro/Maestro.Base/UI/DirtyStateConfirmationDialog.cs
trunk/Tools/Maestro/Maestro.Base/UI/ProfilingDialog.cs
trunk/Tools/Maestro/Maestro.Base/UI/RepositoryTreeModel.cs
trunk/Tools/Maestro/Maestro.Editors/Common/EditorWindow.cs
trunk/Tools/Maestro/Maestro.Editors/Common/Expression/ExpressionParseErrorDialog.cs
trunk/Tools/Maestro/Maestro.Editors/Common/Expression/FdoExpressionCompletionDataProvider.cs
trunk/Tools/Maestro/Maestro.Editors/Common/Expression/FdoExpressionValidator.cs
trunk/Tools/Maestro/Maestro.Editors/Common/Expression/MalformedExpressionDialog.cs
trunk/Tools/Maestro/Maestro.Editors/Common/MonoCompatibleExpressionEditor.cs
trunk/Tools/Maestro/Maestro.Editors/Common/RepointerDialog.cs
trunk/Tools/Maestro/Maestro.Editors/Common/RepositoryTreeModel.cs
trunk/Tools/Maestro/Maestro.Editors/Common/SymbolPicker.cs
trunk/Tools/Maestro/Maestro.Editors/Common/TextEditor.cs
trunk/Tools/Maestro/Maestro.Editors/Common/UnmanagedFileBrowser.cs
trunk/Tools/Maestro/Maestro.Editors/Diagnostics/FdoCacheViewer.cs
trunk/Tools/Maestro/Maestro.Editors/Diff/CompareResourceDialog.cs
trunk/Tools/Maestro/Maestro.Editors/Diff/XmlCompareUtil.cs
trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Extensions/CalculationSettings.cs
trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Extensions/ExtendedClassSettings.cs
trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Extensions/JoinSettings.cs
trunk/Tools/Maestro/Maestro.Editors/FeatureSource/FsEditorMap.cs
trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OdbcDriverMap.cs
trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OverrideEditor/TableConfigurationDialog.cs
trunk/Tools/Maestro/Maestro.Editors/Fusion/FlexibleLayoutEditorContext.cs
trunk/Tools/Maestro/Maestro.Editors/Fusion/MapCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/Fusion/MapEditors/CommercialMapEditor.cs
trunk/Tools/Maestro/Maestro.Editors/Fusion/MapEditors/MapGuideEditor.cs
trunk/Tools/Maestro/Maestro.Editors/Fusion/MenuCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/Fusion/NewWidgetDialog.cs
trunk/Tools/Maestro/Maestro.Editors/Fusion/WidgetReferenceCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/AutoCompletion/QualifiedNameCollection.cs
trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/AutoCompletion/XmlCompletionDataCollection.cs
trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/AutoCompletion/XmlCompletionDataProvider.cs
trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/AutoCompletion/XmlSchemaCompletionDataCollection.cs
trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/FindAndReplaceForm.cs
trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/XmlFormattingStrategy.cs
trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Drawing/DrawingLayerSettingsCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/GridEditor/RuleModel.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/GridEditor/VectorScaleRangeGrid.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/ILayerStylePreviewable.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ConditionList.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ItemStyle.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstanceEditors/ReferenceCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancePropertiesDialog.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/VectorScaleRangeCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/AreaFeatureStyleEditor.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/FontStyleEditor.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/PointFeatureStyleEditor.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/StyleImageCache.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ColorBrewer.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.cs
trunk/Tools/Maestro/Maestro.Editors/LoadProcedure/InputFilesCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/MapDefinition/FiniteScaleListCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/MapDefinition/GroupPropertiesCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LayerPropertiesCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/MapDefinition/Live/DragMessages.cs
trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapDefinitionEditorCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapLayersSectionCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapTreeModels.cs
trunk/Tools/Maestro/Maestro.Editors/Preview/LocalMapPreviewer.cs
trunk/Tools/Maestro/Maestro.Editors/Preview/MapPreviewDialog.cs
trunk/Tools/Maestro/Maestro.Editors/Preview/ResourcePreviewFactory.cs
trunk/Tools/Maestro/Maestro.Editors/PrintLayout/LogoDialog.cs
trunk/Tools/Maestro/Maestro.Editors/RepositoryHandle.cs
trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/AdvancedSettingsCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/GraphicsEditors/ImageDialog.cs
trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/GraphicsEditors/PathDialog.cs
trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/GraphicsEditors/TextDialog.cs
trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/SimpleSymbolDefinitionDialog.cs
trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/SimpleSymbolReferenceCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/SymbolParameterDialog.cs
trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/UsageContextsCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/TileSetDefinition/GroupPropertiesCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/TileSetDefinition/LayerStructureCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/TileSetDefinition/Providers/GenericProviderCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/TilePositionEditor.cs
trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkInstanceEditor.cs
trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/XYPositionEditor.cs
trunk/Tools/Maestro/Maestro.Editors/WebLayout/MenuModel.cs
trunk/Tools/Maestro/Maestro.LiveMapEditor/MapSettingsDialog.cs
trunk/Tools/Maestro/Maestro.Login/LoginDialog.cs
trunk/Tools/Maestro/Maestro.Login/PreferedSite.cs
trunk/Tools/Maestro/Maestro.Login/WaitCursor.cs
trunk/Tools/Maestro/Maestro.MapViewer/CoreTypes.cs
trunk/Tools/Maestro/Maestro.MapViewer/DefaultToolbar.cs
trunk/Tools/Maestro/Maestro.MapViewer/LegendPresenter.cs
trunk/Tools/Maestro/Maestro.Packaging/PackageBuilder.cs
trunk/Tools/Maestro/Maestro.Packaging/UploadPackageResult.cs
trunk/Tools/Maestro/Maestro.Shared.UI/ViewContentManagerBase.cs
trunk/Tools/Maestro/Maestro/Program.cs
trunk/Tools/Maestro/MaestroFsPreview/MainForm.cs
trunk/Tools/Maestro/MgCooker/Progress.cs
trunk/Tools/Maestro/MgCooker/SetupRun.cs
trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoBinaryExpression.cs
trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoBinaryLogicalOperator.cs
trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoComparisonCondition.cs
trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoDataValue.cs
trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoDistanceCondition.cs
trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoFunction.cs
trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoGeometryValue.cs
trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoIdentifier.cs
trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoInCondition.cs
trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoNullCondition.cs
trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoParameter.cs
trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoParseException.cs
trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoSpatialCondition.cs
trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoUnaryExpression.cs
trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoUnaryLogicalOperator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpCreateRuntimeMap.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpDescribeRuntimeMap.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpGetFdoCacheInfo.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpGetResourceContents.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpResourcePreviewUrlGenerator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/RequestBuilder.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/XmlReaderBase.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/XmlRecord.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalRuntimeMap.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Commands/FeatureCommandsImpl.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Commands/LocalGetResourceContents.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeCoordinateSystem.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeSqlReader.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/MgReadOnlyStream.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Utility.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapGroup.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapLayer.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs
trunk/Tools/Maestro/RtMapInspector/MainForm.cs
trunk/Tools/Maestro/SignMapGuideApi/Program.cs
Log:
#2565: Another RES-instigated cleanup mega-submission.
- More nameof() replacements for string literals
- More string interpolation replacements for string.Format() calls and raw string concatenation
- Make class fields read-only where suggested by the analyzer
- Method parameter renaming to match their overridden counterparts
- Make public constructors of abstract base classes protected
- Convert properties with private setters to get-only auto properties
- Collapse single-line methods/properties to expression-bodied members
Modified: trunk/Tools/Maestro/Maestro/Program.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/Program.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro/Program.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -185,7 +185,7 @@
private static void CurrentDomain_AssemblyLoad(object sender, AssemblyLoadEventArgs args)
{
- LoggingService.InfoFormatted("Loaded assembly: {0}", args.LoadedAssembly.GetName().Name); //NOXLATE
+ LoggingService.InfoFormatted($"Loaded assembly: {args.LoadedAssembly.GetName().Name}"); //NOXLATE
}
private static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
@@ -204,18 +204,12 @@
internal sealed class MaestroServiceManager : ServiceManager
{
- private static ILoggingService loggingService = new TextWriterLoggingService(BroadcastTextWriter.Instance);
- private static IMessageService messageService = new WinFormsMessageService(); //new TextWriterMessageService(Console.Out);
+ private static readonly ILoggingService loggingService = new TextWriterLoggingService(BroadcastTextWriter.Instance);
+ private static readonly IMessageService messageService = new WinFormsMessageService(); //new TextWriterMessageService(Console.Out);
- public override ILoggingService LoggingService
- {
- get { return loggingService; }
- }
+ public override ILoggingService LoggingService => loggingService;
- public override IMessageService MessageService
- {
- get { return messageService; }
- }
+ public override IMessageService MessageService => messageService;
public override object GetService(Type serviceType)
{
Modified: trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Editor/EditorFactories.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Editor/EditorFactories.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Editor/EditorFactories.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -21,290 +21,235 @@
#endregion Disclaimer / License
using Maestro.Base.Editor;
-using OSGeo.MapGuide.MaestroAPI.Resource;
using OSGeo.MapGuide.ObjectModels;
namespace Maestro.AddIn.ExtendedObjectModels.Editor
{
internal class WebLayout110EditorFactory : IEditorFactory
{
- public ResourceTypeDescriptor ResourceTypeAndVersion { get; private set; }
+ public ResourceTypeDescriptor ResourceTypeAndVersion { get; }
public WebLayout110EditorFactory()
{
this.ResourceTypeAndVersion = new ResourceTypeDescriptor(ResourceTypes.WebLayout.ToString(), "1.1.0"); //NOXLATE
}
- public IEditorViewContent Create()
- {
- return new WebLayoutEditor();
- }
+ public IEditorViewContent Create() => new WebLayoutEditor();
}
internal class WebLayout240EditorFactory : IEditorFactory
{
- public ResourceTypeDescriptor ResourceTypeAndVersion { get; private set; }
+ public ResourceTypeDescriptor ResourceTypeAndVersion { get; }
public WebLayout240EditorFactory()
{
this.ResourceTypeAndVersion = new ResourceTypeDescriptor(ResourceTypes.WebLayout.ToString(), "2.4.0"); //NOXLATE
}
- public IEditorViewContent Create()
- {
- return new WebLayoutEditor();
- }
+ public IEditorViewContent Create() => new WebLayoutEditor();
}
internal class WebLayout260EditorFactory : IEditorFactory
{
- public ResourceTypeDescriptor ResourceTypeAndVersion { get; private set; }
+ public ResourceTypeDescriptor ResourceTypeAndVersion { get; }
public WebLayout260EditorFactory()
{
this.ResourceTypeAndVersion = new ResourceTypeDescriptor(ResourceTypes.WebLayout.ToString(), "2.6.0"); //NOXLATE
}
- public IEditorViewContent Create()
- {
- return new WebLayoutEditor();
- }
+ public IEditorViewContent Create() => new WebLayoutEditor();
}
internal class LayerDefinition110EditorFactory : IEditorFactory
{
- public ResourceTypeDescriptor ResourceTypeAndVersion { get; private set; }
+ public ResourceTypeDescriptor ResourceTypeAndVersion { get; }
public LayerDefinition110EditorFactory()
{
this.ResourceTypeAndVersion = new ResourceTypeDescriptor(ResourceTypes.LayerDefinition.ToString(), "1.1.0"); //NOXLATE
}
- public IEditorViewContent Create()
- {
- //Use the same 1.0.0 editor for now
- return new LayerDefinitionEditor();
- }
+ //Use the same 1.0.0 editor for now
+ public IEditorViewContent Create() => new LayerDefinitionEditor();
}
internal class LayerDefinition120EditorFactory : IEditorFactory
{
- public ResourceTypeDescriptor ResourceTypeAndVersion { get; private set; }
+ public ResourceTypeDescriptor ResourceTypeAndVersion { get; }
public LayerDefinition120EditorFactory()
{
this.ResourceTypeAndVersion = new ResourceTypeDescriptor(ResourceTypes.LayerDefinition.ToString(), "1.2.0"); //NOXLATE
}
- public IEditorViewContent Create()
- {
- //Use the same 1.0.0 editor for now
- return new LayerDefinitionEditor();
- }
+ //Use the same 1.0.0 editor for now
+ public IEditorViewContent Create() => new LayerDefinitionEditor();
}
internal class LayerDefinition130EditorFactory : IEditorFactory
{
- public ResourceTypeDescriptor ResourceTypeAndVersion { get; private set; }
+ public ResourceTypeDescriptor ResourceTypeAndVersion { get; }
public LayerDefinition130EditorFactory()
{
this.ResourceTypeAndVersion = new ResourceTypeDescriptor(ResourceTypes.LayerDefinition.ToString(), "1.3.0"); //NOXLATE
}
- public IEditorViewContent Create()
- {
- //Use the same 1.0.0 editor for now
- return new LayerDefinitionEditor();
- }
+ //Use the same 1.0.0 editor for now
+ public IEditorViewContent Create() => new LayerDefinitionEditor();
}
internal class LayerDefinition230EditorFactory : IEditorFactory
{
- public ResourceTypeDescriptor ResourceTypeAndVersion { get; private set; }
+ public ResourceTypeDescriptor ResourceTypeAndVersion { get; }
public LayerDefinition230EditorFactory()
{
this.ResourceTypeAndVersion = new ResourceTypeDescriptor(ResourceTypes.LayerDefinition.ToString(), "2.3.0"); //NOXLATE
}
- public IEditorViewContent Create()
- {
- //Use the same 1.0.0 editor for now
- return new LayerDefinitionEditor();
- }
+ //Use the same 1.0.0 editor for now
+ public IEditorViewContent Create() => new LayerDefinitionEditor();
}
internal class LayerDefinition240EditorFactory : IEditorFactory
{
- public ResourceTypeDescriptor ResourceTypeAndVersion { get; private set; }
+ public ResourceTypeDescriptor ResourceTypeAndVersion { get; }
public LayerDefinition240EditorFactory()
{
this.ResourceTypeAndVersion = new ResourceTypeDescriptor(ResourceTypes.LayerDefinition.ToString(), "2.4.0"); //NOXLATE
}
- public IEditorViewContent Create()
- {
- //Use the same 1.0.0 editor for now
- return new LayerDefinitionEditor();
- }
+ //Use the same 1.0.0 editor for now
+ public IEditorViewContent Create() => new LayerDefinitionEditor();
}
internal class MapDefinition230EditorFactory : IEditorFactory
{
- public ResourceTypeDescriptor ResourceTypeAndVersion { get; private set; }
+ public ResourceTypeDescriptor ResourceTypeAndVersion { get; }
public MapDefinition230EditorFactory()
{
this.ResourceTypeAndVersion = new ResourceTypeDescriptor(ResourceTypes.MapDefinition.ToString(), "2.3.0"); //NOXLATE
}
- public IEditorViewContent Create()
- {
- //Use the same 1.0.0 editor for now
- return new MapDefinitionEditor();
- }
+ //Use the same 1.0.0 editor for now
+ public IEditorViewContent Create() => new MapDefinitionEditor();
}
internal class MapDefinition240EditorFactory : IEditorFactory
{
- public ResourceTypeDescriptor ResourceTypeAndVersion { get; private set; }
+ public ResourceTypeDescriptor ResourceTypeAndVersion { get; }
public MapDefinition240EditorFactory()
{
this.ResourceTypeAndVersion = new ResourceTypeDescriptor(ResourceTypes.MapDefinition.ToString(), "2.4.0"); //NOXLATE
}
- public IEditorViewContent Create()
- {
- //Use the same 1.0.0 editor for now
- return new MapDefinitionEditor();
- }
+ //Use the same 1.0.0 editor for now
+ public IEditorViewContent Create() => new MapDefinitionEditor();
}
internal class MapDefinition300EditorFactory : IEditorFactory
{
- public ResourceTypeDescriptor ResourceTypeAndVersion { get; private set; }
+ public ResourceTypeDescriptor ResourceTypeAndVersion { get; }
public MapDefinition300EditorFactory()
{
this.ResourceTypeAndVersion = new ResourceTypeDescriptor(ResourceTypes.MapDefinition.ToString(), "3.0.0"); //NOXLATE
}
- public IEditorViewContent Create()
- {
- //Use the same 1.0.0 editor for now
- return new MapDefinitionEditor();
- }
+ //Use the same 1.0.0 editor for now
+ public IEditorViewContent Create() => new MapDefinitionEditor();
}
internal class WatermarkDefinition230EditorFactory : IEditorFactory
{
- public ResourceTypeDescriptor ResourceTypeAndVersion { get; private set; }
+ public ResourceTypeDescriptor ResourceTypeAndVersion { get; }
public WatermarkDefinition230EditorFactory()
{
this.ResourceTypeAndVersion = new ResourceTypeDescriptor(ResourceTypes.WatermarkDefinition.ToString(), "2.3.0"); //NOXLATE
}
- public IEditorViewContent Create()
- {
- //Use the same 1.0.0 editor for now
- return new WatermarkDefinitionEditor();
- }
+ //Use the same 1.0.0 editor for now
+ public IEditorViewContent Create() => new WatermarkDefinitionEditor();
}
internal class WatermarkDefinition240EditorFactory : IEditorFactory
{
- public ResourceTypeDescriptor ResourceTypeAndVersion { get; private set; }
+ public ResourceTypeDescriptor ResourceTypeAndVersion { get; }
public WatermarkDefinition240EditorFactory()
{
this.ResourceTypeAndVersion = new ResourceTypeDescriptor(ResourceTypes.WatermarkDefinition.ToString(), "2.4.0"); //NOXLATE
}
- public IEditorViewContent Create()
- {
- //Use the same 1.0.0 editor for now
- return new WatermarkDefinitionEditor();
- }
+ //Use the same 1.0.0 editor for now
+ public IEditorViewContent Create() => new WatermarkDefinitionEditor();
}
internal class LoadProcedure110EditorFactory : IEditorFactory
{
- public ResourceTypeDescriptor ResourceTypeAndVersion { get; private set; }
+ public ResourceTypeDescriptor ResourceTypeAndVersion { get; }
public LoadProcedure110EditorFactory()
{
this.ResourceTypeAndVersion = new ResourceTypeDescriptor(ResourceTypes.LoadProcedure.ToString(), "1.1.0"); //NOXLATE
}
- public IEditorViewContent Create()
- {
- //We can use the same editor, nothing structurally changed
- return new LoadProcedureEditor();
- }
+ //We can use the same editor, nothing structurally changed
+ public IEditorViewContent Create() => new LoadProcedureEditor();
}
internal class LoadProcedure220EditorFactory : IEditorFactory
{
- public ResourceTypeDescriptor ResourceTypeAndVersion { get; private set; }
+ public ResourceTypeDescriptor ResourceTypeAndVersion { get; }
public LoadProcedure220EditorFactory()
{
this.ResourceTypeAndVersion = new ResourceTypeDescriptor(ResourceTypes.LoadProcedure.ToString(), "2.2.0"); //NOXLATE
}
- public IEditorViewContent Create()
- {
- //We can use the same editor, nothing structurally changed
- return new LoadProcedureEditor();
- }
+ //We can use the same editor, nothing structurally changed
+ public IEditorViewContent Create() => new LoadProcedureEditor();
}
internal class SymbolDefinition110EditorFactory : IEditorFactory
{
- public ResourceTypeDescriptor ResourceTypeAndVersion { get; private set; }
+ public ResourceTypeDescriptor ResourceTypeAndVersion { get; }
public SymbolDefinition110EditorFactory()
{
this.ResourceTypeAndVersion = new ResourceTypeDescriptor(ResourceTypes.SymbolDefinition.ToString(), "1.1.0"); //NOXLATE
}
- public IEditorViewContent Create()
- {
- return new SymbolDefinitionEditor();
- }
+ public IEditorViewContent Create() => new SymbolDefinitionEditor();
}
internal class SymbolDefinition240EditorFactory : IEditorFactory
{
- public ResourceTypeDescriptor ResourceTypeAndVersion { get; private set; }
+ public ResourceTypeDescriptor ResourceTypeAndVersion { get; }
public SymbolDefinition240EditorFactory()
{
this.ResourceTypeAndVersion = new ResourceTypeDescriptor(ResourceTypes.SymbolDefinition.ToString(), "2.4.0"); //NOXLATE
}
- public IEditorViewContent Create()
- {
- return new SymbolDefinitionEditor();
- }
+ public IEditorViewContent Create() => new SymbolDefinitionEditor();
}
internal class TileSetDefinition300EditorFactory : IEditorFactory
{
- public ResourceTypeDescriptor ResourceTypeAndVersion { get; private set; }
+ public ResourceTypeDescriptor ResourceTypeAndVersion { get; }
public TileSetDefinition300EditorFactory()
{
this.ResourceTypeAndVersion = new ResourceTypeDescriptor(ResourceTypes.TileSetDefinition.ToString(), "3.0.0"); //NOXLATE
}
- public IEditorViewContent Create()
- {
- return new TileSetEditor();
- }
+ public IEditorViewContent Create() => new TileSetEditor();
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.AddIn.Rest/Model/RestSourceContext.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Rest/Model/RestSourceContext.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.AddIn.Rest/Model/RestSourceContext.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -1,23 +1,23 @@
-#region Disclaimer / License
-
-// Copyright (C) 2015, Jackie Ng
-// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
+#region Disclaimer / License
+
+// Copyright (C) 2015, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
#endregion Disclaimer / License
using Maestro.Editors.Common;
using OSGeo.MapGuide.MaestroAPI;
@@ -43,7 +43,7 @@
public class RestSourceContext
{
private RestSource _source;
- private IServerConnection _conn;
+ private readonly IServerConnection _conn;
private ClassDefinition _cls;
public RestSourceContext(IServerConnection conn, RestSource source)
Modified: trunk/Tools/Maestro/Maestro.AddIn.Rest/UI/NewRepresentationDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Rest/UI/NewRepresentationDialog.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.AddIn.Rest/UI/NewRepresentationDialog.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -1,23 +1,23 @@
-#region Disclaimer / License
-
-// Copyright (C) 2015, Jackie Ng
-// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
+#region Disclaimer / License
+
+// Copyright (C) 2015, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
#endregion Disclaimer / License
using Maestro.AddIn.Rest.Model;
using Maestro.AddIn.Rest.UI.Representation;
@@ -41,9 +41,9 @@
InitializeComponent();
}
- private string _rep;
- private IRepresentationCtrl _ctrl;
- private dynamic _config;
+ private readonly string _rep;
+ private readonly IRepresentationCtrl _ctrl;
+ private readonly dynamic _config;
private RestSourceContext _context;
public NewRepresentationDialog(string rep, dynamic config, RestSourceContext context)
Modified: trunk/Tools/Maestro/Maestro.AddIn.Scripting/Lang/Python/PythonConsole.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Scripting/Lang/Python/PythonConsole.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.AddIn.Scripting/Lang/Python/PythonConsole.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -49,7 +49,7 @@
{
internal class PythonConsole : IConsole, IDisposable, IMemberProvider
{
- private ITextEditor textEditor;
+ private readonly ITextEditor textEditor;
private int lineReceivedEventIndex = 0; // The index into the waitHandles array where the lineReceivedEvent is stored.
private ManualResetEvent inputLineReceivedEvent = new ManualResetEvent(false);
private ManualResetEvent lineReceivedEvent = new ManualResetEvent(false);
Modified: trunk/Tools/Maestro/Maestro.AddIn.Scripting/Lang/Python/PythonConsoleCompletionDataProvider.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Scripting/Lang/Python/PythonConsoleCompletionDataProvider.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.AddIn.Scripting/Lang/Python/PythonConsoleCompletionDataProvider.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -97,7 +97,7 @@
//trigger auto-complete most of the time
int startIndex = text.LastIndexOfAny(new char[] { ' ', '+', '/', '*', '-', '%', '=', '>', '<', '&', '|', '^', '~', '(', ')' });
string res = text.Substring(startIndex + 1);
- Debug.WriteLine("Evaluating python auto-complete options for: " + res);
+ Debug.WriteLine($"Evaluating python auto-complete options for: {res}"); //NOXLATE
return res;
}
@@ -110,23 +110,11 @@
return textArea.Document.GetText(lineSegment);
}
- public System.Windows.Forms.ImageList ImageList
- {
- get;
- private set;
- }
+ public System.Windows.Forms.ImageList ImageList { get; }
- public string PreSelection
- {
- get;
- private set;
- }
+ public string PreSelection { get; }
- public int DefaultIndex
- {
- get;
- private set;
- }
+ public int DefaultIndex { get; }
public bool InsertSpace
{
Modified: trunk/Tools/Maestro/Maestro.AddIn.Scripting/Lang/Python/PythonOutputStream.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Scripting/Lang/Python/PythonOutputStream.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.AddIn.Scripting/Lang/Python/PythonOutputStream.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -44,7 +44,7 @@
internal class PythonOutputStream : Stream
{
private PythonConsole _console;
- private ITextEditor textEditor;
+ private readonly ITextEditor textEditor;
public PythonOutputStream(PythonConsole console, ITextEditor textEditor)
{
Modified: trunk/Tools/Maestro/Maestro.AddIn.Scripting/UI/IronPythonRepl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Scripting/UI/IronPythonRepl.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.AddIn.Scripting/UI/IronPythonRepl.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -12,7 +12,7 @@
internal partial class IronPythonRepl : SingletonViewContent
{
private ITextEditor textEditor;
- private PythonConsoleHost host;
+ private readonly PythonConsoleHost host;
public IronPythonRepl()
{
Modified: trunk/Tools/Maestro/Maestro.AddInManager/AddInControl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddInManager/AddInControl.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.AddInManager/AddInControl.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -33,16 +33,10 @@
[ToolboxItem(false)]
public class AddInControl : Control
{
- private AddIn addIn;
+ private readonly AddIn addIn;
private bool isExternal;
- public AddIn AddIn
- {
- get
- {
- return addIn;
- }
- }
+ public AddIn AddIn => addIn;
public AddInControl(AddIn addIn)
{
Modified: trunk/Tools/Maestro/Maestro.Base/UI/DirtyStateConfirmationDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/UI/DirtyStateConfirmationDialog.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Base/UI/DirtyStateConfirmationDialog.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -37,7 +37,7 @@
InitializeComponent();
}
- private IEditorService _edSvc;
+ private readonly IEditorService _edSvc;
public DirtyStateConfirmationDialog(IEditorService edSvc)
: this()
Modified: trunk/Tools/Maestro/Maestro.Base/UI/ProfilingDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/UI/ProfilingDialog.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Base/UI/ProfilingDialog.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -375,7 +375,7 @@
{
private string m_text;
private bool m_isDisposed;
- private DateTime m_begin;
+ private readonly DateTime m_begin;
private BackgroundWorker m_worker;
public Timer(string text, BackgroundWorker worker)
Modified: trunk/Tools/Maestro/Maestro.Base/UI/RepositoryTreeModel.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/UI/RepositoryTreeModel.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Base/UI/RepositoryTreeModel.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -531,7 +531,7 @@
item.ClipboardState = _clip.GetClipboardState(item.ResourceId);
}
- private Dictionary<string, RepositoryItem> _rootNodes = new Dictionary<string, RepositoryItem>();
+ private readonly Dictionary<string, RepositoryItem> _rootNodes = new Dictionary<string, RepositoryItem>();
/// <summary>
/// Gets the child nodes in the given tree path
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/EditorWindow.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/EditorWindow.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/EditorWindow.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -99,12 +99,12 @@
}
private IServerConnection _conn;
- private DefaultResourceEditorService _svc;
+ private readonly DefaultResourceEditorService _svc;
//TODO: The reason we are using a generic XML editor is because the mechanism
//for resolving specialized editor types is currently part of the Maestro AddIn
//infrastructure and not available in this standalone library
- private Generic.XmlEditorCtrl _ed;
+ private readonly Generic.XmlEditorCtrl _ed;
/// <summary>
/// Initializes a new instance of the EditorWindow class
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/Expression/ExpressionParseErrorDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/Expression/ExpressionParseErrorDialog.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/Expression/ExpressionParseErrorDialog.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -1,23 +1,23 @@
-#region Disclaimer / License
-
-// Copyright (C) 2015, Jackie Ng
-// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
+#region Disclaimer / License
+
+// Copyright (C) 2015, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
#endregion Disclaimer / License
using OSGeo.FDO.Expressions;
using System;
@@ -39,8 +39,8 @@
InitializeComponent();
}
- private FdoExpressionValidationException _ex;
- private IExpressionErrorSource _source;
+ private readonly FdoExpressionValidationException _ex;
+ private readonly IExpressionErrorSource _source;
public ExpressionParseErrorDialog(FdoExpressionValidationException ex, IExpressionErrorSource source)
: this()
@@ -50,10 +50,7 @@
txtErrorDetails.Text = _ex.Message;
}
- private void btnClose_Click(object sender, EventArgs e)
- {
- this.DialogResult = System.Windows.Forms.DialogResult.OK;
- }
+ private void btnClose_Click(object sender, EventArgs e) => this.DialogResult = System.Windows.Forms.DialogResult.OK;
private void btnGotoError_Click(object sender, EventArgs e)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/Expression/FdoExpressionCompletionDataProvider.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/Expression/FdoExpressionCompletionDataProvider.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/Expression/FdoExpressionCompletionDataProvider.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -60,23 +60,11 @@
this.ImageList.Images.Add(Properties.Resources.funnel);
}
- public System.Windows.Forms.ImageList ImageList
- {
- get;
- private set;
- }
+ public System.Windows.Forms.ImageList ImageList { get; }
- public string PreSelection
- {
- get;
- private set;
- }
+ public string PreSelection { get; }
- public int DefaultIndex
- {
- get;
- private set;
- }
+ public int DefaultIndex { get; }
public bool InsertSpace
{
@@ -137,21 +125,19 @@
}
public ICompletionData[] GenerateCompletionData(string fileName, TextArea textArea, char charTyped)
- {
- return GenerateCompletionData((GetLineText(textArea) + charTyped).Trim());
- }
+ => GenerateCompletionData((GetLineText(textArea) + charTyped).Trim());
private class FdoCompletionData : DefaultCompletionData
{
- private string _insertText;
- private string _appendText;
+ private readonly string _insertText;
+ private readonly string _appendText;
private int _highlightLength = 0;
- public int HighlightLength { get { return _highlightLength; } }
+ public int HighlightLength => _highlightLength;
- public string InsertText { get { return _insertText; } }
+ public string InsertText => _insertText;
- public string AppendText { get { return _appendText; } }
+ public string AppendText => _appendText;
public FdoCompletionData(string prefix, string text, string description, int imageIndex)
: base(text, description, imageIndex)
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/Expression/FdoExpressionValidator.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/Expression/FdoExpressionValidator.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/Expression/FdoExpressionValidator.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -43,7 +43,7 @@
/// <summary>
/// Gets the contextual token that is the cause of the validation error
/// </summary>
- public string Token { get; private set; }
+ public string Token { get; }
public FdoExpressionValidationException(string message, string token)
: this(message)
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/Expression/MalformedExpressionDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/Expression/MalformedExpressionDialog.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/Expression/MalformedExpressionDialog.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -1,23 +1,23 @@
-#region Disclaimer / License
-
-// Copyright (C) 2015, Jackie Ng
-// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
+#region Disclaimer / License
+
+// Copyright (C) 2015, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
#endregion Disclaimer / License
using OSGeo.FDO.Expressions;
using System;
@@ -46,8 +46,8 @@
InitializeComponent();
}
- private FdoMalformedExpressionException _ex;
- private IExpressionErrorSource _source;
+ private readonly FdoMalformedExpressionException _ex;
+ private readonly IExpressionErrorSource _source;
public MalformedExpressionDialog(FdoMalformedExpressionException ex, IExpressionErrorSource source)
: this()
@@ -57,10 +57,7 @@
txtErrorDetails.Text = _ex.Messages[0].Message;
}
- private void btnClose_Click(object sender, EventArgs e)
- {
- this.DialogResult = System.Windows.Forms.DialogResult.OK;
- }
+ private void btnClose_Click(object sender, EventArgs e) => this.DialogResult = System.Windows.Forms.DialogResult.OK;
private void btnGotoError_Click(object sender, EventArgs e)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/MonoCompatibleExpressionEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/MonoCompatibleExpressionEditor.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/MonoCompatibleExpressionEditor.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -411,7 +411,7 @@
private IFdoFunctionDefintion _func;
private IFdoFunctionDefintionSignature _sig;
- private string _insertExpr;
+ private readonly string _insertExpr;
private FunctionItem(IFdoFunctionDefintion fd, IFdoFunctionDefintionSignature sig)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/RepointerDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/RepointerDialog.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/RepointerDialog.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -44,7 +44,7 @@
InitializeComponent();
}
- private IServerConnection _conn;
+ private readonly IServerConnection _conn;
/// <summary>
/// Constructor
@@ -66,33 +66,23 @@
/// <summary>
/// Returns a list of resource ids which are the dependent resources of the specified resource
/// </summary>
- public ICollection<string> Dependents { get { return (ICollection<string>)lstAffectedResources.DataSource; } }
+ public ICollection<string> Dependents => (ICollection<string>)lstAffectedResources.DataSource;
/// <summary>
/// Gets the specified resource id
/// </summary>
- public string Source { get { return txtSource.Text; } }
+ public string Source => txtSource.Text;
/// <summary>
/// Gets the target resource id we want to re-point
/// </summary>
- public string Target { get { return txtTarget.Text; } }
+ public string Target => txtTarget.Text;
- internal string ResourceType
- {
- get;
- private set;
- }
+ internal string ResourceType { get; }
- private void btnCancel_Click(object sender, EventArgs e)
- {
- this.DialogResult = DialogResult.Cancel;
- }
+ private void btnCancel_Click(object sender, EventArgs e) => this.DialogResult = DialogResult.Cancel;
- private void btnOK_Click(object sender, EventArgs e)
- {
- this.DialogResult = DialogResult.OK;
- }
+ private void btnOK_Click(object sender, EventArgs e) => this.DialogResult = DialogResult.OK;
private void btnBrowse_Click(object sender, EventArgs e)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/RepositoryTreeModel.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/RepositoryTreeModel.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/RepositoryTreeModel.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -36,7 +36,7 @@
internal class RepositoryModelItem
{
- private IRepositoryItem _item;
+ private readonly IRepositoryItem _item;
public RepositoryModelItem(IRepositoryItem item)
{
@@ -54,25 +54,19 @@
}
}
- public int ImageIndex { get; private set; }
+ public int ImageIndex { get; }
- public string Name { get { return _item.Name; } }
+ public string Name => _item.Name;
- public string ResourceId { get { return _item.ResourceId; } }
+ public string ResourceId => _item.ResourceId;
- public bool HasChildren { get { return _item.HasChildren; } }
+ public bool HasChildren => _item.HasChildren;
- public bool IsFolder
- {
- get { return _item.IsFolder; }
- }
+ public bool IsFolder =>_item.IsFolder;
- public bool IsRoot
- {
- get { return this.ResourceId == StringConstants.RootIdentifier; }
- }
+ public bool IsRoot => this.ResourceId == StringConstants.RootIdentifier;
- public IRepositoryItem Instance { get { return _item; } }
+ public IRepositoryItem Instance => _item;
}
internal class RepositoryFolderTreeModel
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/SymbolPicker.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/SymbolPicker.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/SymbolPicker.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -43,7 +43,7 @@
InitializeComponent();
}
- private IServerConnection _conn;
+ private readonly IServerConnection _conn;
private Image _symbolImage;
/// <summary>
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/TextEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/TextEditor.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/TextEditor.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -78,20 +78,11 @@
remove { textArea.DoProcessDialogKey -= value; }
}
- public Color CustomLineColour
- {
- get { return customLineColour; }
- }
+ public Color CustomLineColour => customLineColour;
- public void Write(string text)
- {
- Write(text, Color.Empty, default(Color));
- }
+ public void Write(string text) => Write(text, Color.Empty, default(Color));
- public void Write(string text, Color backgroundColour)
- {
- Write(text, backgroundColour, default(Color));
- }
+ public void Write(string text, Color backgroundColour) => Write(text, backgroundColour, default(Color));
public void Write(string text, Color backgroundColour, Color foregroundColor)
{
@@ -145,18 +136,12 @@
/// <summary>
/// Gets the current cursor line.
/// </summary>
- public int Line
- {
- get { return textArea.Caret.Line; }
- }
+ public int Line => textArea.Caret.Line;
/// <summary>
/// Gets the total number of lines in the text editor.
/// </summary>
- public int TotalLines
- {
- get { return textEditorControl.Document.TotalNumberOfLines; }
- }
+ public int TotalLines => textEditorControl.Document.TotalNumberOfLines;
/// <summary>
/// Gets the text for the specified line.
@@ -202,10 +187,7 @@
doc.UndoStack.ClearAll();
}
- public virtual void ShowCompletionWindow(ICompletionDataProvider completionDataProvider)
- {
- ShowCompletionWindow(completionDataProvider, ' ');
- }
+ public virtual void ShowCompletionWindow(ICompletionDataProvider completionDataProvider) => ShowCompletionWindow(completionDataProvider, ' ');
public abstract void ShowCompletionWindow(ICompletionDataProvider completionDataProvider, char firstChar);
@@ -217,10 +199,7 @@
/// <summary>
/// Gets the range of the currently selected text.
/// </summary>
- private ColumnRange GetSelectionRange()
- {
- return textArea.SelectionManager.GetSelectionAtLine(textArea.Caret.Line);
- }
+ private ColumnRange GetSelectionRange() => textArea.SelectionManager.GetSelectionAtLine(textArea.Caret.Line);
private void SetIndentStyle(IndentStyle style)
{
@@ -235,10 +214,7 @@
}
}
- public virtual bool ProcessKeyPress(Keys keyData)
- {
- return false;
- }
+ public virtual bool ProcessKeyPress(Keys keyData) => false;
public virtual void SetParent(Control frm)
{
@@ -269,7 +245,7 @@
/// </summary>
internal class MonoCompatibleTextEditor : TextEditorBase
{
- private AutoCompletionListBox _autoBox;
+ private readonly AutoCompletionListBox _autoBox;
private ToolTip _autoCompleteTooltip;
internal MonoCompatibleTextEditor(TextEditorControl textEditor)
@@ -281,16 +257,13 @@
private Control _parent;
- public override void SetParent(Control ctrl)
+ public override void SetParent(Control frm)
{
- _parent = ctrl;
+ _parent = frm;
_parent.Controls.Add(_autoBox);
}
- public override bool IsCompletionWindowDisplayed
- {
- get { return _autoBox.IsShown; }
- }
+ public override bool IsCompletionWindowDisplayed => _autoBox.IsShown;
public override void ShowCompletionWindow(ICompletionDataProvider completionDataProvider, char firstChar)
{
@@ -328,10 +301,7 @@
return pt;
}
- private static bool IsAlphanumeric(Keys key)
- {
- return (key >= Keys.D0 && key <= Keys.Z);
- }
+ private static bool IsAlphanumeric(Keys key) => key >= Keys.D0 && key <= Keys.Z;
public override bool ProcessKeyPress(Keys keyData)
{
@@ -381,14 +351,11 @@
: base(textEditor)
{ }
- public override bool IsCompletionWindowDisplayed
- {
- get { return completionWindow != null; }
- }
+ public override bool IsCompletionWindowDisplayed => completionWindow != null;
- public override void ShowCompletionWindow(ICompletionDataProvider completionDataProvider, char ch)
+ public override void ShowCompletionWindow(ICompletionDataProvider completionDataProvider, char firstChar)
{
- completionWindow = CodeCompletionWindow.ShowCompletionWindow(textEditorControl.ParentForm, textEditorControl, String.Empty, completionDataProvider, ch);
+ completionWindow = CodeCompletionWindow.ShowCompletionWindow(textEditorControl.ParentForm, textEditorControl, String.Empty, completionDataProvider, firstChar);
if (completionWindow != null)
{
completionWindow.Width = 250;
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/UnmanagedFileBrowser.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/UnmanagedFileBrowser.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/UnmanagedFileBrowser.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -38,12 +38,12 @@
{
private abstract class ModelBase<T>
{
- public ModelBase(T item)
+ protected ModelBase(T item)
{
this.Tag = item;
}
- public T Tag { get; private set; }
+ public T Tag { get; }
}
private class FolderModel : ModelBase<UnmanagedDataListUnmanagedDataFolder>
@@ -55,11 +55,11 @@
this.HasChildren = (folder.NumberOfFolders > 0);
}
- public string Name { get; private set; }
+ public string Name { get; }
- public bool HasChildren { get; private set; }
+ public bool HasChildren { get; }
- public Image Icon { get { return Properties.Resources.folder_horizontal; } }
+ public Image Icon => Properties.Resources.folder_horizontal;
}
private class FolderTreeModel : ITreeModel
Modified: trunk/Tools/Maestro/Maestro.Editors/Diagnostics/FdoCacheViewer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Diagnostics/FdoCacheViewer.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Diagnostics/FdoCacheViewer.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -33,7 +33,7 @@
/// </summary>
public partial class FdoCacheViewer : Form
{
- private IGetFdoCacheInfo _cmd;
+ private readonly IGetFdoCacheInfo _cmd;
/// <summary>
/// Constructor
@@ -55,19 +55,10 @@
}
}
- private void btnClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
+ private void btnClose_Click(object sender, EventArgs e) => this.Close();
- private void chkAutoRefresh_CheckedChanged(object sender, EventArgs e)
- {
- tmRefresh.Enabled = chkAutoRefresh.Checked;
- }
+ private void chkAutoRefresh_CheckedChanged(object sender, EventArgs e) => tmRefresh.Enabled = chkAutoRefresh.Checked;
- private void tmRefresh_Tick(object sender, EventArgs e)
- {
- txtXml.Text = ToXml(_cmd.Execute());
- }
+ private void tmRefresh_Tick(object sender, EventArgs e) => txtXml.Text = ToXml(_cmd.Execute());
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.Editors/Diff/CompareResourceDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Diff/CompareResourceDialog.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Diff/CompareResourceDialog.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -40,7 +40,7 @@
InitializeComponent();
}
- private IServerConnection _conn;
+ private readonly IServerConnection _conn;
/// <summary>
/// Creates a new instance of CompareResourceDialog
@@ -70,10 +70,7 @@
set { txtTarget.Text = value; }
}
- private void btnCancel_Click(object sender, EventArgs e)
- {
- this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- }
+ private void btnCancel_Click(object sender, EventArgs e) => this.DialogResult = DialogResult.Cancel;
private void btnCompare_Click(object sender, EventArgs e)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/Diff/XmlCompareUtil.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Diff/XmlCompareUtil.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Diff/XmlCompareUtil.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -44,12 +44,12 @@
/// <summary>
/// Gets the difference list for the source
/// </summary>
- public TextFileDiffList Source { get; private set; }
+ public TextFileDiffList Source { get; }
/// <summary>
/// Gets the difference list for the target
/// </summary>
- public TextFileDiffList Target { get; private set; }
+ public TextFileDiffList Target { get; }
}
/// <summary>
Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Extensions/CalculationSettings.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Extensions/CalculationSettings.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Extensions/CalculationSettings.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -36,9 +36,9 @@
InitializeComponent();
}
- private IEditorService _edSvc;
- private ClassDefinition _cls;
- private IFeatureSource _parent;
+ private readonly IEditorService _edSvc;
+ private readonly ClassDefinition _cls;
+ private readonly IFeatureSource _parent;
public CalculationSettings(IEditorService edSvc, ClassDefinition cls, IFeatureSource parent, ICalculatedProperty calc)
: this()
Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Extensions/ExtendedClassSettings.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Extensions/ExtendedClassSettings.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Extensions/ExtendedClassSettings.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -24,6 +24,7 @@
using OSGeo.MapGuide.MaestroAPI;
using OSGeo.MapGuide.ObjectModels.FeatureSource;
using System;
+using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
@@ -38,8 +39,8 @@
InitializeComponent();
}
- private IFeatureSourceExtension _ext;
- private IFeatureSource _fs;
+ private readonly IFeatureSourceExtension _ext;
+ private readonly IFeatureSource _fs;
public ExtendedClassSettings(IFeatureSource fs, IEnumerable<string> qualifiedClassNames, IFeatureSourceExtension ext)
: this()
@@ -59,36 +60,20 @@
private void OnExtensionPropertyChanged(object sender, PropertyChangedEventArgs e) => OnResourceChanged();
- public void Bind(IEditorService service)
- {
- service.RegisterCustomNotifier(this);
- }
+ public void Bind(IEditorService service) => service.RegisterCustomNotifier(this);
private void OnResourceChanged()
{
- var handler = this.ResourceChanged;
- if (handler != null)
- handler(this, EventArgs.Empty);
+ this.ResourceChanged?.Invoke(this, EventArgs.Empty);
}
public event EventHandler ResourceChanged;
-
- private int GetExtensionCount(string name)
- {
- int count = 0;
- foreach (var ext in _fs.Extension)
- {
- if (ext.Name == name)
- count++;
- }
- return count;
- }
-
+
private void txtExtendedName_TextChanged(object sender, EventArgs e)
{
//Before we apply, check if the new name matches any existing feature classes
string newName = txtExtendedName.Text;
- if (GetExtensionCount(newName) > 0)
+ if (_fs.Extension.Count(ext => ext.Name == newName) > 0)
{
errorProvider.SetError(txtExtendedName, string.Format(Strings.ExtendedFeatureClassAlreadyExists, newName));
}
Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Extensions/JoinSettings.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Extensions/JoinSettings.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Extensions/JoinSettings.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -42,14 +42,14 @@
grdJoinKeys.DataSource = _propertyJoins;
}
- private IAttributeRelation _rel;
+ private readonly IAttributeRelation _rel;
private string _primaryFeatureSource;
private string _primaryClass;
private string[] _secondaryClasses;
private string _secondaryClass;
- private BindingList<IRelateProperty> _propertyJoins;
+ private readonly BindingList<IRelateProperty> _propertyJoins;
public JoinSettings(string primaryFeatureSource, string primaryClass, IAttributeRelation rel)
: this()
@@ -78,10 +78,7 @@
}
}
- private void UpdateJoinKeyList(IAttributeRelation rel)
- {
- grdJoinKeys.DataSource = new List<IRelateProperty>(rel.RelateProperty);
- }
+ private void UpdateJoinKeyList(IAttributeRelation rel) => grdJoinKeys.DataSource = new List<IRelateProperty>(rel.RelateProperty);
private void btnBrowse_Click(object sender, EventArgs e)
{
@@ -116,10 +113,7 @@
}
}
- private void ClearPropertyJoins()
- {
- _propertyJoins.Clear();
- }
+ private void ClearPropertyJoins() => _propertyJoins.Clear();
private IEditorService _edSvc;
@@ -203,20 +197,12 @@
throw new InvalidOperationException();
}
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
- }
+ protected override void OnLoad(EventArgs e) => base.OnLoad(e);
- private void rdJoinTypeChanged(object sender, EventArgs e)
- {
- _rel.RelateType = GetJoinType();
- }
+ private void rdJoinTypeChanged(object sender, EventArgs e) => _rel.RelateType = GetJoinType();
private void CheckAddStatus()
- {
- btnAddKey.Enabled = !string.IsNullOrEmpty(txtFeatureSource.Text) && !string.IsNullOrEmpty(txtSecondaryClass.Text);
- }
+ => btnAddKey.Enabled = !string.IsNullOrEmpty(txtFeatureSource.Text) && !string.IsNullOrEmpty(txtSecondaryClass.Text);
private void grdJoinKeys_CellClick(object sender, DataGridViewCellEventArgs e)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/FsEditorMap.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/FsEditorMap.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/FsEditorMap.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -8,7 +8,7 @@
{
internal static class FsEditorMap
{
- private static Dictionary<string, Type> _editors;
+ private static readonly Dictionary<string, Type> _editors;
static FsEditorMap()
{
Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OdbcDriverMap.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OdbcDriverMap.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OdbcDriverMap.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -28,7 +28,7 @@
{
internal static class OdbcDriverMap
{
- private static Dictionary<string, Type> _drivers;
+ private static readonly Dictionary<string, Type> _drivers;
static OdbcDriverMap()
{
Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OverrideEditor/TableConfigurationDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OverrideEditor/TableConfigurationDialog.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OverrideEditor/TableConfigurationDialog.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -19,7 +19,7 @@
grdTables.DataSource = _tables;
}
- private IEditorService _edSvc;
+ private readonly IEditorService _edSvc;
public TableConfigurationDialog(IEditorService edSvc, OdbcConfigurationDocument doc, string schemaName)
: this()
@@ -75,7 +75,7 @@
}
}
- public string CoordinateSystemWkt { get { return txtCoordinateSystem.Text; } }
+ public string CoordinateSystemWkt => txtCoordinateSystem.Text;
public OdbcTableItem[] ConfiguredTables
{
@@ -102,15 +102,9 @@
}
}
- private void btnCancel_Click(object sender, EventArgs e)
- {
- this.DialogResult = DialogResult.Cancel;
- }
+ private void btnCancel_Click(object sender, EventArgs e) => this.DialogResult = DialogResult.Cancel;
- private void btnSave_Click(object sender, EventArgs e)
- {
- this.DialogResult = DialogResult.OK;
- }
+ private void btnSave_Click(object sender, EventArgs e) => this.DialogResult = DialogResult.OK;
private void grdTables_CurrentCellDirtyStateChanged(object sender, EventArgs e)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/Fusion/FlexibleLayoutEditorContext.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Fusion/FlexibleLayoutEditorContext.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Fusion/FlexibleLayoutEditorContext.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -20,11 +20,11 @@
#endregion Disclaimer / License
-using OSGeo.MapGuide.MaestroAPI;
using OSGeo.MapGuide.MaestroAPI.Services;
using OSGeo.MapGuide.ObjectModels;
using OSGeo.MapGuide.ObjectModels.ApplicationDefinition;
using System.Collections.Generic;
+using System.Linq;
namespace Maestro.Editors.Fusion
{
@@ -35,7 +35,7 @@
{
private IFusionService _service;
- private IApplicationDefinitionWidgetInfoSet _widgetSet;
+ private readonly IApplicationDefinitionWidgetInfoSet _widgetSet;
private IApplicationDefinitionTemplateInfoSet _templateSet;
private IApplicationDefinitionContainerInfoSet _containerSet;
@@ -72,10 +72,7 @@
/// Gets information about all widgets
/// </summary>
/// <returns></returns>
- public IWidgetInfo[] GetAllWidgets()
- {
- return new List<IWidgetInfo>(_widgetSet.WidgetInfo).ToArray();
- }
+ public IWidgetInfo[] GetAllWidgets() => _widgetSet.WidgetInfo.ToArray();
/// <summary>
/// Gets information about a specific container
Modified: trunk/Tools/Maestro/Maestro.Editors/Fusion/MapCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Fusion/MapCtrl.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Fusion/MapCtrl.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -38,23 +38,20 @@
}
private IMapWidget _widget;
- private IMapGroup _group;
+ private readonly IMapGroup _group;
private IApplicationDefinition _appDef;
private IEditorService _edSvc;
private class MapModel
{
- private IMap _map;
+ private readonly IMap _map;
public MapModel(IMap map)
{
_map = map;
}
- public IMap Map
- {
- get { return _map; }
- }
+ public IMap Map => _map;
public override string ToString()
{
@@ -65,7 +62,7 @@
if (string.IsNullOrEmpty(_map.Type))
return Strings.CmsGeneric;
else
- return _map.Type + " (" + cmsOpts.Type + ")";
+ return $"{_map.Type} ({cmsOpts.Type})"; //NOXLATE
}
else if (mgOpts != null)
{
@@ -82,7 +79,7 @@
}
}
- private BindingList<MapModel> _models;
+ private readonly BindingList<MapModel> _models;
public MapCtrl(IApplicationDefinition appDef, IMapGroup group, IEditorService edService, IMapWidget widget)
: this()
@@ -118,26 +115,26 @@
{
bool bAddedCommercialLayer = false;
var map = ed.Action();
- if (map.Type == EditorFactory.Type_Google)
+ switch (map.Type)
{
- _appDef.SetValue("GoogleScript", EditorFactory.GOOGLE_URL);
- bAddedCommercialLayer = true;
+ case EditorFactory.Type_Google:
+ _appDef.SetValue("GoogleScript", EditorFactory.GOOGLE_URL);
+ bAddedCommercialLayer = true;
+ break;
+ case EditorFactory.Type_Bing:
+ _appDef.SetValue("VirtualEarthScript", EditorFactory.BING_URL);
+ bAddedCommercialLayer = true;
+ break;
+ case EditorFactory.Type_OSM:
+ _appDef.SetValue("OpenStreetMapScript", EditorFactory.OSM_URL);
+ bAddedCommercialLayer = true;
+ break;
+ case EditorFactory.Type_Stamen:
+ _appDef.SetValue("StamenScript", EditorFactory.STAMEN_URL);
+ bAddedCommercialLayer = true;
+ break;
}
- else if (map.Type == EditorFactory.Type_Bing)
- {
- _appDef.SetValue("VirtualEarthScript", EditorFactory.BING_URL);
- bAddedCommercialLayer = true;
- }
- else if (map.Type == EditorFactory.Type_OSM)
- {
- _appDef.SetValue("OpenStreetMapScript", EditorFactory.OSM_URL);
- bAddedCommercialLayer = true;
- }
- else if (map.Type == EditorFactory.Type_Stamen)
- {
- _appDef.SetValue("StamenScript", EditorFactory.STAMEN_URL);
- bAddedCommercialLayer = true;
- }
+
_group.AddMap(map);
_models.Add(new MapModel(map));
if (bAddedCommercialLayer)
Modified: trunk/Tools/Maestro/Maestro.Editors/Fusion/MapEditors/CommercialMapEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Fusion/MapEditors/CommercialMapEditor.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Fusion/MapEditors/CommercialMapEditor.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -29,9 +29,9 @@
{
internal partial class CommercialMapEditor : UserControl
{
- private IEditorService _edSvc;
- private IMap _map;
- private bool _init;
+ private readonly IEditorService _edSvc;
+ private readonly IMap _map;
+ private readonly bool _init;
public CommercialMapEditor(IEditorService edSvc, IMap map, string[] types)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/Fusion/MapEditors/MapGuideEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Fusion/MapEditors/MapGuideEditor.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Fusion/MapEditors/MapGuideEditor.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -33,7 +33,7 @@
internal partial class MapGuideEditor : UserControl
{
private IMap _map;
- private IEditorService _edSvc;
+ private readonly IEditorService _edSvc;
private IMapView _initialView;
private IMapGroup _group;
private bool _init;
Modified: trunk/Tools/Maestro/Maestro.Editors/Fusion/MenuCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Fusion/MenuCtrl.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Fusion/MenuCtrl.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -35,7 +35,7 @@
InitializeComponent();
}
- private IFlyoutItem _menu;
+ private readonly IFlyoutItem _menu;
private IEditorService _edSvc;
private bool _init = false;
Modified: trunk/Tools/Maestro/Maestro.Editors/Fusion/NewWidgetDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Fusion/NewWidgetDialog.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Fusion/NewWidgetDialog.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -28,7 +28,7 @@
{
internal partial class NewWidgetDialog : Form
{
- private IApplicationDefinition _appDef;
+ private readonly IApplicationDefinition _appDef;
private FlexibleLayoutEditorContext _context;
public NewWidgetDialog(IApplicationDefinition appDef, FlexibleLayoutEditorContext context)
Modified: trunk/Tools/Maestro/Maestro.Editors/Fusion/WidgetReferenceCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Fusion/WidgetReferenceCtrl.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Fusion/WidgetReferenceCtrl.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -36,7 +36,7 @@
InitializeComponent();
}
- private IWidgetItem _widgetRef;
+ private readonly IWidgetItem _widgetRef;
private IApplicationDefinition _flexLayout;
private IFusionService _fsvc;
private FlexibleLayoutEditorContext _context;
Modified: trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/AutoCompletion/QualifiedNameCollection.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/AutoCompletion/QualifiedNameCollection.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/AutoCompletion/QualifiedNameCollection.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -257,7 +257,7 @@
/// <seealso cref='QualifiedName'/>
public class QualifiedNameEnumerator : IEnumerator
{
- private IEnumerator baseEnumerator;
+ private readonly IEnumerator baseEnumerator;
private IEnumerable temp;
/// <summary>
Modified: trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/AutoCompletion/XmlCompletionDataCollection.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/AutoCompletion/XmlCompletionDataCollection.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/AutoCompletion/XmlCompletionDataCollection.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -276,7 +276,7 @@
/// <seealso cref='XmlCompletionData'/>
public class XmlCompletionDataEnumerator : IEnumerator
{
- private IEnumerator baseEnumerator;
+ private readonly IEnumerator baseEnumerator;
private IEnumerable temp;
/// <summary>
Modified: trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/AutoCompletion/XmlCompletionDataProvider.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/AutoCompletion/XmlCompletionDataProvider.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/AutoCompletion/XmlCompletionDataProvider.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -95,7 +95,7 @@
// Namespace intellisense.
if (XmlParser.IsNamespaceDeclaration(text, text.Length))
{
- return schemaCompletionDataItems.GetNamespaceCompletionData(); ;
+ return schemaCompletionDataItems.GetNamespaceCompletionData();
}
break;
@@ -239,11 +239,7 @@
private set;
}
- public int DefaultIndex
- {
- get;
- private set;
- }
+ public int DefaultIndex { get; }
public bool InsertSpace
{
Modified: trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/AutoCompletion/XmlSchemaCompletionDataCollection.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/AutoCompletion/XmlSchemaCompletionDataCollection.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/AutoCompletion/XmlSchemaCompletionDataCollection.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -41,7 +41,7 @@
/// <summary>
/// A collection that stores <see cref='XmlSchemaCompletionData'/> objects.
/// </summary>
- [Serializable()]
+ [Serializable]
internal class XmlSchemaCompletionDataCollection : System.Collections.CollectionBase
{
/// <summary>
@@ -364,7 +364,7 @@
/// <seealso cref='XmlSchemaCompletionData'/>
public class XmlSchemaCompletionDataEnumerator : System.Collections.IEnumerator
{
- private System.Collections.IEnumerator baseEnumerator;
+ private readonly System.Collections.IEnumerator baseEnumerator;
private System.Collections.IEnumerable temp;
/// <summary>
Modified: trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/FindAndReplaceForm.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/FindAndReplaceForm.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/FindAndReplaceForm.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -337,7 +337,7 @@
internal class TextRange : AbstractSegment
{
- private IDocument _document;
+ private readonly IDocument _document;
public TextRange(IDocument document, int offset, int length)
{
@@ -567,7 +567,7 @@
/// together.</summary>
internal class HighlightGroup : IDisposable
{
- private List<TextMarker> _markers = new List<TextMarker>();
+ private readonly List<TextMarker> _markers = new List<TextMarker>();
private TextEditorControl _editor;
private IDocument _document;
Modified: trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/XmlFormattingStrategy.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/XmlFormattingStrategy.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/XmlFormattingStrategy.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -50,23 +50,23 @@
/// </summary>
internal class XmlFormattingStrategy : DefaultFormattingStrategy
{
- public override void FormatLine(TextArea textArea, int lineNr, int caretOffset, char charTyped) // used for comment tag formater/inserter
+ public override void FormatLine(TextArea textArea, int line, int cursorOffset, char ch) // used for comment tag formater/inserter
{
textArea.Document.UndoStack.StartUndoGroup();
try
{
- if (charTyped == '>')
+ if (ch == '>')
{
StringBuilder stringBuilder = new StringBuilder();
- int offset = Math.Min(caretOffset - 2, textArea.Document.TextLength - 1);
+ int offset = Math.Min(cursorOffset - 2, textArea.Document.TextLength - 1);
while (true)
{
if (offset < 0)
{
break;
}
- char ch = textArea.Document.GetCharAt(offset);
- if (ch == '<')
+ char c = textArea.Document.GetCharAt(offset);
+ if (c == '<')
{
string reversedTag = stringBuilder.ToString().Trim();
if (!reversedTag.StartsWith("/") && !reversedTag.EndsWith("/"))
@@ -92,13 +92,13 @@
string tagString = tag.ToString();
if (tagString.Length > 0 && !tagString.StartsWith("!") && !tagString.StartsWith("?"))
{
- textArea.Document.Insert(caretOffset, "</" + tagString + ">");
+ textArea.Document.Insert(cursorOffset, "</" + tagString + ">");
}
}
}
break;
}
- stringBuilder.Append(ch);
+ stringBuilder.Append(c);
--offset;
}
}
@@ -107,9 +107,9 @@
{ // Insanity check
Debug.Assert(false, e.ToString());
}
- if (charTyped == '\n')
+ if (ch == '\n')
{
- textArea.Caret.Column = IndentLine(textArea, lineNr);
+ textArea.Caret.Column = IndentLine(textArea, line);
}
textArea.Document.UndoStack.EndUndoGroup();
}
@@ -117,17 +117,17 @@
/// <summary>
/// Define XML specific smart indenting for a line :)
/// </summary>
- protected override int SmartIndentLine(TextArea textArea, int lineNr)
+ protected override int SmartIndentLine(TextArea textArea, int line)
{
- if (lineNr <= 0) return AutoIndentLine(textArea, lineNr);
+ if (line <= 0) return AutoIndentLine(textArea, line);
try
{
- TryIndent(textArea, lineNr, lineNr);
- return GetIndentation(textArea, lineNr).Length;
+ TryIndent(textArea, line, line);
+ return GetIndentation(textArea, line).Length;
}
catch (XmlException)
{
- return AutoIndentLine(textArea, lineNr);
+ return AutoIndentLine(textArea, line);
}
}
Modified: trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -50,32 +50,26 @@
{
private class FindAction : AbstractEditAction
{
- private XmlEditorCtrl _parent;
+ private readonly XmlEditorCtrl _parent;
public FindAction(XmlEditorCtrl parent)
{
_parent = parent;
}
- public override void Execute(ICSharpCode.TextEditor.TextArea textArea)
- {
- _parent.DoFind();
- }
+ public override void Execute(ICSharpCode.TextEditor.TextArea textArea) => _parent.DoFind();
}
private class FindAndReplaceAction : AbstractEditAction
{
- private XmlEditorCtrl _parent;
+ private readonly XmlEditorCtrl _parent;
public FindAndReplaceAction(XmlEditorCtrl parent)
{
_parent = parent;
}
- public override void Execute(ICSharpCode.TextEditor.TextArea textArea)
- {
- _parent.DoFindReplace();
- }
+ public override void Execute(ICSharpCode.TextEditor.TextArea textArea) => _parent.DoFindReplace();
}
private bool _ready = false;
@@ -164,19 +158,13 @@
/// <summary>
/// Readies for editing.
/// </summary>
- public void ReadyForEditing()
- {
- _ready = true;
- }
+ public void ReadyForEditing() => _ready = true;
/// <summary>
/// Raises the <see cref="E:System.Windows.Forms.UserControl.Load"/> event.
/// </summary>
/// <param name="e">An <see cref="T:System.EventArgs"/> that contains the event data.</param>
- protected override void OnLoad(EventArgs e)
- {
- EvaluateCommands();
- }
+ protected override void OnLoad(EventArgs e) => EvaluateCommands();
private void EvaluateCommands()
{
@@ -211,15 +199,9 @@
}
}
- private void btnUndo_Click(object sender, EventArgs e)
- {
- txtXmlContent.Undo();
- }
+ private void btnUndo_Click(object sender, EventArgs e) => txtXmlContent.Undo();
- private IDocument GetDocument()
- {
- return txtXmlContent.ActiveTextAreaControl.Document;
- }
+ private IDocument GetDocument() => txtXmlContent.ActiveTextAreaControl.Document;
private void UpdateTextPosition()
{
@@ -238,10 +220,7 @@
OnResourceChanged();
}
- private void btnValidate_Click(object sender, EventArgs e)
- {
- PerformValidation(false, false);
- }
+ private void btnValidate_Click(object sender, EventArgs e) => PerformValidation(false, false);
/// <summary>
/// Performs validation of the XML content
@@ -296,17 +275,14 @@
return true;
}
- private void btnFormat_Click(object sender, EventArgs e)
- {
- FormatText();
- }
+ private void btnFormat_Click(object sender, EventArgs e) => FormatText();
private void FormatText()
{
if (string.IsNullOrEmpty(txtXmlContent.Text))
return;
- System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
+ var doc = new XmlDocument();
using (var ms = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(txtXmlContent.Text)))
{
@@ -344,10 +320,7 @@
/// Inits the resource data.
/// </summary>
/// <param name="service">The service.</param>
- public void InitResourceData(IEditorService service)
- {
- resDataCtrl.Init(service);
- }
+ public void InitResourceData(IEditorService service) => resDataCtrl.Init(service);
private void resDataCtrl_DataListChanged(object sender, EventArgs e)
{
@@ -356,26 +329,17 @@
}
private void btnCut_Click(object sender, EventArgs e)
- {
- txtXmlContent.ActiveTextAreaControl.TextArea.ClipboardHandler.Cut(this, EventArgs.Empty);
- }
-
+ => txtXmlContent.ActiveTextAreaControl.TextArea.ClipboardHandler.Cut(this, EventArgs.Empty);
+
private void btnCopy_Click(object sender, EventArgs e)
- {
- txtXmlContent.ActiveTextAreaControl.TextArea.ClipboardHandler.Copy(this, EventArgs.Empty);
- }
-
+ => txtXmlContent.ActiveTextAreaControl.TextArea.ClipboardHandler.Copy(this, EventArgs.Empty);
+
private void btnPaste_Click(object sender, EventArgs e)
- {
- txtXmlContent.ActiveTextAreaControl.TextArea.ClipboardHandler.Paste(this, EventArgs.Empty);
- }
+ => txtXmlContent.ActiveTextAreaControl.TextArea.ClipboardHandler.Paste(this, EventArgs.Empty);
private XmlEditor.FindAndReplaceForm _findForm = new XmlEditor.FindAndReplaceForm();
- private void btnFind_Click(object sender, EventArgs e)
- {
- DoFind();
- }
+ private void btnFind_Click(object sender, EventArgs e) => DoFind();
private void DoFind()
{
@@ -384,10 +348,7 @@
_findForm.ShowFor(editor, false);
}
- private void btnFindAndReplace_Click(object sender, EventArgs e)
- {
- DoFindReplace();
- }
+ private void btnFindAndReplace_Click(object sender, EventArgs e) => DoFindReplace();
private void DoFindReplace()
{
@@ -408,29 +369,17 @@
}
private void cutToolStripMenuItem_Click(object sender, EventArgs e)
- {
- txtXmlContent.ActiveTextAreaControl.TextArea.ClipboardHandler.Cut(this, EventArgs.Empty);
- }
+ => txtXmlContent.ActiveTextAreaControl.TextArea.ClipboardHandler.Cut(this, EventArgs.Empty);
private void copyToolStripMenuItem_Click(object sender, EventArgs e)
- {
- txtXmlContent.ActiveTextAreaControl.TextArea.ClipboardHandler.Copy(this, EventArgs.Empty);
- }
+ => txtXmlContent.ActiveTextAreaControl.TextArea.ClipboardHandler.Copy(this, EventArgs.Empty);
private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
- {
- txtXmlContent.ActiveTextAreaControl.TextArea.ClipboardHandler.Paste(this, EventArgs.Empty);
- }
+ => txtXmlContent.ActiveTextAreaControl.TextArea.ClipboardHandler.Paste(this, EventArgs.Empty);
- private void findToolStripMenuItem_Click(object sender, EventArgs e)
- {
- DoFind();
- }
+ private void findToolStripMenuItem_Click(object sender, EventArgs e) => DoFind();
- private void findReplaceToolStripMenuItem_Click(object sender, EventArgs e)
- {
- DoFindReplace();
- }
+ private void findReplaceToolStripMenuItem_Click(object sender, EventArgs e) => DoFindReplace();
/// <summary>
/// Gets or sets whether this editor can support reloading XML content
@@ -453,9 +402,7 @@
private void btnReRead_Click(object sender, EventArgs e)
{
- var h = this.RequestReloadFromSource;
- if (h != null)
- h(this, EventArgs.Empty);
+ this.RequestReloadFromSource?.Invoke(this, EventArgs.Empty);
}
}
@@ -481,24 +428,12 @@
/// <summary>
/// The line where the fold should start. Lines start from 0.
/// </summary>
- public int Line
- {
- get
- {
- return line;
- }
- }
+ public int Line => line;
/// <summary>
/// The column where the fold should start. Columns start from 0.
/// </summary>
- public int Column
- {
- get
- {
- return col;
- }
- }
+ public int Column => col;
/// <summary>
/// The name of the xml item with its prefix if it has one.
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Drawing/DrawingLayerSettingsCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Drawing/DrawingLayerSettingsCtrl.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Drawing/DrawingLayerSettingsCtrl.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -45,7 +45,7 @@
private IEditorService _service;
private IDrawingLayerDefinition _dlayer;
- private BindingList<OSGeo.MapGuide.ObjectModels.Common.DrawingSectionListSection> _sheets;
+ private readonly BindingList<OSGeo.MapGuide.ObjectModels.Common.DrawingSectionListSection> _sheets;
public void Bind(IEditorService service)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/GridEditor/RuleModel.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/GridEditor/RuleModel.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/GridEditor/RuleModel.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -295,37 +295,22 @@
internal class BasicLineSymbolizationAdapter : ILineRule
{
- private ILineRule _wrappee;
+ private readonly ILineRule _wrappee;
public BasicLineSymbolizationAdapter(ILineRule wrappee)
{
_wrappee = wrappee;
}
- public int StrokeCount
- {
- get { return _wrappee.StrokeCount; }
- }
+ public int StrokeCount => _wrappee.StrokeCount;
- public IEnumerable<IStroke> Strokes
- {
- get { return _wrappee.Strokes; }
- }
+ public IEnumerable<IStroke> Strokes => _wrappee.Strokes;
- public void SetStrokes(IEnumerable<IStroke> strokes)
- {
- _wrappee.SetStrokes(strokes);
- }
+ public void SetStrokes(IEnumerable<IStroke> strokes) => _wrappee.SetStrokes(strokes);
- public void AddStroke(IStroke stroke)
- {
- _wrappee.AddStroke(stroke);
- }
+ public void AddStroke(IStroke stroke) => _wrappee.AddStroke(stroke);
- public void RemoveStroke(IStroke stroke)
- {
- _wrappee.RemoveStroke(stroke);
- }
+ public void RemoveStroke(IStroke stroke) => _wrappee.RemoveStroke(stroke);
public ITextSymbol Label
{
@@ -379,10 +364,7 @@
this.HasStyle = (_rule.Strokes != null && _rule.StrokeCount > 0);
}
- public override BasicLineSymbolizationAdapter GetSymbolizationStyle()
- {
- return new BasicLineSymbolizationAdapter(_rule);
- }
+ public override BasicLineSymbolizationAdapter GetSymbolizationStyle() => new BasicLineSymbolizationAdapter(_rule);
public override ILabeledRuleModel CloneLabeledRuleModel(ILayerElementFactory factory)
{
@@ -412,10 +394,7 @@
this.HasStyle = (_rule.AreaSymbolization2D != null);
}
- public override IAreaSymbolizationFill GetSymbolizationStyle()
- {
- return _rule.AreaSymbolization2D;
- }
+ public override IAreaSymbolizationFill GetSymbolizationStyle() => _rule.AreaSymbolization2D;
public override void SetSymbolizationStyle(IAreaSymbolizationFill style)
{
@@ -438,7 +417,7 @@
internal class CompositeRuleModel : RuleModel
{
- private ICompositeRule _rule;
+ private readonly ICompositeRule _rule;
public CompositeRuleModel(ICompositeRule rule, int index)
{
@@ -447,15 +426,9 @@
this.HasStyle = (_rule.CompositeSymbolization != null);
}
- public override object UnwrapRule()
- {
- return _rule;
- }
+ public override object UnwrapRule() => _rule;
- public ICompositeSymbolization GetSymbolizationStyle()
- {
- return _rule.CompositeSymbolization;
- }
+ public ICompositeSymbolization GetSymbolizationStyle() => _rule.CompositeSymbolization;
public void SetSymbolizationStyle(ICompositeSymbolization style)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/GridEditor/VectorScaleRangeGrid.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/GridEditor/VectorScaleRangeGrid.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/GridEditor/VectorScaleRangeGrid.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -38,13 +38,13 @@
}
private bool _init = false;
- private VectorLayerStyleSectionCtrl _parent;
- private IVectorScaleRange _vsr;
+ private readonly VectorLayerStyleSectionCtrl _parent;
+ private readonly IVectorScaleRange _vsr;
private IPointVectorStyle _pts;
private ILineVectorStyle _lts;
private IAreaVectorStyle _ats;
- private BindingList<ICompositeTypeStyle> _cts;
- private ILayerDefinition _editedLayer;
+ private readonly BindingList<ICompositeTypeStyle> _cts;
+ private readonly ILayerDefinition _editedLayer;
public VectorScaleRangeGrid(IVectorScaleRange vsr, VectorLayerStyleSectionCtrl parent)
: this()
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/ILayerStylePreviewable.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/ILayerStylePreviewable.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/ILayerStylePreviewable.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -49,40 +49,16 @@
this.ThemeCategory = themeCat;
}
- public string LayerDefinition
- {
- get;
- private set;
- }
+ public string LayerDefinition { get; }
- public double Scale
- {
- get;
- private set;
- }
+ public double Scale { get; }
- public int Width
- {
- get;
- private set;
- }
+ public int Width { get; }
- public int Height
- {
- get;
- private set;
- }
+ public int Height { get; }
- public string ImageFormat
- {
- get;
- private set;
- }
+ public string ImageFormat { get; }
- public int ThemeCategory
- {
- get;
- private set;
- }
+ public int ThemeCategory { get; }
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ConditionList.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ConditionList.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ConditionList.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -52,7 +52,7 @@
{
m_owner = value;
foreach (Condition c in this.Controls)
- c.Owner = m_owner; ;
+ c.Owner = m_owner;
}
}
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ItemStyle.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ItemStyle.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/ItemStyle.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -131,12 +131,18 @@
}
else if (m_point != null)
{
- if (m_point.Symbol.Type == PointSymbolType.Mark)
- FeaturePreviewRender.RenderPreviewPoint(e.Graphics, rect, m_point.Symbol as IMarkSymbol);
- else if (m_point.Symbol.Type == PointSymbolType.Font)
- FeaturePreviewRender.RenderPreviewFontSymbol(e.Graphics, rect, m_point.Symbol as IFontSymbol);
- else if (m_point.Symbol.Type == PointSymbolType.W2D)
- FeaturePreviewRender.RenderW2DImage(e.Graphics, rect, m_point.Symbol as IW2DSymbol, m_w2dsymbol);
+ switch (m_point.Symbol.Type)
+ {
+ case PointSymbolType.Mark:
+ FeaturePreviewRender.RenderPreviewPoint(e.Graphics, rect, m_point.Symbol as IMarkSymbol);
+ break;
+ case PointSymbolType.Font:
+ FeaturePreviewRender.RenderPreviewFontSymbol(e.Graphics, rect, m_point.Symbol as IFontSymbol);
+ break;
+ case PointSymbolType.W2D:
+ FeaturePreviewRender.RenderW2DImage(e.Graphics, rect, m_point.Symbol as IW2DSymbol, m_w2dsymbol);
+ break;
+ }
}
else if (m_line != null)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstanceEditors/ReferenceCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstanceEditors/ReferenceCtrl.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstanceEditors/ReferenceCtrl.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -34,7 +34,7 @@
[ToolboxItem(false)]
internal partial class ReferenceCtrl : UserControl
{
- private IEditorService _edSvc;
+ private readonly IEditorService _edSvc;
private ISymbolInstanceReferenceLibrary _libRef;
public ReferenceCtrl(ISymbolInstanceReferenceLibrary libRef, IEditorService edSvc)
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancePropertiesDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancePropertiesDialog.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancePropertiesDialog.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -49,19 +49,19 @@
_providerName = providerName;
symAddToExclusionRegion.SetBooleanMode();
- symAddToExclusionRegion.Bind(inst, "AddToExclusionRegion");
+ symAddToExclusionRegion.Bind(inst, nameof(inst.AddToExclusionRegion));
symCheckExclusionRegion.SetBooleanMode();
- symCheckExclusionRegion.Bind(inst, "CheckExclusionRegion");
+ symCheckExclusionRegion.Bind(inst, nameof(inst.CheckExclusionRegion));
symDrawLast.SetBooleanMode();
- symDrawLast.Bind(inst, "DrawLast");
+ symDrawLast.Bind(inst, nameof(inst.DrawLast));
symSizeContext.SetEnumMode<SizeContextType>();
- symSizeContext.Bind(inst, "SizeContext");
+ symSizeContext.Bind(inst, nameof(inst.SizeContext));
- symInsertOffsetX.Bind(inst, "InsertionOffsetX");
- symInsertOffsetY.Bind(inst, "InsertionOffsetY");
+ symInsertOffsetX.Bind(inst, nameof(inst.InsertionOffsetX));
+ symInsertOffsetY.Bind(inst, nameof(inst.InsertionOffsetY));
symPositioningAlgorithm.Items = new string[]
{
@@ -69,10 +69,10 @@
"'EightSurrounding'",
"'PathLabels'"
};
- symPositioningAlgorithm.Bind(inst, "PositioningAlgorithm");
+ symPositioningAlgorithm.Bind(inst, nameof(inst.PositioningAlgorithm));
- symScaleX.Bind(inst, "ScaleX");
- symScaleY.Bind(inst, "ScaleY");
+ symScaleX.Bind(inst, nameof(inst.ScaleX));
+ symScaleY.Bind(inst, nameof(inst.ScaleY));
var inst2 = inst as ISymbolInstance2;
if (inst2 != null)
@@ -80,9 +80,9 @@
symGeometryContext.SetEnumMode<GeometryContextType>();
symUsageContext.SetEnumMode<UsageContextType>();
- symRenderingPass.Bind(inst2, "RenderingPass");
- symGeometryContext.Bind(inst2, "GeometryContext");
- symUsageContext.Bind(inst2, "UsageContext");
+ symRenderingPass.Bind(inst2, nameof(inst2.RenderingPass));
+ symGeometryContext.Bind(inst2, nameof(inst2.GeometryContext));
+ symUsageContext.Bind(inst2, nameof(inst2.UsageContext));
}
else
{
@@ -95,10 +95,7 @@
}
}
- private void btnClose_Click(object sender, EventArgs e)
- {
- this.DialogResult = System.Windows.Forms.DialogResult.OK;
- }
+ private void btnClose_Click(object sender, EventArgs e) => this.DialogResult = System.Windows.Forms.DialogResult.OK;
private void OnRequestBrowse(SymbolDefinition.SymbolField sender)
{
@@ -107,10 +104,7 @@
sender.Content = expr;
}
- private void OnContentChanged(object sender, EventArgs e)
- {
- this.HasChanged = true;
- }
+ private void OnContentChanged(object sender, EventArgs e) => this.HasChanged = true;
public bool HasChanged { get; private set; }
}
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/SymbolInstancesDialog.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -47,7 +47,7 @@
internal partial class SymbolInstancesDialog : Form
{
private IEditorService _edSvc;
- private ICompositeSymbolization _comp;
+ private readonly ICompositeSymbolization _comp;
private ClassDefinition _cls;
private string _provider;
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/VectorScaleRangeCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/VectorScaleRangeCtrl.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Scales/VectorScaleRangeCtrl.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -35,7 +35,7 @@
private IAreaVectorStyle _ars;
private BindingList<ICompositeTypeStyle> _cts;
- private VectorLayerStyleSectionCtrl _parent;
+ private readonly VectorLayerStyleSectionCtrl _parent;
private IVectorScaleRange _vsr;
private bool _init;
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/AreaFeatureStyleEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/AreaFeatureStyleEditor.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/AreaFeatureStyleEditor.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -219,7 +219,7 @@
return;
if (fillStyleEditor.displayFill.Checked)
- m_item.Fill = previousFill == null ? _factory.CreateDefaultFill() : previousFill;
+ m_item.Fill = previousFill ?? _factory.CreateDefaultFill();
else
{
if (m_item.Fill != null)
@@ -259,7 +259,7 @@
return;
if (lineStyleEditor.displayLine.Checked)
- m_item.Stroke = previousStroke == null ? _factory.CreateDefaultStroke() : previousStroke;
+ m_item.Stroke = previousStroke ?? _factory.CreateDefaultStroke();
else
{
if (m_item.Stroke != null)
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/FontStyleEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/FontStyleEditor.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/FontStyleEditor.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -43,10 +43,10 @@
public event EventHandler Changed;
- private IEditorService m_editor;
- private ClassDefinition m_schema;
- private string m_featureSource;
- private string m_providername;
+ private readonly IEditorService m_editor;
+ private readonly ClassDefinition m_schema;
+ private readonly string m_featureSource;
+ private readonly string m_providername;
private ILayerElementFactory _factory;
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/PointFeatureStyleEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/PointFeatureStyleEditor.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/PointFeatureStyleEditor.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -1294,18 +1294,18 @@
if (m_item.Symbol.Type == PointSymbolType.Mark)
{
+ var ms = ((IMarkSymbol)m_item.Symbol);
if (fillStyleEditor.displayFill.Checked)
- ((IMarkSymbol)m_item.Symbol).Fill = previousFill == null ? _factory.CreateDefaultFill() : previousFill;
+ ms.Fill = previousFill ?? _factory.CreateDefaultFill();
else
{
- if (((IMarkSymbol)m_item.Symbol).Fill != null)
- previousFill = ((IMarkSymbol)m_item.Symbol).Fill;
- ((IMarkSymbol)m_item.Symbol).Fill = null;
+ if (ms.Fill != null)
+ previousFill = ms.Fill;
+ ms.Fill = null;
}
}
UpdatePreviewResult();
- if (Changed != null)
- Changed(this, new EventArgs());
+ Changed?.Invoke(this, new EventArgs());
}
private void displayLine_CheckedChanged(object sender, EventArgs e)
@@ -1315,18 +1315,18 @@
if (m_item.Symbol.Type == PointSymbolType.Mark)
{
+ var ms = ((IMarkSymbol)m_item.Symbol);
if (lineStyleEditor.displayLine.Checked)
- ((IMarkSymbol)m_item.Symbol).Edge = previousEdge == null ? _factory.CreateDefaultStroke() : previousEdge;
+ ms.Edge = previousEdge ?? _factory.CreateDefaultStroke();
else
{
- if (((IMarkSymbol)m_item.Symbol).Edge != null)
- previousEdge = ((IMarkSymbol)m_item.Symbol).Edge;
- ((IMarkSymbol)m_item.Symbol).Edge = null;
+ if (ms.Edge != null)
+ previousEdge = ms.Edge;
+ ms.Edge = null;
}
}
UpdatePreviewResult();
- if (Changed != null)
- Changed(this, new EventArgs());
+ Changed?.Invoke(this, new EventArgs());
}
private void fillCombo_SelectedIndexChanged(object sender, EventArgs e)
@@ -1337,8 +1337,7 @@
if (m_item.Symbol.Type == PointSymbolType.Mark)
((IMarkSymbol)m_item.Symbol).Fill.FillPattern = fillStyleEditor.fillCombo.Text;
UpdatePreviewResult();
- if (Changed != null)
- Changed(this, new EventArgs());
+ Changed?.Invoke(this, new EventArgs());
}
private void foregroundColor_CurrentColorChanged(object sender, EventArgs e)
@@ -1349,8 +1348,7 @@
if (m_item.Symbol.Type == PointSymbolType.Mark)
((IMarkSymbol)m_item.Symbol).Fill.ForegroundColor = fillStyleEditor.foregroundColor.ColorExpression;
UpdatePreviewResult();
- if (Changed != null)
- Changed(this, new EventArgs());
+ Changed?.Invoke(this, new EventArgs());
}
private void backgroundColor_CurrentColorChanged(object sender, EventArgs e)
@@ -1361,8 +1359,7 @@
if (m_item.Symbol.Type == PointSymbolType.Mark)
((IMarkSymbol)m_item.Symbol).Fill.BackgroundColor = fillStyleEditor.backgroundColor.ColorExpression;
UpdatePreviewResult();
- if (Changed != null)
- Changed(this, new EventArgs());
+ Changed?.Invoke(this, new EventArgs());
}
private void thicknessCombo_TextChanged(object sender, EventArgs e)
@@ -1374,8 +1371,7 @@
if (m_item.Symbol.Type == PointSymbolType.Mark)
((IMarkSymbol)m_item.Symbol).Edge.Thickness = lineStyleEditor.thicknessCombo.Text;
UpdatePreviewResult();
- if (Changed != null)
- Changed(this, new EventArgs());
+ Changed?.Invoke(this, new EventArgs());
}
private void thicknessCombo_SelectedIndexChanged(object sender, EventArgs e)
@@ -1407,8 +1403,7 @@
if (m_item.Symbol.Type == PointSymbolType.Mark)
((IMarkSymbol)m_item.Symbol).Edge.Color = lineStyleEditor.colorCombo.ColorExpression;
UpdatePreviewResult();
- if (Changed != null)
- Changed(this, new EventArgs());
+ Changed?.Invoke(this, new EventArgs());
}
private void fillCombo_Line_SelectedIndexChanged(object sender, EventArgs e)
@@ -1419,8 +1414,7 @@
if (m_item.Symbol.Type == PointSymbolType.Mark)
((IMarkSymbol)m_item.Symbol).Edge.LineStyle = lineStyleEditor.fillCombo.Text;
UpdatePreviewResult();
- if (Changed != null)
- Changed(this, new EventArgs());
+ Changed?.Invoke(this, new EventArgs());
}
private void colourFontForeground_CurrentColorChanged(object sender, EventArgs e)
@@ -1432,8 +1426,7 @@
((IFontSymbol)m_item.Symbol).ForegroundColor = Utility.SerializeHTMLColor(colorFontForeground.CurrentColor, true);
UpdatePreviewResult();
- if (Changed != null)
- Changed(this, new EventArgs());
+ Changed?.Invoke(this, new EventArgs());
}
private void fontCombo_SelectedIndexChanged(object sender, EventArgs e)
@@ -1462,8 +1455,7 @@
comboBoxCharacter.Items.Add(c);
UpdatePreviewResult();
- if (Changed != null)
- Changed(this, new EventArgs());
+ Changed?.Invoke(this, new EventArgs());
}
private void comboBoxCharacter_SelectedIndexChanged(object sender, System.EventArgs e)
@@ -1478,14 +1470,10 @@
((IFontSymbol)m_item.Symbol).Character = comboBoxCharacter.Text;
UpdatePreviewResult();
- if (Changed != null)
- Changed(this, new EventArgs());
+ Changed?.Invoke(this, new EventArgs());
}
- private void comboBoxCharacter_TextChanged(object sender, System.EventArgs e)
- {
- comboBoxCharacter_SelectedIndexChanged(sender, e);
- }
+ private void comboBoxCharacter_TextChanged(object sender, EventArgs e) => comboBoxCharacter_SelectedIndexChanged(sender, e);
public IPointSymbolization2D Item
{
@@ -1520,10 +1508,7 @@
UpdatePreviewResult();
}
- private static string DoubleToString(double? value)
- {
- return value.HasValue ? value.Value.ToString() : null;
- }
+ private static string DoubleToString(double? value) => value.HasValue ? value.Value.ToString() : null;
private static double? StringToDouble(string value)
{
@@ -1565,8 +1550,7 @@
}
UpdatePreviewResult();
- if (Changed != null)
- Changed(this, new EventArgs());
+ Changed?.Invoke(this, new EventArgs());
}
private void RotationBox_TextChanged(object sender, EventArgs e)
@@ -1587,15 +1571,14 @@
}
UpdatePreviewResult();
- if (Changed != null)
- Changed(this, new EventArgs());
+ Changed?.Invoke(this, new EventArgs());
}
private void ReferenceY_Leave(object sender, EventArgs e)
{
double d;
if (m_item.Symbol is IMarkSymbol)
- if (!double.TryParse(((IMarkSymbol)m_item.Symbol).InsertionPointY, System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out d))
+ if (!double.TryParse(((IMarkSymbol)m_item.Symbol).InsertionPointY, NumberStyles.Float, CultureInfo.InvariantCulture, out d))
MessageBox.Show(this, Strings.InsertionPointYError, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
@@ -1611,8 +1594,7 @@
}
UpdatePreviewResult();
- if (Changed != null)
- Changed(this, new EventArgs());
+ Changed?.Invoke(this, new EventArgs());
}
private void FontItalicButton_Click(object sender, EventArgs e)
@@ -1627,8 +1609,7 @@
}
UpdatePreviewResult();
- if (Changed != null)
- Changed(this, new EventArgs());
+ Changed?.Invoke(this, new EventArgs());
}
private void FontUnderlineButton_Click(object sender, EventArgs e)
@@ -1643,8 +1624,7 @@
}
UpdatePreviewResult();
- if (Changed != null)
- Changed(this, new EventArgs());
+ Changed?.Invoke(this, new EventArgs());
}
internal void SetupForTheming()
@@ -1740,8 +1720,7 @@
sym.FillColor = Utility.SerializeHTMLColor(cmbW2DFillColor.CurrentColor, true);
UpdatePreviewResult();
- if (Changed != null)
- Changed(this, new EventArgs());
+ Changed?.Invoke(this, new EventArgs());
}
private void cmbW2DLineColor_SelectedIndexChanged(object sender, EventArgs e)
@@ -1759,8 +1738,7 @@
sym.LineColor = Utility.SerializeHTMLColor(cmbW2DLineColor.CurrentColor, true);
UpdatePreviewResult();
- if (Changed != null)
- Changed(this, new EventArgs());
+ Changed?.Invoke(this, new EventArgs());
}
private void cmbW2DTextColor_SelectedIndexChanged(object sender, EventArgs e)
@@ -1778,8 +1756,7 @@
sym.TextColor = Utility.SerializeHTMLColor(cmbW2DTextColor.CurrentColor, true);
UpdatePreviewResult();
- if (Changed != null)
- Changed(this, new EventArgs());
+ Changed?.Invoke(this, new EventArgs());
}
private void FillStyleEditor_BackgroundRequiresExpression(object sender, EventArgs e)
@@ -1819,8 +1796,7 @@
private void UpdatePreviewResult()
{
- if (_editCommit != null)
- _editCommit.Invoke();
+ _editCommit?.Invoke();
UpdatePreviewImage();
}
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/StyleImageCache.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/StyleImageCache.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/StyleImageCache.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -28,7 +28,7 @@
{
internal static class StyleImageCache
{
- private static Assembly _asm;
+ private static readonly Assembly _asm;
static StyleImageCache()
{
@@ -62,10 +62,7 @@
}
}
- private static int CompareImages(ImageStylePicker.NamedImage x, ImageStylePicker.NamedImage y)
- {
- return x.Name.CompareTo(y.Name);
- }
+ private static int CompareImages(ImageStylePicker.NamedImage x, ImageStylePicker.NamedImage y) => x.Name.CompareTo(y.Name);
private static ImageStylePicker.NamedImage[] _lines;
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ColorBrewer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ColorBrewer.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ColorBrewer.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -272,7 +272,7 @@
/// <summary>
/// A reference to the set
/// </summary>
- private ColorBrewer m_set;
+ private readonly ColorBrewer m_set;
/// <summary>
/// The current display mode
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -151,7 +151,7 @@
for (int i = 0; i < items; i++)
{
- Rectangle area = new Rectangle(args.Bounds.Left + leftOffset + (i * itemWidth), args.Bounds.Top + 1, itemWidth, args.Bounds.Height - 3); ;
+ Rectangle area = new Rectangle(args.Bounds.Left + leftOffset + (i * itemWidth), args.Bounds.Top + 1, itemWidth, args.Bounds.Height - 3);
if (maxItems < cb.Colors.Count && i == items / 2)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/LoadProcedure/InputFilesCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LoadProcedure/InputFilesCtrl.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/LoadProcedure/InputFilesCtrl.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -75,14 +75,21 @@
private string GetFilter()
{
string filter = OSGeo.MapGuide.MaestroAPI.StringConstants.AllFilesFilter;
- if (_lpt.Type == LoadType.Sdf)
- filter = string.Format(OSGeo.MapGuide.MaestroAPI.Strings.GenericFilter, OSGeo.MapGuide.MaestroAPI.Strings.PickSdf, "sdf"); //NOXLATE
- else if (_lpt.Type == LoadType.Shp)
- filter = string.Format(OSGeo.MapGuide.MaestroAPI.Strings.GenericFilter, OSGeo.MapGuide.MaestroAPI.Strings.PickShp, "shp"); //NOXLATE
- else if (_lpt.Type == LoadType.Dwf)
- filter = string.Format(OSGeo.MapGuide.MaestroAPI.Strings.GenericFilter, OSGeo.MapGuide.MaestroAPI.Strings.PickDwf, "dwf"); //NOXLATE
- else if (_lpt.Type == LoadType.Sqlite)
- filter = string.Format(OSGeo.MapGuide.MaestroAPI.Strings.GenericFilter, OSGeo.MapGuide.MaestroAPI.Strings.PickSqlite, "sqlite"); //NOXLATE
+ switch (_lpt.Type)
+ {
+ case LoadType.Sdf:
+ filter = string.Format(OSGeo.MapGuide.MaestroAPI.Strings.GenericFilter, OSGeo.MapGuide.MaestroAPI.Strings.PickSdf, "sdf"); //NOXLATE
+ break;
+ case LoadType.Shp:
+ filter = string.Format(OSGeo.MapGuide.MaestroAPI.Strings.GenericFilter, OSGeo.MapGuide.MaestroAPI.Strings.PickShp, "shp"); //NOXLATE
+ break;
+ case LoadType.Dwf:
+ filter = string.Format(OSGeo.MapGuide.MaestroAPI.Strings.GenericFilter, OSGeo.MapGuide.MaestroAPI.Strings.PickDwf, "dwf"); //NOXLATE
+ break;
+ case LoadType.Sqlite:
+ filter = string.Format(OSGeo.MapGuide.MaestroAPI.Strings.GenericFilter, OSGeo.MapGuide.MaestroAPI.Strings.PickSqlite, "sqlite"); //NOXLATE
+ break;
+ }
return filter;
}
Modified: trunk/Tools/Maestro/Maestro.Editors/MapDefinition/FiniteScaleListCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/MapDefinition/FiniteScaleListCtrl.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/MapDefinition/FiniteScaleListCtrl.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -46,10 +46,10 @@
lstDisplayScales.DataSource = _scales;
}
- private BindingList<double> _scales;
+ private readonly BindingList<double> _scales;
private ITileSetAbstract _tileSet;
- private IEditorService _edSvc;
+ private readonly IEditorService _edSvc;
public FiniteScaleListCtrl(ITileSetAbstract map, IEditorService editorSvc)
: this()
@@ -200,7 +200,7 @@
}
}
- private static double[] CMS_SCALE_LIST = {
+ private static readonly double[] CMS_SCALE_LIST = {
1128.49722,
2256.9944399999999,
4513.9888799999999,
Modified: trunk/Tools/Maestro/Maestro.Editors/MapDefinition/GroupPropertiesCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/MapDefinition/GroupPropertiesCtrl.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/MapDefinition/GroupPropertiesCtrl.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -39,8 +39,8 @@
public event EventHandler GroupChanged;
- private IMapDefinition _mdf;
- private IMapLegendElementBase _el;
+ private readonly IMapDefinition _mdf;
+ private readonly IMapLegendElementBase _el;
private bool _init = false;
Modified: trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LayerPropertiesCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LayerPropertiesCtrl.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/MapDefinition/LayerPropertiesCtrl.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -42,7 +42,7 @@
public event EventHandler LayerChanged;
- private IEditorService _edSvc;
+ private readonly IEditorService _edSvc;
public LayerPropertiesCtrl(IMapLayer layer, IEditorService edSvc)
: this()
Modified: trunk/Tools/Maestro/Maestro.Editors/MapDefinition/Live/DragMessages.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/MapDefinition/Live/DragMessages.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/MapDefinition/Live/DragMessages.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -29,7 +29,7 @@
this.ResourceID = resId;
}
- public string ResourceID { get; private set; }
+ public string ResourceID { get; }
}
internal class LayerDragMessage
@@ -40,9 +40,9 @@
this.LayerName = layerName;
}
- public string GroupName { get; private set; }
+ public string GroupName { get; }
- public string LayerName { get; private set; }
+ public string LayerName { get; }
}
internal class GroupDragMessage
@@ -52,6 +52,6 @@
this.GroupName = groupName;
}
- public string GroupName { get; private set; }
+ public string GroupName { get; }
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapDefinitionEditorCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapDefinitionEditorCtrl.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapDefinitionEditorCtrl.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -46,7 +46,7 @@
class LayerExtentCalculator : ILayerExtentCalculator
{
- private IServerConnection _conn;
+ private readonly IServerConnection _conn;
public LayerExtentCalculator(IServerConnection conn)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapLayersSectionCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapLayersSectionCtrl.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapLayersSectionCtrl.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -323,7 +323,7 @@
internal class BaseLayerItemDesigner
{
- private BaseLayerItem _layer;
+ private readonly BaseLayerItem _layer;
public BaseLayerItemDesigner(BaseLayerItem layer)
{
@@ -331,7 +331,7 @@
}
[Browsable(false)]
- internal BaseLayerItem Item { get { return _layer; } }
+ internal BaseLayerItem Item => _layer;
[LocalizedDisplayName("MdfEditorSelectable")]
public bool Selectable
@@ -357,7 +357,7 @@
internal class BaseGroupItemDesigner
{
- private BaseLayerGroupItem _group;
+ private readonly BaseLayerGroupItem _group;
public BaseGroupItemDesigner(BaseLayerGroupItem group)
{
@@ -365,7 +365,7 @@
}
[Browsable(false)]
- internal BaseLayerGroupItem Item { get { return _group; } }
+ internal BaseLayerGroupItem Item => _group;
[LocalizedDisplayName("MdfEditorVisible")]
public bool Visible
@@ -391,7 +391,7 @@
internal class LayerItemDesigner
{
- private LayerItem _layer;
+ private readonly LayerItem _layer;
public LayerItemDesigner(LayerItem layer)
{
@@ -399,7 +399,7 @@
}
[Browsable(false)]
- internal LayerItem Item { get { return _layer; } }
+ internal LayerItem Item => _layer;
[LocalizedDisplayName("MdfEditorSelectable")]
public bool Selectable
@@ -432,7 +432,7 @@
internal class GroupItemDesigner
{
- private GroupItem _group;
+ private readonly GroupItem _group;
public GroupItemDesigner(GroupItem group)
{
@@ -440,7 +440,7 @@
}
[Browsable(false)]
- internal GroupItem Item { get { return _group; } }
+ internal GroupItem Item => _group;
[LocalizedDisplayName("MdfEditorVisible")]
public bool Visible
Modified: trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapTreeModels.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapTreeModels.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/MapDefinition/MapTreeModels.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -33,7 +33,7 @@
{
internal abstract class TreeItem<T>
{
- public TreeItem(string text, Image icon, T item)
+ protected TreeItem(string text, Image icon, T item)
{
this.Text = text;
this.Icon = icon;
@@ -118,7 +118,7 @@
public BaseLayerGroupItem(IBaseMapGroup group)
: base(group.Name, Properties.Resources.folder_horizontal, group)
{
- group.PropertyChanged += WeakEventHandler.Wrap<PropertyChangedEventHandler>(OnPropertyChanged, (eh) => group.PropertyChanged -= eh); ;
+ group.PropertyChanged += WeakEventHandler.Wrap<PropertyChangedEventHandler>(OnPropertyChanged, (eh) => group.PropertyChanged -= eh);
}
private void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
Modified: trunk/Tools/Maestro/Maestro.Editors/Preview/LocalMapPreviewer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Preview/LocalMapPreviewer.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Preview/LocalMapPreviewer.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -38,8 +38,8 @@
/// </summary>
public class LocalMapPreviewer : IResourcePreviewer
{
- private IResourcePreviewer _inner;
- private IUrlLauncherService _launcher;
+ private readonly IResourcePreviewer _inner;
+ private readonly IUrlLauncherService _launcher;
/// <summary>
/// Initializes a new instance of the LocalMapPreviewer class
Modified: trunk/Tools/Maestro/Maestro.Editors/Preview/MapPreviewDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Preview/MapPreviewDialog.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Preview/MapPreviewDialog.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -32,16 +32,16 @@
{
internal partial class MapPreviewDialog : Form
{
- private RuntimeMap _map;
- private IUrlLauncherService _launcher;
- private IServerConnection _conn;
+ private readonly RuntimeMap _map;
+ private readonly IUrlLauncherService _launcher;
+ private readonly IServerConnection _conn;
public MapPreviewDialog(RuntimeMap map, IUrlLauncherService urlLauncher, string resourceId)
{
InitializeComponent();
_map = map;
if (!string.IsNullOrEmpty(resourceId))
- this.Text += " - " + resourceId;
+ this.Text += $" - {resourceId}"; //NOXLATE
txtCoordinateSystem.Text = map.CoordinateSystem;
numZoomToScale.Minimum = 1;
Modified: trunk/Tools/Maestro/Maestro.Editors/Preview/ResourcePreviewFactory.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Preview/ResourcePreviewFactory.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/Preview/ResourcePreviewFactory.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -32,7 +32,7 @@
/// </summary>
public static class ResourcePreviewerFactory
{
- private static Dictionary<string, IResourcePreviewer> _previewers = new Dictionary<string, IResourcePreviewer>();
+ private static readonly Dictionary<string, IResourcePreviewer> _previewers = new Dictionary<string, IResourcePreviewer>();
/// <summary>
/// Registers the given <see cref="T:Maestro.Editors.Preview.IResourcePreviewer"/> for a given connection provider
Modified: trunk/Tools/Maestro/Maestro.Editors/PrintLayout/LogoDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/PrintLayout/LogoDialog.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/PrintLayout/LogoDialog.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -37,7 +37,7 @@
InitializeComponent();
}
- private IServerConnection _conn;
+ private readonly IServerConnection _conn;
public LogoDialog(IServerConnection conn)
: this()
Modified: trunk/Tools/Maestro/Maestro.Editors/RepositoryHandle.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/RepositoryHandle.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/RepositoryHandle.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -34,12 +34,12 @@
/// <summary>
/// Gets the resource id.
/// </summary>
- public ResourceIdentifier ResourceId { get; private set; }
+ public ResourceIdentifier ResourceId { get; }
/// <summary>
/// Gets the connection.
/// </summary>
- public IServerConnection Connection { get; private set; }
+ public IServerConnection Connection { get; }
/// <summary>
/// Initializes a new instance of the <see cref="RepositoryHandle"/> class.
Modified: trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/AdvancedSettingsCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/AdvancedSettingsCtrl.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/AdvancedSettingsCtrl.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -59,11 +59,11 @@
symGrowControl.Items = SymbolField.GetItems<GrowControl>();
- symGrowControl.Bind(_rbox, "GrowControl");
- symHeight.Bind(_rbox, "SizeY");
- symWidth.Bind(_rbox, "SizeX");
- symXCoord.Bind(_rbox, "PositionX");
- symYCoord.Bind(_rbox, "PositionY");
+ symGrowControl.Bind(_rbox, nameof(_rbox.GrowControl));
+ symHeight.Bind(_rbox, nameof(_rbox.SizeY));
+ symWidth.Bind(_rbox, nameof(_rbox.SizeX));
+ symXCoord.Bind(_rbox, nameof(_rbox.PositionX));
+ symYCoord.Bind(_rbox, nameof(_rbox.PositionY));
}
finally
{
@@ -83,14 +83,8 @@
_sym.ResizeBox = null;
}
- private void OnContentChanged(object sender, EventArgs e)
- {
- OnResourceChanged();
- }
+ private void OnContentChanged(object sender, EventArgs e) => OnResourceChanged();
- private void OnRequestBrowse(SymbolField sender)
- {
- ParameterSelector.ShowParameterSelector(_sym.ParameterDefinition.Parameter, sender);
- }
+ private void OnRequestBrowse(SymbolField sender) => ParameterSelector.ShowParameterSelector(_sym.ParameterDefinition.Parameter, sender);
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/GraphicsEditors/ImageDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/GraphicsEditors/ImageDialog.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/GraphicsEditors/ImageDialog.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -35,12 +35,12 @@
{
internal partial class ImageDialog : Form
{
- private ISimpleSymbolDefinition _ssd;
+ private readonly ISimpleSymbolDefinition _ssd;
private IImageGraphic _image;
private IImageReference _imageRef;
private IInlineImage _imageInline;
private EditorBindableCollapsiblePanel _ed;
- private IServerConnection _conn;
+ private readonly IServerConnection _conn;
private bool _init = false;
@@ -66,7 +66,7 @@
}
if (_imageRef == null)
- _imageRef = ssd.CreateImageReference("", "");
+ _imageRef = ssd.CreateImageReference(string.Empty, string.Empty);
else
rdResourceRef.Checked = true;
@@ -94,12 +94,12 @@
try
{
_init = true;
- symAngle.Bind(_image, "Angle");
- symPositionX.Bind(_image, "PositionX");
- symPositionY.Bind(_image, "PositionY");
- symSizeScalable.Bind(_image, "SizeScalable");
- symSizeX.Bind(_image, "SizeX");
- symSizeY.Bind(_image, "SizeY");
+ symAngle.Bind(_image, nameof(_image.Angle));
+ symPositionX.Bind(_image, nameof(_image.PositionX));
+ symPositionY.Bind(_image, nameof(_image.PositionY));
+ symSizeScalable.Bind(_image, nameof(_image.SizeScalable));
+ symSizeX.Bind(_image, nameof(_image.SizeX));
+ symSizeY.Bind(_image, nameof(_image.SizeY));
}
finally
{
@@ -131,15 +131,9 @@
}
}
- private void txtResourceId_TextChanged(object sender, EventArgs e)
- {
- _imageRef.ResourceId = txtResourceId.Text;
- }
+ private void txtResourceId_TextChanged(object sender, EventArgs e) => _imageRef.ResourceId = txtResourceId.Text;
- private void txtResData_TextChanged(object sender, EventArgs e)
- {
- _imageRef.LibraryItemName = txtResData.Text;
- }
+ private void txtResData_TextChanged(object sender, EventArgs e) => _imageRef.LibraryItemName = txtResData.Text;
private void txtImageBase64_TextChanged(object sender, EventArgs e)
{
@@ -168,17 +162,14 @@
using (var ms = new MemoryStream(content))
{
Image img = Image.FromStream(ms);
- symSizeX.Content = "'" + PxToMM(img.Width, 96).ToString(System.Globalization.CultureInfo.InvariantCulture) + "'"; //NOXLATE
- symSizeY.Content = "'" + PxToMM(img.Height, 96).ToString(System.Globalization.CultureInfo.InvariantCulture) + "'"; //NOXLATE
+ symSizeX.Content = $"'{PxToMM(img.Width, 96).ToString(System.Globalization.CultureInfo.InvariantCulture)}'"; //NOXLATE
+ symSizeY.Content = $"'{PxToMM(img.Height, 96).ToString(System.Globalization.CultureInfo.InvariantCulture)}'"; //NOXLATE
}
}
}
}
- private static double PxToMM(int px, int dpi)
- {
- return (px * 25.4) / dpi;
- }
+ private static double PxToMM(int px, int dpi) => (px * 25.4) / dpi;
private void lnkPreview_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
@@ -195,10 +186,7 @@
}
}
- private void btnClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
+ private void btnClose_Click(object sender, EventArgs e) => this.Close();
private void btnBrowse_Click(object sender, EventArgs e)
{
@@ -234,7 +222,7 @@
var result = GenericItemSelectionDialog.SelectItem(null, null, items.ToArray());
if (result != null)
{
- txtResData.Text = "'" + result + "'"; //To avoid Expression Engine invocation
+ txtResData.Text = $"'{result}'"; //To avoid Expression Engine invocation
}
}
}
Modified: trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/GraphicsEditors/PathDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/GraphicsEditors/PathDialog.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/GraphicsEditors/PathDialog.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -31,7 +31,7 @@
internal partial class PathDialog : Form
{
private ISimpleSymbolDefinition _sym;
- private EditorBindableCollapsiblePanel _ed;
+ private readonly EditorBindableCollapsiblePanel _ed;
private IPathGraphic _path;
public PathDialog(EditorBindableCollapsiblePanel parent, ISimpleSymbolDefinition sym, IPathGraphic path)
@@ -50,20 +50,20 @@
{
_init = true;
- TextBoxBinder.BindText(txtGeometry, _path, "Geometry");
- symFillColor.Bind(_path, "FillColor");
- symLineCap.Bind(_path, "LineCap");
- symLineColor.Bind(_path, "LineColor");
- symLineJoin.Bind(_path, "LineJoin");
- symLineMiterLimit.Bind(_path, "LineMiterLimit");
- symLineWeight.Bind(_path, "LineWeight");
- symLineWeightScalable.Bind(_path, "LineWeightScalable");
+ TextBoxBinder.BindText(txtGeometry, _path, nameof(_path.Geometry));
+ symFillColor.Bind(_path, nameof(_path.FillColor));
+ symLineCap.Bind(_path, nameof(_path.LineCap));
+ symLineColor.Bind(_path, nameof(_path.LineColor));
+ symLineJoin.Bind(_path, nameof(_path.LineJoin));
+ symLineMiterLimit.Bind(_path, nameof(_path.LineMiterLimit));
+ symLineWeight.Bind(_path, nameof(_path.LineWeight));
+ symLineWeightScalable.Bind(_path, nameof(_path.LineWeightScalable));
IPathGraphic2 path2 = _path as IPathGraphic2;
if (path2 != null)
{
- symScaleX.Bind(path2, "ScaleX");
- symScaleY.Bind(path2, "ScaleY");
+ symScaleX.Bind(path2, nameof(path2.ScaleX));
+ symScaleY.Bind(path2, nameof(path2.ScaleY));
}
else
{
@@ -76,24 +76,12 @@
}
}
- private void btnClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
+ private void btnClose_Click(object sender, EventArgs e) => this.Close();
- private void OnContentChanged(object sender, EventArgs e)
- {
- _ed.RaiseResourceChanged();
- }
+ private void OnContentChanged(object sender, EventArgs e) => _ed.RaiseResourceChanged();
- private void OnRequestBrowse(SymbolField sender)
- {
- ParameterSelector.ShowParameterSelector(_sym.ParameterDefinition.Parameter, sender);
- }
+ private void OnRequestBrowse(SymbolField sender) => ParameterSelector.ShowParameterSelector(_sym.ParameterDefinition.Parameter, sender);
- private void txtGeometry_TextChanged(object sender, EventArgs e)
- {
- _ed.RaiseResourceChanged();
- }
+ private void txtGeometry_TextChanged(object sender, EventArgs e) => _ed.RaiseResourceChanged();
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/GraphicsEditors/TextDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/GraphicsEditors/TextDialog.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/GraphicsEditors/TextDialog.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -32,7 +32,7 @@
{
private ISimpleSymbolDefinition _sym;
private EditorBindableCollapsiblePanel _ed;
- private ITextGraphic _text;
+ private readonly ITextGraphic _text;
private ITextFrame _frame;
public TextDialog(EditorBindableCollapsiblePanel parent, ISimpleSymbolDefinition sym, ITextGraphic text)
@@ -59,36 +59,36 @@
if (_frame == null)
_frame = _sym.CreateFrame();
- TextBoxBinder.BindText(txtContent, _text, "Content");
+ TextBoxBinder.BindText(txtContent, _text, nameof(_text.Content));
- symAlignmentHorizontal.Bind(_text, "HorizontalAlignment");
- symAlignmentJustification.Bind(_text, "Justification");
- symAlignmentVertical.Bind(_text, "VerticalAlignment");
- symAngle.Bind(_text, "Angle");
- symFontBold.Bind(_text, "Bold");
- symFontFamily.Bind(_text, "FontName");
- symFontItalic.Bind(_text, "Italic");
- symFontUnderlined.Bind(_text, "Underlined");
- symGhostColor.Bind(_text, "GhostColor");
- symHeight.Bind(_text, "Height");
- symHeightScalable.Bind(_text, "HeightScalable");
- symLineSpacing.Bind(_text, "LineSpacing");
- symPositionX.Bind(_text, "PositionX");
- symPositionY.Bind(_text, "PositionY");
- symTextColor.Bind(_text, "TextColor");
+ symAlignmentHorizontal.Bind(_text, nameof(_text.HorizontalAlignment));
+ symAlignmentJustification.Bind(_text, nameof(_text.Justification));
+ symAlignmentVertical.Bind(_text, nameof(_text.VerticalAlignment));
+ symAngle.Bind(_text, nameof(_text.Angle));
+ symFontBold.Bind(_text, nameof(_text.Bold));
+ symFontFamily.Bind(_text, nameof(_text.FontName));
+ symFontItalic.Bind(_text, nameof(_text.Italic));
+ symFontUnderlined.Bind(_text, nameof(_text.Underlined));
+ symGhostColor.Bind(_text, nameof(_text.GhostColor));
+ symHeight.Bind(_text, nameof(_text.Height));
+ symHeightScalable.Bind(_text, nameof(_text.HeightScalable));
+ symLineSpacing.Bind(_text, nameof(_text.LineSpacing));
+ symPositionX.Bind(_text, nameof(_text.PositionX));
+ symPositionY.Bind(_text, nameof(_text.PositionY));
+ symTextColor.Bind(_text, nameof(_text.TextColor));
- symFillColor.Bind(_frame, "FillColor");
- symLineColor.Bind(_frame, "LineColor");
- symOffsetX.Bind(_frame, "OffsetX");
- symOffsetY.Bind(_frame, "OffsetY");
+ symFillColor.Bind(_frame, nameof(_frame.FillColor));
+ symLineColor.Bind(_frame, nameof(_frame.LineColor));
+ symOffsetX.Bind(_frame, nameof(_frame.OffsetX));
+ symOffsetY.Bind(_frame, nameof(_frame.OffsetY));
var text2 = _text as ITextGraphic2;
if (text2 != null)
{
- symOverlined.Bind(text2, "Overlined");
- symObliqueAngle.Bind(text2, "ObliqueAngle");
- symTrackSpacing.Bind(text2, "TrackSpacing");
- symMarkup.Bind(text2, "Markup");
+ symOverlined.Bind(text2, nameof(text2.Overlined));
+ symObliqueAngle.Bind(text2, nameof(text2.ObliqueAngle));
+ symTrackSpacing.Bind(text2, nameof(text2.TrackSpacing));
+ symMarkup.Bind(text2, nameof(text2.Markup));
}
else
{
@@ -108,10 +108,7 @@
_ed.RaiseResourceChanged();
}
- private void OnRequestBrowse(SymbolField sender)
- {
- ParameterSelector.ShowParameterSelector(_sym.ParameterDefinition.Parameter, sender);
- }
+ private void OnRequestBrowse(SymbolField sender) => ParameterSelector.ShowParameterSelector(_sym.ParameterDefinition.Parameter, sender);
private void chkTextFrame_CheckedChanged(object sender, EventArgs e)
{
@@ -133,10 +130,7 @@
txtContent.Text = content;
}
- private void btnClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
+ private void btnClose_Click(object sender, EventArgs e) => this.Close();
private void lnkSelectFont_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
@@ -144,7 +138,7 @@
if (fd.ShowDialog() == DialogResult.OK)
{
var font = fd.Font;
- _text.FontName = "'" + font.Name + "'";
+ _text.FontName = $"'{font.Name}'"; //NOXLATE
if (font.Bold)
_text.Bold = font.Bold.ToString();
if (font.Italic)
Modified: trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/SimpleSymbolDefinitionDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/SimpleSymbolDefinitionDialog.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/SimpleSymbolDefinitionDialog.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -30,7 +30,7 @@
/// </summary>
public partial class SimpleSymbolDefinitionDialog : Form
{
- private IEditorService _edSvc;
+ private readonly IEditorService _edSvc;
/// <summary>
/// Constructor
Modified: trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/SimpleSymbolReferenceCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/SimpleSymbolReferenceCtrl.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/SimpleSymbolReferenceCtrl.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -34,7 +34,7 @@
internal partial class SimpleSymbolReferenceCtrl : UserControl
{
private IEditorService _edSvc;
- private IResourceIdReference _symRef;
+ private readonly IResourceIdReference _symRef;
private bool _init = false;
Modified: trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/SymbolParameterDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/SymbolParameterDialog.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/SymbolParameterDialog.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -28,7 +28,7 @@
{
internal partial class SymbolParameterDialog : Form
{
- private IParameter _p;
+ private readonly IParameter _p;
private bool _init = false;
public SymbolParameterDialog(Version ver, IParameter p)
@@ -62,10 +62,7 @@
}
}
- private void btnClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
+ private void btnClose_Click(object sender, EventArgs e) => this.Close();
private void txtIdentifier_TextChanged(object sender, EventArgs e)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/UsageContextsCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/UsageContextsCtrl.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/SymbolDefinition/UsageContextsCtrl.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -98,31 +98,31 @@
symLineVertexJoin.Items = SymbolField.GetItems<VertexJoin>();
symPointAngleControl.Items = SymbolField.GetItems<AngleControl>();
- symAreaAngle.Bind(_au, "Angle");
- symAreaAngleControl.Bind(_au, "AngleControl");
- symAreaBufferWidth.Bind(_au, "BufferWidth");
- symAreaClippingControl.Bind(_au, "ClippingControl");
- symAreaOriginControl.Bind(_au, "OriginControl");
- symAreaOriginX.Bind(_au, "OriginX");
- symAreaOriginY.Bind(_au, "OriginY");
- symAreaRepeatX.Bind(_au, "RepeatX");
- symAreaRepeatY.Bind(_au, "RepeatY");
+ symAreaAngle.Bind(_au, nameof(_au.Angle));
+ symAreaAngleControl.Bind(_au, nameof(_au.AngleControl));
+ symAreaBufferWidth.Bind(_au, nameof(_au.BufferWidth));
+ symAreaClippingControl.Bind(_au, nameof(_au.ClippingControl));
+ symAreaOriginControl.Bind(_au, nameof(_au.OriginControl));
+ symAreaOriginX.Bind(_au, nameof(_au.OriginX));
+ symAreaOriginY.Bind(_au, nameof(_au.OriginY));
+ symAreaRepeatX.Bind(_au, nameof(_au.RepeatX));
+ symAreaRepeatY.Bind(_au, nameof(_au.RepeatY));
- symLineAngle.Bind(_lu, "Angle");
- symLineAngleControl.Bind(_lu, "AngleControl");
- symLineEndOffset.Bind(_lu, "EndOffset");
- symLineRepeat.Bind(_lu, "Repeat");
- symLineStartOffset.Bind(_lu, "StartOffset");
- symLineUnitsControl.Bind(_lu, "UnitsControl");
- symLineVertexAngleLimit.Bind(_lu, "VertexAngleLimit");
- symLineVertexControl.Bind(_lu, "VertexControl");
- symLineVertexJoin.Bind(_lu, "VertexJoin");
- symLineVertexMiterLimit.Bind(_lu, "VertexMiterLimit");
+ symLineAngle.Bind(_lu, nameof(_lu.Angle));
+ symLineAngleControl.Bind(_lu, nameof(_lu.AngleControl));
+ symLineEndOffset.Bind(_lu, nameof(_lu.EndOffset));
+ symLineRepeat.Bind(_lu, nameof(_lu.Repeat));
+ symLineStartOffset.Bind(_lu, nameof(_lu.StartOffset));
+ symLineUnitsControl.Bind(_lu, nameof(_lu.UnitsControl));
+ symLineVertexAngleLimit.Bind(_lu, nameof(_lu.VertexAngleLimit));
+ symLineVertexControl.Bind(_lu, nameof(_lu.VertexControl));
+ symLineVertexJoin.Bind(_lu, nameof(_lu.VertexJoin));
+ symLineVertexMiterLimit.Bind(_lu, nameof(_lu.VertexMiterLimit));
- symPointAngle.Bind(_pu, "Angle");
- symPointAngleControl.Bind(_pu, "AngleControl");
- symPointOriginOffsetX.Bind(_pu, "OriginOffsetX");
- symPointOriginOffsetY.Bind(_pu, "OriginOffsetY");
+ symPointAngle.Bind(_pu, nameof(_pu.Angle));
+ symPointAngleControl.Bind(_pu, nameof(_pu.AngleControl));
+ symPointOriginOffsetX.Bind(_pu, nameof(_pu.OriginOffsetX));
+ symPointOriginOffsetY.Bind(_pu, nameof(_pu.OriginOffsetY));
}
finally
{
@@ -157,14 +157,8 @@
_sym.AreaUsage = (chkArea.Checked) ? _au : null;
}
- private void OnRequestBrowse(SymbolField sender)
- {
- ParameterSelector.ShowParameterSelector(_sym.ParameterDefinition.Parameter, sender);
- }
+ private void OnRequestBrowse(SymbolField sender) => ParameterSelector.ShowParameterSelector(_sym.ParameterDefinition.Parameter, sender);
- private void OnContentChanged(object sender, EventArgs e)
- {
- OnResourceChanged();
- }
+ private void OnContentChanged(object sender, EventArgs e) => OnResourceChanged();
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.Editors/TileSetDefinition/GroupPropertiesCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/TileSetDefinition/GroupPropertiesCtrl.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/TileSetDefinition/GroupPropertiesCtrl.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -40,8 +40,8 @@
public event EventHandler GroupChanged;
- private ITileSetDefinition _mdf;
- private IMapLegendElementBase _el;
+ private readonly ITileSetDefinition _mdf;
+ private readonly IMapLegendElementBase _el;
private bool _init = false;
Modified: trunk/Tools/Maestro/Maestro.Editors/TileSetDefinition/LayerStructureCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/TileSetDefinition/LayerStructureCtrl.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/TileSetDefinition/LayerStructureCtrl.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -501,7 +501,6 @@
//var item = new GroupPropertiesCtrl(_tsd, group.Tag);
//item.GroupChanged += (s, evt) => { OnResourceChanged(); };
//item.Dock = DockStyle.Fill;
- _activeLayer = null;
AddBaseGroupControl(group);
}
@@ -514,7 +513,6 @@
//var item = new LayerPropertiesCtrl(layer.Tag, _edSvc.ResourceService, _edSvc);
//item.LayerChanged += (s, evt) => { OnResourceChanged(); };
//item.Dock = DockStyle.Fill;
- _activeLayer = null;
AddBaseLayerControl(layer);
}
@@ -631,11 +629,8 @@
btnRemoveBaseLayerGroup.Enabled = bAllBaseGroups;
AddMultiControl(nodes);
- _activeLayer = null;
}
-
- private IMapLayer _activeLayer;
-
+
private static bool AllLayers(System.Collections.ObjectModel.ReadOnlyCollection<TreeNodeAdv> nodes)
{
foreach (var node in nodes)
Modified: trunk/Tools/Maestro/Maestro.Editors/TileSetDefinition/Providers/GenericProviderCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/TileSetDefinition/Providers/GenericProviderCtrl.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/TileSetDefinition/Providers/GenericProviderCtrl.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -41,8 +41,8 @@
InitializeComponent();
}
- private ITileSetDefinition _tsd;
- private TileProvider _provider;
+ private readonly ITileSetDefinition _tsd;
+ private readonly TileProvider _provider;
private Action _resourceChangeHandler;
public GenericProviderCtrl(TileProvider provider, ITileSetDefinition tsd, Action resourceChangeHandler)
@@ -87,7 +87,7 @@
class TileSetParameter
{
- private Action<TileSetParameter> _valueChangeListener;
+ private readonly Action<TileSetParameter> _valueChangeListener;
public TileSetParameter(string name, string value, Action<TileSetParameter> valueChangeListener)
{
@@ -96,7 +96,7 @@
_valueChangeListener = valueChangeListener;
}
- public string Name { get; private set; }
+ public string Name { get; }
private string _value;
Modified: trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/TilePositionEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/TilePositionEditor.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/TilePositionEditor.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -30,8 +30,8 @@
[ToolboxItem(false)]
internal partial class TilePositionEditor : UserControl
{
- private ITilePosition _pos;
- private IEditorService _edSvc;
+ private readonly ITilePosition _pos;
+ private readonly IEditorService _edSvc;
private bool _init = false;
Modified: trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkInstanceEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkInstanceEditor.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/WatermarkInstanceEditor.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -37,7 +37,7 @@
private IWatermark _watermark;
private IEditorService _edSvc;
- private IWatermarkAppearance _ovAppearance;
+ private readonly IWatermarkAppearance _ovAppearance;
private ITilePosition _ovTilePosition;
private IXYPosition _ovXyPosition;
Modified: trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/XYPositionEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/XYPositionEditor.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/WatermarkDefinition/XYPositionEditor.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -30,8 +30,8 @@
[ToolboxItem(false)]
internal partial class XYPositionEditor : UserControl
{
- private IXYPosition _pos;
- private IEditorService _edSvc;
+ private readonly IXYPosition _pos;
+ private readonly IEditorService _edSvc;
private bool _init = false;
public XYPositionEditor(IXYPosition pos, IEditorService service)
Modified: trunk/Tools/Maestro/Maestro.Editors/WebLayout/MenuModel.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/WebLayout/MenuModel.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Editors/WebLayout/MenuModel.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -45,16 +45,9 @@
this.Tag = item;
}
- public T Tag
- {
- get;
- private set;
- }
+ public T Tag { get; }
- public override IUIItem Item
- {
- get { return this.Tag; }
- }
+ public override IUIItem Item => this.Tag;
}
internal class CommandItem : ItemBase<ICommandItem>
@@ -68,20 +61,11 @@
_icon = icon;
}
- public override string Label
- {
- get
- {
- return this.Tag.Command;
- }
- }
+ public override string Label => this.Tag.Command;
- private Image _icon;
+ private readonly Image _icon;
- public override Image Icon
- {
- get { return _icon; }
- }
+ public override Image Icon => _icon;
}
internal class SeparatorItem : ItemBase<ISeparatorItem>
@@ -90,15 +74,9 @@
: base(sep)
{ }
- public override string Label
- {
- get { return this.Tag.Function.ToString(); }
- }
+ public override string Label => this.Tag.Function.ToString();
- public override Image Icon
- {
- get { return Properties.Resources.ui_splitter_horizontal; }
- }
+ public override Image Icon => Properties.Resources.ui_splitter_horizontal;
}
internal class FlyoutItem : ItemBase<IFlyoutItem>
@@ -107,20 +85,11 @@
: base(fly)
{ }
- public override string Label
- {
- get { return this.Tag.Label; }
- }
+ public override string Label => this.Tag.Label;
- public override Image Icon
- {
- get { return Properties.Resources.ui_menu; }
- }
+ public override Image Icon => Properties.Resources.ui_menu;
- public IEnumerable<IUIItem> SubItem
- {
- get { return this.Tag.Items; }
- }
+ public IEnumerable<IUIItem> SubItem => this.Tag.Items;
}
internal class MenuTreeModel : ITreeModel
@@ -182,17 +151,9 @@
}
}
- public bool IsLeaf(TreePath treePath)
- {
- return (treePath.LastNode as FlyoutItem) == null;
- }
+ public bool IsLeaf(TreePath treePath) => (treePath.LastNode as FlyoutItem) == null;
- internal void Refresh()
- {
- var handler = this.StructureChanged;
- if (handler != null)
- handler(this, new TreePathEventArgs(TreePath.Empty));
- }
+ internal void Refresh() => this.StructureChanged?.Invoke(this, new TreePathEventArgs(TreePath.Empty));
public event EventHandler<TreeModelEventArgs> NodesChanged;
Modified: trunk/Tools/Maestro/Maestro.LiveMapEditor/MapSettingsDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.LiveMapEditor/MapSettingsDialog.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.LiveMapEditor/MapSettingsDialog.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -35,9 +35,9 @@
{
public partial class MapSettingsDialog : Form
{
- private IMapDefinition _mdf;
+ private readonly IMapDefinition _mdf;
private IServerConnection _conn;
- private IMapViewer _viewer;
+ private readonly IMapViewer _viewer;
public MapSettingsDialog(IServerConnection conn, IMapDefinition mdf, IMapViewer viewer)
{
Modified: trunk/Tools/Maestro/Maestro.Login/LoginDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Login/LoginDialog.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Login/LoginDialog.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -35,7 +35,7 @@
public partial class LoginDialog : Form
{
private int _selectedIndex;
- private ILoginCtrl[] _controls;
+ private readonly ILoginCtrl[] _controls;
private IServerConnection _conn;
private PreferredSiteList _siteList;
@@ -43,8 +43,8 @@
private HttpLoginCtrl _http;
private LocalNativeLoginCtrl _localNative;
private LocalLoginCtrl _local;
- private LocalNativeStubCtrl _localNativeStub;
- private LocalStubCtrl _localStub;
+ private readonly LocalNativeStubCtrl _localNativeStub;
+ private readonly LocalStubCtrl _localStub;
/// <summary>
/// Initializes a new instance of the <see cref="LoginDialog"/> class.
Modified: trunk/Tools/Maestro/Maestro.Login/PreferedSite.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Login/PreferedSite.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Login/PreferedSite.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -61,7 +61,7 @@
/// Gets or sets the GUI language.
/// </summary>
/// <value>The GUI language.</value>
- [System.Xml.Serialization.XmlAttribute()]
+ [System.Xml.Serialization.XmlAttribute]
public string GUILanguage
{
get { return m_guiLanguage; }
@@ -72,7 +72,7 @@
/// Gets or sets a value indicating whether [use fusion preview].
/// </summary>
/// <value><c>true</c> if [use fusion preview]; otherwise, <c>false</c>.</value>
- [System.Xml.Serialization.XmlAttribute()]
+ [System.Xml.Serialization.XmlAttribute]
public bool UseFusionPreview
{
get { return m_useFusionPreview; }
@@ -83,7 +83,7 @@
/// Gets or sets the system browser.
/// </summary>
/// <value>The system browser.</value>
- [System.Xml.Serialization.XmlAttribute()]
+ [System.Xml.Serialization.XmlAttribute]
public string SystemBrowser
{
get
@@ -95,7 +95,7 @@
m_systemBrowser = string.Empty;
//Linux, assume firefox
else
- m_systemBrowser = "firefox";
+ m_systemBrowser = "firefox"; //NOXLATE
}
return m_systemBrowser;
@@ -107,7 +107,7 @@
/// Gets or sets the prefered site.
/// </summary>
/// <value>The prefered site.</value>
- [System.Xml.Serialization.XmlAttribute()]
+ [System.Xml.Serialization.XmlAttribute]
public int PreferedSite
{
get { return m_initialSite; }
@@ -118,7 +118,7 @@
/// Gets or sets a value indicating whether [auto connect].
/// </summary>
/// <value><c>true</c> if [auto connect]; otherwise, <c>false</c>.</value>
- [System.Xml.Serialization.XmlAttribute()]
+ [System.Xml.Serialization.XmlAttribute]
public bool AutoConnect
{
get { return m_autoconnect; }
@@ -129,7 +129,7 @@
/// Gets or sets a value indicating whether [maximized window].
/// </summary>
/// <value><c>true</c> if [maximized window]; otherwise, <c>false</c>.</value>
- [System.Xml.Serialization.XmlAttribute()]
+ [System.Xml.Serialization.XmlAttribute]
public bool MaximizedWindow
{
get { return m_maximizedWindow; }
@@ -140,7 +140,7 @@
/// Gets or sets the window left.
/// </summary>
/// <value>The window left.</value>
- [System.Xml.Serialization.XmlAttribute()]
+ [System.Xml.Serialization.XmlAttribute]
public int WindowLeft
{
get { return m_windowLeft; }
@@ -151,7 +151,7 @@
/// Gets or sets the window top.
/// </summary>
/// <value>The window top.</value>
- [System.Xml.Serialization.XmlAttribute()]
+ [System.Xml.Serialization.XmlAttribute]
public int WindowTop
{
get { return m_windowTop; }
@@ -162,7 +162,7 @@
/// Gets or sets the width of the window.
/// </summary>
/// <value>The width of the window.</value>
- [System.Xml.Serialization.XmlAttribute()]
+ [System.Xml.Serialization.XmlAttribute]
public int WindowWidth
{
get { return m_windowWidth; }
@@ -173,7 +173,7 @@
/// Gets or sets the height of the window.
/// </summary>
/// <value>The height of the window.</value>
- [System.Xml.Serialization.XmlAttribute()]
+ [System.Xml.Serialization.XmlAttribute]
public int WindowHeight
{
get { return m_windowHeight; }
@@ -368,7 +368,7 @@
/// Gets or sets the unscrambled password.
/// </summary>
/// <value>The unscrambled password.</value>
- [System.Xml.Serialization.XmlIgnore()]
+ [System.Xml.Serialization.XmlIgnore]
public string UnscrambledPassword
{
get { return System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(m_scrambledPassword == null ? string.Empty : m_scrambledPassword)); }
@@ -381,9 +381,6 @@
/// <returns>
/// A <see cref="System.String"/> that represents this instance.
/// </returns>
- public override string ToString()
- {
- return m_siteURL;
- }
+ public override string ToString() => m_siteURL;
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.Login/WaitCursor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Login/WaitCursor.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Login/WaitCursor.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -32,7 +32,7 @@
: IDisposable
{
private Form m_owner = null;
- private Cursor m_oldcursor;
+ private readonly Cursor m_oldcursor;
/// <summary>
/// Initializes a new instance of the <see cref="WaitCursor"/> class.
Modified: trunk/Tools/Maestro/Maestro.MapViewer/CoreTypes.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.MapViewer/CoreTypes.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.MapViewer/CoreTypes.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -85,17 +85,17 @@
/// <summary>
/// Gets the X coordinate
/// </summary>
- public double X { get; private set; }
+ public double X { get; }
/// <summary>
/// Gets the Y coordinate
/// </summary>
- public double Y { get; private set; }
+ public double Y { get; }
/// <summary>
/// Gets the view scale
/// </summary>
- public double Scale { get; private set; }
+ public double Scale { get; }
}
/// <summary>
@@ -212,16 +212,16 @@
/// <summary>
/// Gets the format.
/// </summary>
- public string Format { get; private set; }
+ public string Format { get; }
/// <summary>
/// Gets the behavior.
/// </summary>
- public int Behavior { get; private set; }
+ public int Behavior { get; }
/// <summary>
/// Gets the color.
/// </summary>
- public Color Color { get; private set; }
+ public Color Color { get; }
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.MapViewer/DefaultToolbar.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.MapViewer/DefaultToolbar.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.MapViewer/DefaultToolbar.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -166,9 +166,9 @@
}
}
- internal ToolStripButton Loading { get; private set; }
+ internal ToolStripButton Loading { get; }
- internal ToolStripButton ZoomIn { get; private set; }
+ internal ToolStripButton ZoomIn { get; }
private void OnZoomIn(object sender, EventArgs e)
{
@@ -178,7 +178,7 @@
_viewer.ActiveTool = MapActiveTool.ZoomIn;
}
- internal ToolStripButton ZoomOut { get; private set; }
+ internal ToolStripButton ZoomOut { get; }
private void OnZoomOut(object sender, EventArgs e)
{
@@ -198,7 +198,7 @@
}
}
- internal ToolStripButton ZoomExtents { get; private set; }
+ internal ToolStripButton ZoomExtents { get; }
private void OnZoomExtents(object sender, EventArgs e)
{
@@ -208,7 +208,7 @@
_viewer.InitialMapView();
}
- internal ToolStripButton SelectTool { get; private set; }
+ internal ToolStripButton SelectTool { get; }
private void OnSelect(object sender, EventArgs e)
{
@@ -218,7 +218,7 @@
_viewer.ActiveTool = MapActiveTool.Select;
}
- internal ToolStripButton Pan { get; private set; }
+ internal ToolStripButton Pan { get; }
private void OnPan(object sender, EventArgs e)
{
@@ -228,7 +228,7 @@
_viewer.ActiveTool = MapActiveTool.Pan;
}
- internal ToolStripButton ClearSelection { get; private set; }
+ internal ToolStripButton ClearSelection { get; }
private void OnClearSelection(object sender, EventArgs e)
{
@@ -238,7 +238,7 @@
_viewer.ClearSelection();
}
- internal ToolStripButton SelectRadius { get; private set; }
+ internal ToolStripButton SelectRadius { get; }
private void OnSelectRadius(object sender, EventArgs e)
{
@@ -251,7 +251,7 @@
});
}
- internal ToolStripButton SelectPolygon { get; private set; }
+ internal ToolStripButton SelectPolygon { get; }
private void OnSelectPolygon(object sender, EventArgs e)
{
Modified: trunk/Tools/Maestro/Maestro.MapViewer/LegendPresenter.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.MapViewer/LegendPresenter.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.MapViewer/LegendPresenter.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -53,9 +53,9 @@
private Image _selectableIcon;
private Image _unselectableIcon;
- private Legend _legend;
+ private readonly Legend _legend;
- private Dictionary<string, LayerNodeMetadata> _layers = new Dictionary<string, LayerNodeMetadata>();
+ private readonly Dictionary<string, LayerNodeMetadata> _layers = new Dictionary<string, LayerNodeMetadata>();
private Dictionary<string, GroupNodeMetadata> _groups = new Dictionary<string, GroupNodeMetadata>();
public LegendControlPresenter(Legend legend, RuntimeMap map)
@@ -1023,7 +1023,7 @@
[DebuggerDisplay("Name = {GroupName}, Label = {LegendLabel}")]
public class GroupNodeMetadata : LegendNodeMetadata
{
- internal RuntimeMapGroup Group { get; private set; }
+ internal RuntimeMapGroup Group { get; }
/// <summary>
/// Gets the associated group
@@ -1082,7 +1082,7 @@
/// <summary>
/// Gets whether this node is a placeholder
/// </summary>
- public bool IsPlaceholder { get; private set; }
+ public bool IsPlaceholder { get; }
/// <summary>
/// Gets the icon for this theme node
@@ -1092,15 +1092,12 @@
/// <summary>
/// Gets the label for this theme node
/// </summary>
- public string Label { get; private set; }
+ public string Label { get; }
/// <summary>
/// Gets the unique id for this node
/// </summary>
- public override string ObjectId
- {
- get { return string.Empty; }
- }
+ public override string ObjectId => string.Empty;
}
/// <summary>
@@ -1278,7 +1275,7 @@
//public Image Icon { get; set; }
- internal RuntimeMapLayer Layer { get; private set; }
+ internal RuntimeMapLayer Layer { get; }
internal bool DrawSelectabilityIcon { get; set; }
@@ -1287,7 +1284,7 @@
/// </summary>
public bool IsSelectable { get; set; }
- internal bool WasInitiallySelectable { get; private set; }
+ internal bool WasInitiallySelectable { get; }
/// <summary>
/// Gets or sets whether the layer is a base (tiled) layer
@@ -1299,7 +1296,7 @@
/// </summary>
public string LayerDefinitionContent { get; set; }
- private Dictionary<ThemeCategory, List<LayerThemeNodeMetadata>> _themeNodes;
+ private readonly Dictionary<ThemeCategory, List<LayerThemeNodeMetadata>> _themeNodes;
/// <summary>
/// Gets the theme nodes for this layer
Modified: trunk/Tools/Maestro/Maestro.Packaging/PackageBuilder.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Packaging/PackageBuilder.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Packaging/PackageBuilder.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -123,7 +123,7 @@
/// <summary>
/// The connection object
/// </summary>
- private IServerConnection m_connection;
+ private readonly IServerConnection m_connection;
/// <summary>
/// Constructs a new package builder instance
@@ -1175,7 +1175,7 @@
header = op.Parameters.GetParameterValue("HEADER"); //NOXLATE
else
header = null;
- string content = op.Parameters.GetParameterValue("CONTENT") == null ? null : op.Parameters.GetParameterValue("CONTENT"); //NOXLATE
+ string content = op.Parameters.GetParameterValue("CONTENT") ?? null; //NOXLATE
resourceList.Add(id, new ResourceItem(id, header, content));
}
Modified: trunk/Tools/Maestro/Maestro.Packaging/UploadPackageResult.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Packaging/UploadPackageResult.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Packaging/UploadPackageResult.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -33,17 +33,17 @@
/// <summary>
/// Gets the successful operations
/// </summary>
- public ICollection<PackageOperation> Successful { get; private set; }
+ public ICollection<PackageOperation> Successful { get; }
/// <summary>
/// Gets the failed operations
/// </summary>
- public Dictionary<PackageOperation, Exception> Failed { get; private set; }
+ public Dictionary<PackageOperation, Exception> Failed { get; }
/// <summary>
/// Gets the operations that were skipped
/// </summary>
- public ICollection<PackageOperation> SkipOperations { get; private set; }
+ public ICollection<PackageOperation> SkipOperations { get; }
/// <summary>
/// Initializes a new instance of the <see cref="UploadPackageResult"/> class.
Modified: trunk/Tools/Maestro/Maestro.Shared.UI/ViewContentManagerBase.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Shared.UI/ViewContentManagerBase.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/Maestro.Shared.UI/ViewContentManagerBase.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -248,7 +248,7 @@
/// <summary>
/// The attached view instance
/// </summary>
- public IViewContent View { get; private set; }
+ public IViewContent View { get; }
}
/// <summary>
Modified: trunk/Tools/Maestro/MaestroFsPreview/MainForm.cs
===================================================================
--- trunk/Tools/Maestro/MaestroFsPreview/MainForm.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/MaestroFsPreview/MainForm.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -44,7 +44,7 @@
localFsPreviewCtrl.Init(edSvc);
}
- private IEditorService _edSvc;
+ private readonly IEditorService _edSvc;
private void btnBrowse_Click(object sender, EventArgs e)
{
Modified: trunk/Tools/Maestro/MgCooker/Progress.cs
===================================================================
--- trunk/Tools/Maestro/MgCooker/Progress.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/MgCooker/Progress.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -29,7 +29,7 @@
{
public partial class Progress : Form
{
- private TilingRunCollection m_bx;
+ private readonly TilingRunCollection m_bx;
private List<TimeSpan> m_tileRuns;
private long m_tileCount;
private DateTime m_lastUpdate;
@@ -86,12 +86,7 @@
m_allowClose = true;
this.TotalTime = DateTime.Now - m_grandBegin;
-
- if (m_cancel)
- this.DialogResult = DialogResult.Cancel;
- else
- this.DialogResult = DialogResult.OK;
-
+ this.DialogResult = m_cancel ? DialogResult.Cancel : DialogResult.OK;
this.Close();
}
@@ -151,7 +146,7 @@
this.Text = m_origTitle + " - (" + (int)(((double)m_grandTotalTileCount / (double)m_grandTotalTiles) * 100.0) + "%)";
if (m_failCount == 0)
- tileCounter.Text = string.Format(Strings.CurrentTileCounter, m_grandTotalTileCount, m_grandTotalTiles, "");
+ tileCounter.Text = string.Format(Strings.CurrentTileCounter, m_grandTotalTileCount, m_grandTotalTiles, string.Empty);
else
tileCounter.Text = string.Format(Strings.CurrentTileCounter, m_grandTotalTileCount, m_grandTotalTiles, string.Format(Strings.TileErrorCount, m_failCount));
Modified: trunk/Tools/Maestro/MgCooker/SetupRun.cs
===================================================================
--- trunk/Tools/Maestro/MgCooker/SetupRun.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/MgCooker/SetupRun.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -42,7 +42,7 @@
{
public partial class SetupRun : Form
{
- private IServerConnection m_connection;
+ private readonly IServerConnection m_connection;
private IDictionary<string, string> m_commandlineargs;
private IDictionary<string, IEnvelope> m_coordinateOverrides;
private bool m_isUpdating = false;
@@ -51,7 +51,7 @@
{
InitializeComponent();
saveFileDialog.Filter = string.Format(OSGeo.MapGuide.MaestroAPI.Strings.GenericFilter, OSGeo.MapGuide.MaestroAPI.Strings.PickBat, "bat") + "|" + //NOXLATE
- OSGeo.MapGuide.MaestroAPI.StringConstants.AllFilesFilter; //NOXLATE
+ StringConstants.AllFilesFilter; //NOXLATE
}
internal SetupRun(string username, string password, IServerConnection connection, string[] maps, IDictionary<string, string> args)
@@ -527,11 +527,7 @@
root = root.Parent;
IEnvelope box;
- if (m_coordinateOverrides.ContainsKey(root.Text))
- box = m_coordinateOverrides[root.Text];
- else
- box = ((IMapDefinition)root.Tag).Extents;
-
+ box = m_coordinateOverrides.ContainsKey(root.Text) ? m_coordinateOverrides[root.Text] : ((IMapDefinition)root.Tag).Extents;
BoundsOverride.Tag = root;
try
Modified: trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoBinaryExpression.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoBinaryExpression.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoBinaryExpression.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -1,23 +1,23 @@
-#region Disclaimer / License
-
-// Copyright (C) 2015, Jackie Ng
-// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
+#region Disclaimer / License
+
+// Copyright (C) 2015, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
#endregion Disclaimer / License
using Irony.Parsing;
using System;
@@ -43,11 +43,11 @@
get { return Expressions.ExpressionType.BinaryExpression; }
}
- public FdoExpression Left { get; private set; }
+ public FdoExpression Left { get; }
- public BinaryOperator Operator { get; private set; }
+ public BinaryOperator Operator { get; }
- public FdoExpression Right { get; private set; }
+ public FdoExpression Right { get; }
public FdoBinaryExpression(ParseTreeNode node)
{
Modified: trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoBinaryLogicalOperator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoBinaryLogicalOperator.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoBinaryLogicalOperator.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -1,23 +1,23 @@
-#region Disclaimer / License
-
-// Copyright (C) 2015, Jackie Ng
-// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
+#region Disclaimer / License
+
+// Copyright (C) 2015, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
#endregion Disclaimer / License
using System;
using System.Collections.Generic;
@@ -35,16 +35,13 @@
public class FdoBinaryLogicalOperator : FdoLogicalOperator
{
- public override FilterType FilterType
- {
- get { return Expressions.FilterType.BinaryLogicalOperator; }
- }
+ public override FilterType FilterType => FilterType.BinaryLogicalOperator;
- public FdoFilter Left { get; private set; }
+ public FdoFilter Left { get; }
- public BinaryLogicalOperations Operator { get; private set; }
+ public BinaryLogicalOperations Operator { get; }
- public FdoFilter Right { get; private set; }
+ public FdoFilter Right { get; }
public FdoBinaryLogicalOperator(Irony.Parsing.ParseTreeNode node)
{
Modified: trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoComparisonCondition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoComparisonCondition.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoComparisonCondition.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -1,23 +1,23 @@
-#region Disclaimer / License
-
-// Copyright (C) 2015, Jackie Ng
-// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
+#region Disclaimer / License
+
+// Copyright (C) 2015, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
#endregion Disclaimer / License
using Irony.Parsing;
using System;
@@ -41,16 +41,13 @@
public class FdoComparisonCondition : FdoSearchCondition
{
- public override FilterType FilterType
- {
- get { return Expressions.FilterType.ComparisonCondition; }
- }
+ public override FilterType FilterType => FilterType.ComparisonCondition;
- public FdoExpression Left { get; private set; }
+ public FdoExpression Left { get; }
- public ComparisonOperations Operator { get; private set; }
+ public ComparisonOperations Operator { get; }
- public FdoExpression Right { get; private set; }
+ public FdoExpression Right { get; }
public FdoComparisonCondition(ParseTreeNode node)
{
Modified: trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoDataValue.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoDataValue.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoDataValue.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -1,30 +1,26 @@
-#region Disclaimer / License
-
-// Copyright (C) 2015, Jackie Ng
-// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
+#region Disclaimer / License
+
+// Copyright (C) 2015, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
#endregion Disclaimer / License
using Irony.Parsing;
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace OSGeo.FDO.Expressions
{
@@ -67,7 +63,7 @@
case FdoTerminalNames.DateTime:
return new FdoDateTimeValue(node);
default:
- throw new FdoParseException("Unknown terminal: " + node.Term.Name);
+ throw new FdoParseException($"Unknown terminal: {node.Term.Name}");
}
}
}
@@ -75,32 +71,26 @@
public class FdoStringValue : FdoDataValue
{
- public override ExpressionType ExpressionType
- {
- get { return Expressions.ExpressionType.StringValue; }
- }
+ public override ExpressionType ExpressionType => ExpressionType.StringValue;
- public string Value { get; private set; }
+ public string Value { get; }
internal FdoStringValue(ParseTreeNode node)
{
- this.DataType = Expressions.DataType.String;
+ this.DataType = DataType.String;
this.Value = node.Token.ValueString;
}
}
public class FdoInt32Value : FdoDataValue
{
- public override ExpressionType ExpressionType
- {
- get { return Expressions.ExpressionType.Int32Value; }
- }
+ public override ExpressionType ExpressionType => ExpressionType.Int32Value;
- public int Value { get; private set; }
+ public int Value { get; }
internal FdoInt32Value(ParseTreeNode node)
{
- this.DataType = Expressions.DataType.Int32;
+ this.DataType = DataType.Int32;
this.Value = Convert.ToInt32(node.Token.ValueString);
}
@@ -117,16 +107,13 @@
public class FdoDoubleValue : FdoDataValue
{
- public override ExpressionType ExpressionType
- {
- get { return Expressions.ExpressionType.DoubleValue; }
- }
+ public override ExpressionType ExpressionType => ExpressionType.DoubleValue;
- public double Value { get; private set; }
+ public double Value { get; }
internal FdoDoubleValue(ParseTreeNode node)
{
- this.DataType = Expressions.DataType.Double;
+ this.DataType = DataType.Double;
this.Value = Convert.ToDouble(node.Token.ValueString);
}
@@ -143,18 +130,15 @@
public class FdoDateTimeValue : FdoDataValue
{
- public override ExpressionType ExpressionType
- {
- get { return Expressions.ExpressionType.DateTimeValue; }
- }
+ public override ExpressionType ExpressionType => ExpressionType.DateTimeValue;
- public DateTime? DateTime { get; private set; }
+ public DateTime? DateTime { get; }
- public TimeSpan? Time { get; private set; }
+ public TimeSpan? Time { get; }
internal FdoDateTimeValue(ParseTreeNode node)
{
- this.DataType = Expressions.DataType.DateTime;
+ this.DataType = DataType.DateTime;
string keyword = node.ChildNodes[0].Token.ValueString;
string value = node.ChildNodes[1].Token.ValueString;
switch (keyword)
@@ -163,7 +147,7 @@
{
string[] tokens = value.Split('-');
if (tokens.Length != 3)
- throw new FdoParseException("Value is not a valid FDO date string: " + value);
+ throw new FdoParseException($"Value is not a valid FDO date string: {value}"); //LOCALIZEME
this.DateTime = new DateTime(Convert.ToInt32(tokens[0]), Convert.ToInt32(tokens[1]), Convert.ToInt32(tokens[2]));
}
break;
@@ -171,7 +155,7 @@
{
string [] tokens = value.Split(':', '.');
if (tokens.Length != 3 && tokens.Length != 4)
- throw new FdoParseException("Value is not a valid FDO time string: " + value);
+ throw new FdoParseException($"Value is not a valid FDO time string: {value}"); //LOCALIZEME
var ts = new TimeSpan(0, Convert.ToInt32(tokens[0]), Convert.ToInt32(tokens[1]), Convert.ToInt32(tokens[2]), (tokens.Length == 4) ? Convert.ToInt32(tokens[3]) : 0);
this.Time = ts;
}
@@ -180,24 +164,21 @@
{
string[] tokens = value.Split('-', '.', ':', ' ');
if (tokens.Length != 6 && tokens.Length != 7)
- throw new FdoParseException("Value is not a valid FDO timestamp string: " + value);
+ throw new FdoParseException($"Value is not a valid FDO timestamp string: {value}"); //LOCALIZEME
this.DateTime = new DateTime(Convert.ToInt32(tokens[0]), Convert.ToInt32(tokens[1]), Convert.ToInt32(tokens[2]), Convert.ToInt32(tokens[3]), Convert.ToInt32(tokens[4]), Convert.ToInt32(tokens[5]), (tokens.Length == 7) ? Convert.ToInt32(tokens[6]) : 0);
}
break;
default:
- throw new FdoParseException("Unknown keyword: " + keyword);
+ throw new FdoParseException($"Unknown keyword: {keyword}"); //LOCALIZEME
}
}
}
public class FdoBooleanValue : FdoDataValue
{
- public override ExpressionType ExpressionType
- {
- get { return Expressions.ExpressionType.BooleanValue; }
- }
+ public override ExpressionType ExpressionType => ExpressionType.BooleanValue;
- public bool Value { get; private set; }
+ public bool Value { get; }
internal FdoBooleanValue(ParseTreeNode node)
{
Modified: trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoDistanceCondition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoDistanceCondition.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoDistanceCondition.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -1,23 +1,23 @@
-#region Disclaimer / License
-
-// Copyright (C) 2015, Jackie Ng
-// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
+#region Disclaimer / License
+
+// Copyright (C) 2015, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
#endregion Disclaimer / License
using Irony.Parsing;
using System;
@@ -36,18 +36,15 @@
public class FdoDistanceCondition : FdoGeometricCondition
{
- public override FilterType FilterType
- {
- get { return Expressions.FilterType.DistanceCondition; }
- }
+ public override FilterType FilterType => FilterType.DistanceCondition;
- public FdoIdentifier Identifier { get; private set; }
+ public FdoIdentifier Identifier { get; }
- public DistanceOperations Operator { get; private set; }
+ public DistanceOperations Operator { get; }
- public FdoExpression Expression { get; private set; }
+ public FdoExpression Expression { get; }
- public FdoDataValue Distance { get; private set; }
+ public FdoDataValue Distance { get; }
internal FdoDistanceCondition(ParseTreeNode node)
{
@@ -62,7 +59,7 @@
this.Operator = DistanceOperations.Beyond;
break;
default:
- throw new FdoParseException("Unknown operator: " + opName);
+ throw new FdoParseException($"Unknown operator: {opName}"); //LOCALIZEME
}
this.Expression = FdoExpression.ParseNode(node.ChildNodes[2]);
this.Distance = FdoDataValue.ParseDataNode(node.ChildNodes[3].ChildNodes[0]);
Modified: trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoFunction.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoFunction.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoFunction.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -1,23 +1,23 @@
-#region Disclaimer / License
-
-// Copyright (C) 2015, Jackie Ng
-// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
+#region Disclaimer / License
+
+// Copyright (C) 2015, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
#endregion Disclaimer / License
using Irony.Parsing;
using System;
@@ -30,14 +30,11 @@
{
public class FdoFunction : FdoExpression
{
- public override ExpressionType ExpressionType
- {
- get { return Expressions.ExpressionType.Function; }
- }
+ public override ExpressionType ExpressionType => ExpressionType.Function;
- public FdoIdentifier Identifier { get; private set; }
+ public FdoIdentifier Identifier { get; }
- public List<FdoExpression> Arguments { get; private set; }
+ public List<FdoExpression> Arguments { get; }
internal FdoFunction(ParseTreeNode node)
{
Modified: trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoGeometryValue.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoGeometryValue.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoGeometryValue.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -1,23 +1,23 @@
-#region Disclaimer / License
-
-// Copyright (C) 2015, Jackie Ng
-// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
+#region Disclaimer / License
+
+// Copyright (C) 2015, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
#endregion Disclaimer / License
using Irony.Parsing;
using System;
@@ -30,12 +30,9 @@
{
public class FdoGeometryValue : FdoLiteralValue
{
- public override ExpressionType ExpressionType
- {
- get { return Expressions.ExpressionType.GeometryValue; }
- }
+ public override ExpressionType ExpressionType => ExpressionType.GeometryValue;
- public string GeometryWkt { get; private set; }
+ public string GeometryWkt { get; }
internal FdoGeometryValue(ParseTreeNode node)
{
Modified: trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoIdentifier.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoIdentifier.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoIdentifier.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -1,41 +1,33 @@
-#region Disclaimer / License
-
-// Copyright (C) 2015, Jackie Ng
-// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
+#region Disclaimer / License
+
+// Copyright (C) 2015, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
#endregion Disclaimer / License
using Irony.Parsing;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace OSGeo.FDO.Expressions
{
public class FdoIdentifier : FdoExpression
{
- public override ExpressionType ExpressionType
- {
- get { return Expressions.ExpressionType.Identifier; }
- }
+ public override ExpressionType ExpressionType => ExpressionType.Identifier;
- public string Name { get; private set; }
+ public string Name { get; }
internal FdoIdentifier(ParseTreeNode node)
{
Modified: trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoInCondition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoInCondition.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoInCondition.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -1,23 +1,23 @@
-#region Disclaimer / License
-
-// Copyright (C) 2015, Jackie Ng
-// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
+#region Disclaimer / License
+
+// Copyright (C) 2015, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
#endregion Disclaimer / License
using Irony.Parsing;
using System;
@@ -30,14 +30,11 @@
{
public class FdoInCondition : FdoSearchCondition
{
- public override FilterType FilterType
- {
- get { return Expressions.FilterType.InCondition; }
- }
+ public override FilterType FilterType => FilterType.InCondition;
- public FdoIdentifier Identifier { get; private set; }
+ public FdoIdentifier Identifier { get; }
- public List<FdoValueExpression> ValueList { get; private set; }
+ public List<FdoValueExpression> ValueList { get; }
public FdoInCondition(ParseTreeNode node)
{
Modified: trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoNullCondition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoNullCondition.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoNullCondition.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -1,41 +1,33 @@
-#region Disclaimer / License
-
-// Copyright (C) 2015, Jackie Ng
-// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
+#region Disclaimer / License
+
+// Copyright (C) 2015, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
#endregion Disclaimer / License
using Irony.Parsing;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace OSGeo.FDO.Expressions
{
public class FdoNullCondition : FdoSearchCondition
{
- public override FilterType FilterType
- {
- get { return Expressions.FilterType.NullCondition; }
- }
+ public override FilterType FilterType => FilterType.NullCondition;
- public FdoIdentifier Identifier { get; private set; }
+ public FdoIdentifier Identifier { get; }
public FdoNullCondition(ParseTreeNode node)
{
Modified: trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoParameter.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoParameter.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoParameter.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -1,41 +1,33 @@
-#region Disclaimer / License
-
-// Copyright (C) 2015, Jackie Ng
-// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
+#region Disclaimer / License
+
+// Copyright (C) 2015, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
#endregion Disclaimer / License
using Irony.Parsing;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace OSGeo.FDO.Expressions
{
public class FdoParameter : FdoValueExpression
{
- public override ExpressionType ExpressionType
- {
- get { return Expressions.ExpressionType.Parameter; }
- }
+ public override ExpressionType ExpressionType => ExpressionType.Parameter;
- public string Name { get; private set; }
+ public string Name { get; }
internal FdoParameter(ParseTreeNode node)
{
Modified: trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoParseException.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoParseException.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoParseException.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -1,29 +1,26 @@
-#region Disclaimer / License
-
-// Copyright (C) 2015, Jackie Ng
-// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
+#region Disclaimer / License
+
+// Copyright (C) 2015, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
#endregion Disclaimer / License
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace OSGeo.FDO.Expressions
{
@@ -41,11 +38,11 @@
public class FdoParseErrorMessage
{
- public int LineNumber { get; private set; }
+ public int LineNumber { get; }
- public int Column { get; private set; }
+ public int Column { get; }
- public string Message { get; private set; }
+ public string Message { get; }
public FdoParseErrorMessage(string message, int line, int column)
{
@@ -58,7 +55,7 @@
[Serializable]
public class FdoMalformedExpressionException : FdoParseException
{
- public List<FdoParseErrorMessage> Messages { get; private set; }
+ public List<FdoParseErrorMessage> Messages { get; }
public FdoMalformedExpressionException(string message, List<FdoParseErrorMessage> parserErrorMessages)
: this(message)
Modified: trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoSpatialCondition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoSpatialCondition.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoSpatialCondition.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -1,30 +1,25 @@
-#region Disclaimer / License
-
-// Copyright (C) 2015, Jackie Ng
-// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
+#region Disclaimer / License
+
+// Copyright (C) 2015, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
#endregion Disclaimer / License
using Irony.Parsing;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace OSGeo.FDO.Expressions
{
@@ -44,16 +39,13 @@
public class FdoSpatialCondition : FdoGeometricCondition
{
- public override FilterType FilterType
- {
- get { return Expressions.FilterType.SpatialCondition; }
- }
+ public override FilterType FilterType => FilterType.SpatialCondition;
- public FdoIdentifier Identifier { get; private set; }
+ public FdoIdentifier Identifier { get; }
- public SpatialOperations Operator { get; private set; }
+ public SpatialOperations Operator { get; }
- public FdoExpression Expression { get; private set; }
+ public FdoExpression Expression { get; }
internal FdoSpatialCondition(ParseTreeNode node)
{
@@ -92,7 +84,7 @@
this.Operator = SpatialOperations.Inside;
break;
default:
- throw new FdoParseException("Unknown operator: " + opName);
+ throw new FdoParseException($"Unknown operator: {opName}"); //LOCALIZEME
}
this.Expression = FdoExpression.ParseNode(node.ChildNodes[2]);
}
Modified: trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoUnaryExpression.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoUnaryExpression.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoUnaryExpression.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -1,41 +1,33 @@
-#region Disclaimer / License
-
-// Copyright (C) 2015, Jackie Ng
-// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
+#region Disclaimer / License
+
+// Copyright (C) 2015, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
#endregion Disclaimer / License
using Irony.Parsing;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace OSGeo.FDO.Expressions
{
public class FdoUnaryExpression : FdoExpression
{
- public override ExpressionType ExpressionType
- {
- get { return Expressions.ExpressionType.UnaryExpression; }
- }
+ public override ExpressionType ExpressionType => ExpressionType.UnaryExpression;
- public FdoExpression Expression { get; private set; }
+ public FdoExpression Expression { get; }
internal FdoUnaryExpression(ParseTreeNode node)
{
Modified: trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoUnaryLogicalOperator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoUnaryLogicalOperator.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoUnaryLogicalOperator.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -1,23 +1,23 @@
-#region Disclaimer / License
-
-// Copyright (C) 2015, Jackie Ng
-// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
+#region Disclaimer / License
+
+// Copyright (C) 2015, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
#endregion Disclaimer / License
using Irony.Parsing;
using System;
@@ -30,12 +30,9 @@
{
public class FdoUnaryLogicalOperator : FdoLogicalOperator
{
- public override FilterType FilterType
- {
- get { return Expressions.FilterType.UnaryLogicalOperator; }
- }
+ public override FilterType FilterType => FilterType.UnaryLogicalOperator;
- public FdoFilter NegatedFilter { get; private set; }
+ public FdoFilter NegatedFilter { get; }
public FdoUnaryLogicalOperator(ParseTreeNode node)
{
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -439,7 +439,7 @@
}
set
{
- SetField(ref _dpi, value, "DisplayDpi"); //NOXLATE
+ SetField(ref _dpi, value, nameof(this.DisplayDpi));
}
}
@@ -578,7 +578,7 @@
}
set
{
- SetField(ref _viewScale, value, "ViewScale"); //NOXLATE
+ SetField(ref _viewScale, value, nameof(this.ViewScale));
}
}
@@ -594,7 +594,7 @@
public string Name
{
get { return _name; }
- set { SetField(ref _name, value, "Name"); } //NOXLATE
+ set { SetField(ref _name, value, nameof(this.Name)); }
}
/// <summary>
@@ -611,7 +611,7 @@
public virtual string CoordinateSystem
{
get { return _mapSrs; }
- set { SetField(ref _mapSrs, value, "CoordinateSystem"); } //NOXLATE
+ set { SetField(ref _mapSrs, value, nameof(this.CoordinateSystem)); }
}
/// <summary>
@@ -633,7 +633,7 @@
}
set
{
- SetField(ref _bgColor, value, "BackgroundColor"); //NOXLATE
+ SetField(ref _bgColor, value, nameof(this.BackgroundColor));
}
}
@@ -649,7 +649,7 @@
get { return _resId; }
set
{
- SetField(ref _resId, value, "ResourceID"); //NOXLATE
+ SetField(ref _resId, value, nameof(this.ResourceID));
if (this.Name == null)
this.Name = ResourceIdentifier.GetName(_resId);
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapGroup.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapGroup.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapGroup.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -109,7 +109,7 @@
}
set
{
- SetField(ref _visible, value, "Visible"); //NOXLATE
+ SetField(ref _visible, value, nameof(this.Visible));
}
}
@@ -126,7 +126,7 @@
}
set
{
- SetField(ref _group, value, "Group"); //NOXLATE
+ SetField(ref _group, value, nameof(this.Group));
}
}
@@ -152,7 +152,7 @@
}
set
{
- SetField(ref _name, value, "Name"); //NOXLATE
+ SetField(ref _name, value, nameof(this.Name));
}
}
@@ -169,7 +169,7 @@
}
set
{
- SetField(ref _showInLegend, value, "ShowInLegend"); //NOXLATE
+ SetField(ref _showInLegend, value, nameof(this.ShowInLegend));
}
}
@@ -186,7 +186,7 @@
}
set
{
- SetField(ref _legendLabel, value, "LegendLabel"); //NOXLATE
+ SetField(ref _legendLabel, value, nameof(this.LegendLabel));
}
}
@@ -203,7 +203,7 @@
}
set
{
- SetField(ref _expandInLegend, value, "ExpandInLegend"); //NOXLATE
+ SetField(ref _expandInLegend, value, nameof(this.ExpandInLegend));
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapLayer.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapLayer.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapLayer.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -385,7 +385,7 @@
}
set
{
- if (SetField(ref _group, value, "Group")) //NOXLATE
+ if (SetField(ref _group, value, nameof(this.Group)))
Parent.IsDirty = true;
}
}
@@ -414,7 +414,7 @@
}
set
{
- if (SetField(ref _selectable, value, "Selectable")) //NOXLATE
+ if (SetField(ref _selectable, value, nameof(this.Selectable)))
Parent.IsDirty = true;
}
}
@@ -433,7 +433,7 @@
}
set
{
- if (SetField(ref _name, value, "Name")) //NOXLATE
+ if (SetField(ref _name, value, nameof(this.Name)))
Parent.IsDirty = true;
}
}
@@ -452,7 +452,7 @@
}
set
{
- if (SetField(ref _showInLegend, value, "ShowInLegend")) //NOXLATE
+ if (SetField(ref _showInLegend, value, nameof(this.ShowInLegend)))
Parent.IsDirty = true;
}
}
@@ -471,7 +471,7 @@
}
set
{
- if (SetField(ref _legendLabel, value, "LegendLabel")) //NOXLATE
+ if (SetField(ref _legendLabel, value, nameof(this.LegendLabel)))
Parent.IsDirty = true;
}
}
@@ -490,7 +490,7 @@
}
set
{
- if (SetField(ref _expandInLegend, value, "ExpandInLegend")) //NOXLATE
+ if (SetField(ref _expandInLegend, value, nameof(this.ExpandInLegend)))
Parent.IsDirty = true;
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -422,15 +422,15 @@
/// <summary>
/// Deletes the resource.
/// </summary>
- /// <param name="resourceid">The resourceid.</param>
- public abstract void DeleteResource(string resourceid);
+ /// <param name="resourceID">The resourceid.</param>
+ public abstract void DeleteResource(string resourceID);
/// <summary>
/// Writes an object into a resourceID
/// </summary>
- /// <param name="resourceid">The resource to write into</param>
+ /// <param name="resourceID">The resource to write into</param>
/// <param name="resource">The resourcec to write</param>
- virtual public void WriteResource(string resourceid, object resource)
+ virtual public void WriteResource(string resourceID, object resource)
{
System.IO.MemoryStream ms = SerializeObject(resource);
ms.Position = 0;
@@ -448,20 +448,20 @@
ms.Position = 0;
#endif
- SetResourceXmlData(resourceid, ms);
+ SetResourceXmlData(resourceID, ms);
}
/// <summary>
/// Writes raw data into a resource.
/// </summary>
- /// <param name="resourceid">The resourceID to write into</param>
+ /// <param name="resourceID">The resourceID to write into</param>
/// <param name="stream">The stream containing the data to write.</param>
- public virtual void SetResourceXmlData(string resourceid, System.IO.Stream stream)
+ public virtual void SetResourceXmlData(string resourceID, System.IO.Stream stream)
{
- SetResourceXmlData(resourceid, stream, null);
- int purged = PurgeCachedItemsOf(resourceid);
+ SetResourceXmlData(resourceID, stream, null);
+ int purged = PurgeCachedItemsOf(resourceID);
#if DEBUG
- System.Diagnostics.Trace.TraceInformation("{0} cached items purged for {1}", purged, resourceid); //NOXLATE
+ System.Diagnostics.Trace.TraceInformation($"{purged} cached items purged for {resourceID}"); //NOXLATE
#endif
}
@@ -470,10 +470,7 @@
/// This method returns the full catalog and should be used sparringly.
/// </summary>
/// <returns>A list of contained resources</returns>
- virtual public ObjCommon.ResourceList GetRepositoryResources()
- {
- return GetRepositoryResources(StringConstants.RootIdentifier, null, -1, true);
- }
+ public virtual ResourceList GetRepositoryResources() => GetRepositoryResources(StringConstants.RootIdentifier, null, -1, true);
/// <summary>
/// Gets a list of resources in the permanent server repository (Library).
@@ -481,10 +478,7 @@
/// </summary>
/// <param name="depth">The max depth to recurse. Use -1 for no limit.</param>
/// <returns>A list of contained resources</returns>
- virtual public ObjCommon.ResourceList GetRepositoryResources(int depth)
- {
- return GetRepositoryResources(StringConstants.RootIdentifier, null, depth, true);
- }
+ public virtual ResourceList GetRepositoryResources(int depth) => GetRepositoryResources(StringConstants.RootIdentifier, null, depth, true);
/// <summary>
/// Gets a list of resources in the permanent server repository (Library).
@@ -493,10 +487,7 @@
/// <param name="startingpoint">The folder from which to return items. Use null for "Library://"</param>
/// <param name="depth">The max depth to recurse. Use -1 for no limit.</param>
/// <returns>A list of contained resources</returns>
- virtual public ObjCommon.ResourceList GetRepositoryResources(string startingpoint, int depth)
- {
- return GetRepositoryResources(startingpoint, null, depth, true);
- }
+ public virtual ResourceList GetRepositoryResources(string startingpoint, int depth) => GetRepositoryResources(startingpoint, null, depth, true);
/// <summary>
/// Gets a list of resources in the permanent server repository (Library).
@@ -504,10 +495,7 @@
/// </summary>
/// <param name="startingpoint">The folder from which to return items. Use null for "Library://"</param>
/// <returns>A list of contained resources</returns>
- virtual public ObjCommon.ResourceList GetRepositoryResources(string startingpoint)
- {
- return GetRepositoryResources(startingpoint, null, -1, true);
- }
+ public virtual ResourceList GetRepositoryResources(string startingpoint) => GetRepositoryResources(startingpoint, null, -1, true);
/// <summary>
/// Gets a list of resources in the permanent server repository (Library).
@@ -516,10 +504,7 @@
/// <param name="startingpoint">The folder from which to return items. Use null for "Library://"</param>
/// <param name="type">The type of resource to look for. Basically this is the resource extension, like ".MapDefinition". Use null for all resources.</param>
/// <returns>A list of contained resources</returns>
- virtual public ObjCommon.ResourceList GetRepositoryResources(string startingpoint, string type)
- {
- return GetRepositoryResources(startingpoint, type, -1, true);
- }
+ public virtual ResourceList GetRepositoryResources(string startingpoint, string type) => GetRepositoryResources(startingpoint, type, -1, true);
/// <summary>
/// Gets a list of resources in the permanent server repository (Library).
@@ -529,10 +514,7 @@
/// <param name="type">The type of resource to look for. Basically this is the resource extension, like ".MapDefinition". Use null for all resources.</param>
/// <param name="depth">The max depth to recurse. Use -1 for no limit.</param>
/// <returns>A list of contained resources</returns>
- public ObjCommon.ResourceList GetRepositoryResources(string startingpoint, string type, int depth)
- {
- return GetRepositoryResources(startingpoint, type, depth, true);
- }
+ public ResourceList GetRepositoryResources(string startingpoint, string type, int depth) => GetRepositoryResources(startingpoint, type, depth, true);
/// <summary>
/// Gets a list of resources in the permanent server repository (Library).
@@ -542,7 +524,7 @@
/// <param name="depth">The max depth to recurse. Use -1 for no limit.</param>
/// <param name="computeChildren">A flag indicating if the count of subfolders and resources should be calculated for leaf nodes</param>
/// <returns>A list of contained resources</returns>
- abstract public ObjCommon.ResourceList GetRepositoryResources(string startingpoint, string type, int depth, bool computeChildren);
+ public abstract ResourceList GetRepositoryResources(string startingpoint, string type, int depth, bool computeChildren);
/// <summary>
/// Forces a timestamp update of the specified resource. This is akin to
@@ -560,23 +542,23 @@
/// <summary>
/// Returns a boolean indicating if a given resource exists
/// </summary>
- /// <param name="resourceid">The resource to look for</param>
+ /// <param name="resourceID">The resource to look for</param>
/// <returns>True if the resource exists false otherwise. Also returns false on error.</returns>
- public virtual bool ResourceExists(string resourceid)
+ public virtual bool ResourceExists(string resourceID)
{
try
{
string sourcefolder;
- if (resourceid.EndsWith("/")) //NOXLATE
- sourcefolder = resourceid.Substring(0, resourceid.Substring(0, resourceid.Length - 1).LastIndexOf("/") + 1); //NOXLATE
+ if (resourceID.EndsWith("/")) //NOXLATE
+ sourcefolder = resourceID.Substring(0, resourceID.Substring(0, resourceID.Length - 1).LastIndexOf("/") + 1); //NOXLATE
else
- sourcefolder = resourceid.Substring(0, resourceid.LastIndexOf("/") + 1); //NOXLATE
+ sourcefolder = resourceID.Substring(0, resourceID.LastIndexOf("/") + 1); //NOXLATE
ObjCommon.ResourceList lst = GetRepositoryResources(sourcefolder, 1);
foreach (object o in lst.Items)
- if (o.GetType() == typeof(ObjCommon.ResourceListResourceFolder) && ((ObjCommon.ResourceListResourceFolder)o).ResourceId == resourceid)
+ if (o.GetType() == typeof(ObjCommon.ResourceListResourceFolder) && ((ObjCommon.ResourceListResourceFolder)o).ResourceId == resourceID)
return true;
- else if (o.GetType() == typeof(ObjCommon.ResourceListResourceDocument) && ((ObjCommon.ResourceListResourceDocument)o).ResourceId == resourceid)
+ else if (o.GetType() == typeof(ObjCommon.ResourceListResourceDocument) && ((ObjCommon.ResourceListResourceDocument)o).ResourceId == resourceID)
return true;
return false;
@@ -595,9 +577,7 @@
/// <param name="newresourcepath">The new resource path, the one updating to</param>
/// <param name="folderupdates">True if the old and new resource path identifiers are folders, false otherwise</param>
public virtual void UpdateResourceReferences(object o, string oldresourcepath, string newresourcepath, bool folderupdates)
- {
- UpdateResourceReferences(o, oldresourcepath, newresourcepath, folderupdates, new Hashtable());
- }
+ => UpdateResourceReferences(o, oldresourcepath, newresourcepath, folderupdates, new Hashtable());
/// <summary>
/// Updates all resource references inside an object.
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpCreateRuntimeMap.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpCreateRuntimeMap.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpCreateRuntimeMap.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -27,7 +27,7 @@
{
public class HttpCreateRuntimeMap : ICreateRuntimeMap
{
- private HttpServerConnection _conn;
+ private readonly HttpServerConnection _conn;
internal HttpCreateRuntimeMap(HttpServerConnection conn)
{
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpDescribeRuntimeMap.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpDescribeRuntimeMap.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpDescribeRuntimeMap.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -27,7 +27,7 @@
{
public class HttpDescribeRuntimeMap : IDescribeRuntimeMap
{
- private HttpServerConnection _conn;
+ private readonly HttpServerConnection _conn;
internal HttpDescribeRuntimeMap(HttpServerConnection conn)
{
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpGetFdoCacheInfo.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpGetFdoCacheInfo.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpGetFdoCacheInfo.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -26,7 +26,7 @@
{
public class HttpGetFdoCacheInfo : IGetFdoCacheInfo
{
- private HttpServerConnection _conn;
+ private readonly HttpServerConnection _conn;
internal HttpGetFdoCacheInfo(HttpServerConnection conn)
{
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpGetResourceContents.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpGetResourceContents.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpGetResourceContents.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -89,10 +89,6 @@
return _completed;
}
- public IServerConnection Parent
- {
- get;
- private set;
- }
+ public IServerConnection Parent { get; }
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpResourcePreviewUrlGenerator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpResourcePreviewUrlGenerator.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpResourcePreviewUrlGenerator.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -46,13 +46,13 @@
_rootUrl = rootUrl;
}
- protected override string GenerateWatermarkPreviewUrl(ObjectModels.WatermarkDefinition.IWatermarkDefinition wmd, string locale, bool isNew, string sessionID)
+ protected override string GenerateWatermarkPreviewUrl(IWatermarkDefinition watermarkDefinition, string locale, bool isNew, string sessionID)
{
//We demand a 2.3.0 Map Definition or higher
if (_conn.SiteVersion < new Version(2, 3))
throw new InvalidOperationException(Strings.SiteVersionDoesntSupportWatermarks);
- IMapDefinition2 map = Utility.CreateWatermarkPreviewMapDefinition(wmd);
+ IMapDefinition2 map = Utility.CreateWatermarkPreviewMapDefinition(watermarkDefinition);
return _GenerateMapPreviewUrl(map, locale, isNew, sessionID, false);
}
@@ -74,10 +74,10 @@
{
string url = GetRootUrl();
- var resId = "Session:" + sessionID + "//" + Guid.NewGuid() + ".WebLayout"; //NOXLATE
+ var resId = $"Session:{sessionID}//{Guid.NewGuid()}.WebLayout"; //NOXLATE
_conn.ResourceService.SaveResourceAs(res, resId);
- url += "mapviewerajax/?WEBLAYOUT=" + resId + "&SESSION=" + sessionID + "&LOCALE=" + GetLocale(locale); //NOXLATE
+ url += $"mapviewerajax/?WEBLAYOUT={resId}&SESSION={sessionID}&LOCALE={GetLocale(locale)}"; //NOXLATE
return url;
}
@@ -86,7 +86,7 @@
{
string url = GetRootUrl();
- var mdfId = "Session:" + sessionID + "//" + Guid.NewGuid() + ".MapDefinition"; //NOXLATE
+ var mdfId = $"Session:{sessionID}//{Guid.NewGuid()}.MapDefinition"; //NOXLATE
var mdf = res as IMapDefinition;
if (mdf != null)
{
@@ -104,10 +104,10 @@
//Add a custom zoom command (to assist previews of layers that aren't [0, infinity] scale)
AttachPreviewCommands(wl);
- var resId = "Session:" + sessionID + "//" + Guid.NewGuid() + ".WebLayout"; //NOXLATE
+ var resId = $"Session:{sessionID}//{Guid.NewGuid()}.WebLayout"; //NOXLATE
_conn.ResourceService.SaveResourceAs(wl, resId);
- url += "mapviewerajax/?WEBLAYOUT=" + resId + "&SESSION=" + sessionID + "&LOCALE=" + GetLocale(locale); //NOXLATE
+ url += $"mapviewerajax/?WEBLAYOUT={resId}&SESSION={sessionID}&LOCALE={GetLocale(locale)}"; //NOXLATE
}
else
{
@@ -132,7 +132,7 @@
private IMapDefinition CreateLayerPreviewMapDefinition(ILayerDefinition ldf, string sessionId, string layerName, IServerConnection conn)
{
//Create temp map definition to house our current layer
- var mdfId = "Session:" + sessionId + "//" + Guid.NewGuid() + ".MapDefinition"; //NOXLATE
+ var mdfId = $"Session:{sessionId}//{Guid.NewGuid()}.MapDefinition"; //NOXLATE
string csWkt;
var extent = ldf.GetSpatialExtent(_conn, true, out csWkt);
if (extent == null)
@@ -171,10 +171,10 @@
//Add a custom zoom command (to assist previews of layers that aren't [0, infinity] scale)
AttachPreviewCommands(wl);
- var resId = "Session:" + sessionID + "//" + Guid.NewGuid() + ".WebLayout"; //NOXLATE
+ var resId = $"Session:{sessionID}//{Guid.NewGuid()}.WebLayout"; //NOXLATE
_conn.ResourceService.SaveResourceAs(wl, resId);
- url += "mapviewerajax/?WEBLAYOUT=" + resId + "&SESSION=" + sessionID + "&LOCALE=" + GetLocale(locale); //NOXLATE
+ url += $"mapviewerajax/?WEBLAYOUT={resId}&SESSION={sessionID}&LOCALE={GetLocale(locale)}"; //NOXLATE
}
else
{
@@ -197,10 +197,10 @@
//Create temp flex layout
var appDef = (IApplicationDefinition)res;
- var resId = "Session:" + sessionID + "//" + Guid.NewGuid() + ".ApplicationDefinition"; //NOXLATE
+ var resId = $"Session:{sessionID}//{Guid.NewGuid()}.ApplicationDefinition"; //NOXLATE
_conn.ResourceService.SaveResourceAs(appDef, resId);
- url += appDef.TemplateUrl + "?Session=" + sessionID + "&ApplicationDefinition=" + resId + "&locale=" + GetLocale(locale); //NOXLATE
+ url += $"{appDef.TemplateUrl}?Session={sessionID}&ApplicationDefinition={resId}&locale={GetLocale(locale)}"; //NOXLATE
return url;
}
@@ -209,13 +209,12 @@
string url = GetRootUrl();
var resId = res.ResourceID;
- url += "schemareport/describeschema.php?viewer=basic&schemaName=&className=&resId=" + resId + "&sessionId=" + sessionID + "&locale=" + GetLocale(locale); //NOXLATE
+ url += $"schemareport/describeschema.php?viewer=basic&schemaName=&className=&resId={resId}&sessionId={sessionID}&locale={GetLocale(locale)}"; //NOXLATE
return url;
}
- private static string[] PREVIEWABLE_RESOURCE_TYPES = new string[]
- {
+ private static string[] PREVIEWABLE_RESOURCE_TYPES = {
ResourceTypes.FeatureSource.ToString(),
ResourceTypes.ApplicationDefinition.ToString(),
ResourceTypes.LayerDefinition.ToString(),
@@ -224,10 +223,7 @@
ResourceTypes.WatermarkDefinition.ToString()
};
- public override bool IsPreviewableType(string resourceType)
- {
- return Array.IndexOf(PREVIEWABLE_RESOURCE_TYPES, resourceType) >= 0;
- }
+ public override bool IsPreviewableType(string resourceType) => Array.IndexOf(PREVIEWABLE_RESOURCE_TYPES, resourceType) >= 0;
private static void AttachPreviewCommands(IWebLayout wl)
{
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -587,11 +587,11 @@
}
}
- public override void SetResourceXmlData(string resourceid, System.IO.Stream content, System.IO.Stream header)
+ public override void SetResourceXmlData(string resourceId, Stream content, Stream header)
{
- bool exists = ResourceExists(resourceid);
+ bool exists = ResourceExists(resourceId);
- System.IO.MemoryStream outStream = new System.IO.MemoryStream();
+ MemoryStream outStream = new MemoryStream();
#if DEBUG_LASTMESSAGE
try
{
@@ -600,24 +600,24 @@
if (this.m_autoRestartSession && m_username != null && m_password != null)
this.DownloadData(m_reqBuilder.GetSiteVersion());
- System.Net.WebRequest req = m_reqBuilder.SetResource(resourceid, outStream, content, header);
+ WebRequest req = m_reqBuilder.SetResource(resourceId, outStream, content, header);
req.Credentials = _cred;
outStream.Position = 0;
try
{
- using (System.IO.Stream rs = req.GetRequestStream())
+ using (var rs = req.GetRequestStream())
{
Utility.CopyStream(outStream, rs);
rs.Flush();
}
var wresp = req.GetResponse();
- if (wresp is HttpWebResponse)
+ var hresp = wresp as HttpWebResponse;
+ if (hresp != null)
{
- HttpWebResponse httpresp = (HttpWebResponse)wresp;
- LogResponse(httpresp);
+ LogResponse(hresp);
}
- using (System.IO.Stream resp = wresp.GetResponseStream())
+ using (var resp = wresp.GetResponseStream())
{
//Do nothing... there is no return value
}
@@ -647,9 +647,9 @@
#endif
if (exists)
- OnResourceUpdated(resourceid);
+ OnResourceUpdated(resourceId);
else
- OnResourceAdded(resourceid);
+ OnResourceAdded(resourceId);
}
private void LogResponse(HttpWebResponse resp)
@@ -679,10 +679,8 @@
throw new NotSupportedException();
}
- public override IFeatureReader QueryFeatureSource(string resourceID, string schema, string query, string[] columns, NameValueCollection computedProperties)
- {
- return (IFeatureReader)QueryFeatureSourceCore(false, resourceID, schema, query, columns, computedProperties);
- }
+ public override IFeatureReader QueryFeatureSource(string resourceID, string className, string filter, string[] propertyNames, NameValueCollection computedProperties)
+ => (IFeatureReader)QueryFeatureSourceCore(false, resourceID, className, filter, propertyNames, computedProperties);
private IReader QueryFeatureSourceCore(bool aggregate, string resourceID, string schema, string query, string[] columns, NameValueCollection computedProperties)
{
@@ -697,7 +695,7 @@
#endif
try
{
- using (System.IO.Stream rs = req.GetRequestStream())
+ using (var rs = req.GetRequestStream())
{
Utility.CopyStream(ms, rs);
rs.Flush();
@@ -734,19 +732,15 @@
}
public override IReader AggregateQueryFeatureSource(string resourceID, string schema, string filter, string[] columns)
- {
- return QueryFeatureSourceCore(true, resourceID, schema, filter, columns, null);
- }
+ => QueryFeatureSourceCore(true, resourceID, schema, filter, columns, null);
public override IReader AggregateQueryFeatureSource(string resourceID, string schema, string filter, NameValueCollection aggregateFunctions)
- {
- return QueryFeatureSourceCore(true, resourceID, schema, filter, null, aggregateFunctions);
- }
+ => QueryFeatureSourceCore(true, resourceID, schema, filter, null, aggregateFunctions);
- protected override FeatureSourceDescription DescribeFeatureSourceInternal(string resourceID)
+ protected override FeatureSourceDescription DescribeFeatureSourceInternal(string resourceId)
{
- ResourceIdentifier.Validate(resourceID, ResourceTypes.FeatureSource);
- string req = m_reqBuilder.DescribeSchema(resourceID);
+ ResourceIdentifier.Validate(resourceId, ResourceTypes.FeatureSource);
+ string req = m_reqBuilder.DescribeSchema(resourceId);
try
{
@@ -759,7 +753,7 @@
try
{
if (this.IsSessionExpiredException(ex) && this.AutoRestartSession && this.RestartSession(false))
- return this.DescribeFeatureSource(resourceID);
+ return this.DescribeFeatureSource(resourceId);
}
catch
{
@@ -841,7 +835,7 @@
{
string req = m_reqBuilder.DeleteResourceData(resourceID, dataname);
- using (System.IO.Stream resp = this.OpenRead(req))
+ using (var resp = this.OpenRead(req))
resp.ReadByte();
//Do nothing... there is no return value
}
@@ -850,7 +844,7 @@
{
string req = m_reqBuilder.EnumerateResourceData(resourceID);
- using (System.IO.Stream resp = this.OpenRead(req))
+ using (var resp = this.OpenRead(req))
return (ResourceDataList)DeserializeObject(typeof(ResourceDataList), resp);
}
@@ -858,7 +852,7 @@
{
string req = m_reqBuilder.DeleteResource(resourceID);
- using (System.IO.Stream resp = this.OpenRead(req))
+ using (var resp = this.OpenRead(req))
resp.ReadByte();
//Do nothing... there is no return value
@@ -893,7 +887,7 @@
{
get
{
- if (this.SiteVersion < OSGeo.MapGuide.MaestroAPI.SiteVersions.GetVersion(OSGeo.MapGuide.MaestroAPI.KnownSiteVersions.MapGuideOS1_1))
+ if (this.SiteVersion < SiteVersions.GetVersion(KnownSiteVersions.MapGuideOS1_1))
return null;
else
{
@@ -904,15 +898,12 @@
}
}
- public System.IO.Stream ExecuteOperation(System.Collections.Specialized.NameValueCollection param)
- {
- return this.OpenRead(m_reqBuilder.BuildRequest(param));
- }
+ public Stream ExecuteOperation(NameValueCollection param) => this.OpenRead(m_reqBuilder.BuildRequest(param));
/// <summary>
/// Returns the Uri for the mapagent
/// </summary>
- public string ServerURI { get { return m_reqBuilder.HostURI; } }
+ public string ServerURI => m_reqBuilder.HostURI;
/// <summary>
/// Gets a string that can be used to identify the server by a user
@@ -938,7 +929,7 @@
{
string req = m_reqBuilder.EnumerateResourceReferences(resourceid);
- using (System.IO.Stream resp = this.OpenRead(req))
+ using (var resp = this.OpenRead(req))
return (ResourceReferenceList)DeserializeObject(typeof(ResourceReferenceList), resp);
}
@@ -948,7 +939,7 @@
string req = m_reqBuilder.CopyResource(oldpath, newpath, overwrite);
- using (System.IO.Stream resp = this.OpenRead(req))
+ using (var resp = this.OpenRead(req))
resp.ReadByte();
//Do nothing... there is no return value
@@ -971,7 +962,7 @@
string req = m_reqBuilder.CopyResource(oldpath, newpath, overwrite);
- using (System.IO.Stream resp = this.OpenRead(req))
+ using (var resp = this.OpenRead(req))
resp.ReadByte();
//Do nothing... there is no return value
@@ -987,7 +978,7 @@
string req = m_reqBuilder.MoveResource(oldpath, newpath, overwrite);
- using (System.IO.Stream resp = this.OpenRead(req))
+ using (var resp = this.OpenRead(req))
resp.ReadByte();
//Do nothing... there is no return value
@@ -1018,27 +1009,27 @@
OnResourceAdded(newpath);
}
- public override System.IO.Stream RenderDynamicOverlay(Mapping.RuntimeMap map, MapSelection selection, string format, Color selectionColor, int behavior)
+ public override Stream RenderDynamicOverlay(RuntimeMap map, MapSelection selection, string format, Color selectionColor, int behaviour)
{
//This API was introduced in MGOS 2.1 so this won't work with older versions
if (this.SiteVersion < new Version(2, 1, 0))
throw new NotSupportedException();
- System.IO.MemoryStream ms = new System.IO.MemoryStream();
- var req = m_reqBuilder.GetDynamicMapOverlayImage(map.Name, (selection == null ? string.Empty : selection.ToXml()), format, selectionColor, behavior);
+ var ms = new MemoryStream();
+ var req = m_reqBuilder.GetDynamicMapOverlayImage(map.Name, (selection == null ? string.Empty : selection.ToXml()), format, selectionColor, behaviour);
return this.OpenRead(req);
}
- public override System.IO.Stream RenderDynamicOverlay(Mapping.RuntimeMap map, MapSelection selection, string format, bool keepSelection)
+ public override Stream RenderDynamicOverlay(RuntimeMap map, MapSelection selection, string format, bool keepSelection)
{
- System.IO.MemoryStream ms = new System.IO.MemoryStream();
- System.Net.WebRequest req = m_reqBuilder.GetDynamicMapOverlayImage(map.Name, (selection == null ? string.Empty : selection.ToXml()), format, ms);
+ var ms = new MemoryStream();
+ var req = m_reqBuilder.GetDynamicMapOverlayImage(map.Name, (selection == null ? string.Empty : selection.ToXml()), format, ms);
//Maksim reported that the rendering times out frequently, so now we wait 5 minutes
req.Timeout = 5 * 60 * 1000;
- using (System.IO.Stream rs = req.GetRequestStream())
+ using (var rs = req.GetRequestStream())
{
Utility.CopyStream(ms, rs);
rs.Flush();
@@ -1051,15 +1042,15 @@
}
}
- public Stream RenderMapLegend(Mapping.RuntimeMap map, int width, int height, System.Drawing.Color backgroundColor, string format)
+ public Stream RenderMapLegend(RuntimeMap map, int width, int height, Color backgroundColor, string format)
{
- System.IO.MemoryStream ms = new System.IO.MemoryStream();
+ var ms = new MemoryStream();
string req = m_reqBuilder.RenderMapLegend(map.Name, width, height, ColorTranslator.ToHtml(backgroundColor), format);
return this.OpenRead(req);
}
- public override System.IO.Stream RenderRuntimeMap(Mapping.RuntimeMap map, double x, double y, double scale, int width, int height, int dpi, string format, bool clip)
+ public override Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi, string format, bool clip)
{
var resourceId = map.ResourceID;
ResourceIdentifier.Validate(resourceId, ResourceTypes.Map);
@@ -1067,7 +1058,7 @@
mapname = mapname.Substring(0, mapname.LastIndexOf("."));
#if DEBUG
string s = m_reqBuilder.GetMapImageUrl(mapname, format, null, x, y, scale, dpi, width, height, clip, null, null, null, null);
- return new System.IO.MemoryStream(this.DownloadData(s));
+ return new MemoryStream(this.DownloadData(s));
#else
System.IO.MemoryStream ms = new System.IO.MemoryStream();
System.Net.WebRequest req = m_reqBuilder.GetMapImage(mapname, format, null, x, y, scale, dpi, width, height, clip, null, null, null, null, ms);
@@ -1099,7 +1090,7 @@
mapname = mapname.Substring(0, mapname.LastIndexOf("."));
#if DEBUG
string s = m_reqBuilder.GetMapImageUrl(mapname, format, null, x1, y1, x2, y2, dpi, width, height, clip, null, null, null, null);
- return new System.IO.MemoryStream(this.DownloadData(s));
+ return new MemoryStream(this.DownloadData(s));
#else
System.IO.MemoryStream ms = new System.IO.MemoryStream();
System.Net.WebRequest req = m_reqBuilder.GetMapImage(mapname, format, null, x1, y1, x2, y2, dpi, width, height, clip, null, null, null, null, ms);
@@ -1125,11 +1116,10 @@
public override bool IsSessionExpiredException(Exception ex)
{
- if (ex != null && ex.GetType() == typeof(System.Net.WebException))
+ var wex = ex as WebException;
+ if (wex != null && (wex.Message.ToLower().IndexOf("session expired") >= 0 || wex.Message.ToLower().IndexOf("session not found") >= 0 || wex.Message.ToLower().IndexOf("mgsessionexpiredexception") >= 0))
{
- System.Net.WebException wex = (System.Net.WebException)ex;
- if (wex.Message.ToLower().IndexOf("session expired") >= 0 || wex.Message.ToLower().IndexOf("session not found") >= 0 || wex.Message.ToLower().IndexOf("mgsessionexpiredexception") >= 0)
- return true;
+ return true;
}
return false;
}
@@ -1139,30 +1129,21 @@
/// </summary>
/// <returns>The avalible application templates on the server</returns>
public IApplicationDefinitionTemplateInfoSet GetApplicationTemplates()
- {
- //TODO: Caching these should be safe
- return (IApplicationDefinitionTemplateInfoSet)base.DeserializeObject(typeof(ApplicationDefinitionTemplateInfoSet), this.OpenRead(m_reqBuilder.EnumerateApplicationTemplates()));
- }
+ => (IApplicationDefinitionTemplateInfoSet)base.DeserializeObject(typeof(ApplicationDefinitionTemplateInfoSet), this.OpenRead(m_reqBuilder.EnumerateApplicationTemplates()));
/// <summary>
/// Returns the avalible application widgets on the server
/// </summary>
/// <returns>The avalible application widgets on the server</returns>
public IApplicationDefinitionWidgetInfoSet GetApplicationWidgets()
- {
- //TODO: Caching these should be safe
- return (IApplicationDefinitionWidgetInfoSet)base.DeserializeObject(typeof(ApplicationDefinitionWidgetInfoSet), this.OpenRead(m_reqBuilder.EnumerateApplicationWidgets()));
- }
+ => (IApplicationDefinitionWidgetInfoSet)base.DeserializeObject(typeof(ApplicationDefinitionWidgetInfoSet), this.OpenRead(m_reqBuilder.EnumerateApplicationWidgets()));
/// <summary>
/// Returns the avalible widget containers on the server
/// </summary>
/// <returns>The avalible widget containers on the server</returns>
public IApplicationDefinitionContainerInfoSet GetApplicationContainers()
- {
- //TODO: Caching these should be safe
- return (IApplicationDefinitionContainerInfoSet)base.DeserializeObject(typeof(ApplicationDefinitionContainerInfoSet), this.OpenRead(m_reqBuilder.EnumerateApplicationContainers()));
- }
+ => (IApplicationDefinitionContainerInfoSet)base.DeserializeObject(typeof(ApplicationDefinitionContainerInfoSet), this.OpenRead(m_reqBuilder.EnumerateApplicationContainers()));
/// <summary>
/// Returns the spatial info for a given featuresource
@@ -1193,7 +1174,7 @@
else if (parts.Length == 1)
req = m_reqBuilder.GetIdentityProperties(resourceID, null, parts[0]);
else
- throw new Exception("Unable to parse classname into class and schema: " + classname);
+ throw new Exception($"Unable to parse classname into class and schema: {classname}");
XmlDocument doc = new XmlDocument();
doc.Load(this.OpenRead(req));
@@ -1216,7 +1197,7 @@
{
if (m_username == null || m_password == null)
if (throwException)
- throw new Exception("Cannot recreate session, because connection was not opened with username and password");
+ throw new Exception("Cannot recreate session, because connection was not opened with username and password"); //LOCALIZEME
else
return false;
@@ -1235,7 +1216,7 @@
{
reqb.SessionID = System.Text.Encoding.Default.GetString(wc.DownloadData(req));
if (reqb.SessionID.IndexOf("<") >= 0)
- throw new Exception("Invalid server token recieved: " + reqb.SessionID);
+ throw new Exception($"Invalid server token recieved: {reqb.SessionID}"); //LOCALIZEME
else
CheckAndRaiseSessionChanged(oldSessionId, reqb.SessionID);
}
@@ -1246,17 +1227,17 @@
try
{
//Retry, and append missing path, if applicable
- if (!hosturl.ToString().EndsWith("/mapagent/mapagent.fcgi"))
+ if (!hosturl.ToString().EndsWith("/mapagent/mapagent.fcgi")) //NOXLATE
{
string tmp = hosturl.ToString();
- if (!tmp.EndsWith("/"))
- tmp += "/";
- hosturl = new Uri(tmp + "mapagent/mapagent.fcgi");
+ if (!tmp.EndsWith("/")) //NOXLATE
+ tmp += "/"; //NOXLATE
+ hosturl = new Uri($"{tmp}mapagent/mapagent.fcgi"); //NOXLATE
reqb = new RequestBuilder(hosturl, locale);
req = reqb.CreateSession();
reqb.SessionID = System.Text.Encoding.Default.GetString(wc.DownloadData(req));
- if (reqb.SessionID.IndexOf("<") >= 0)
- throw new Exception("Invalid server token recieved: " + reqb.SessionID);
+ if (reqb.SessionID.IndexOf("<") >= 0) //NOXLATE
+ throw new Exception($"Invalid server token recieved: {reqb.SessionID}");
ok = true;
}
}
@@ -1269,7 +1250,7 @@
if (ex is WebException) //These exceptions, we just want the underlying message. No need for 50 bajillion nested exceptions
throw;
else //We don't know what this could be so grab everything
- throw new Exception("Failed to connect, perhaps session is expired?\nExtended error info: " + ex.Message, ex);
+ throw new Exception($"Failed to connect, perhaps session is expired?\nExtended error info: {ex.Message}", ex); //LOCALIZEME
}
else
return false;
@@ -1360,7 +1341,7 @@
/// </summary>
/// <param name="req">The request URI</param>
/// <returns>The data at the given location</returns>
- internal System.IO.Stream OpenRead(string req)
+ internal Stream OpenRead(string req)
{
string prev_session = m_reqBuilder.SessionID;
try
@@ -1411,8 +1392,8 @@
public override UnmanagedDataList EnumerateUnmanagedData(string startpath, string filter, bool recursive, UnmanagedDataTypes type)
{
string req = m_reqBuilder.EnumerateUnmanagedData(startpath, filter, recursive, type);
- System.IO.MemoryStream ms = new System.IO.MemoryStream();
- using (System.IO.Stream s = this.OpenRead(req))
+ var ms = new MemoryStream();
+ using (var s = this.OpenRead(req))
Utility.CopyStream(s, ms);
ms.Position = 0;
return (UnmanagedDataList)DeserializeObject(typeof(UnmanagedDataList), ms);
@@ -1426,13 +1407,13 @@
get
{
string baseurl = this.ServerURI;
- if (baseurl.ToLower().EndsWith("/mapagent.fcgi"))
- baseurl = baseurl.Substring(0, baseurl.Length - "mapagent.fcgi".Length);
+ if (baseurl.ToLower().EndsWith("/mapagent.fcgi")) //NOXLATE
+ baseurl = baseurl.Substring(0, baseurl.Length - "mapagent.fcgi".Length); //NOXLATE
- if (baseurl.ToLower().EndsWith("/mapagent/"))
- baseurl = baseurl.Substring(0, baseurl.Length - "mapagent/".Length);
- else if (baseurl.ToLower().EndsWith("/mapagent"))
- baseurl = baseurl.Substring(0, baseurl.Length - "mapagent".Length);
+ if (baseurl.ToLower().EndsWith("/mapagent/")) //NOXLATE
+ baseurl = baseurl.Substring(0, baseurl.Length - "mapagent/".Length); //NOXLATE
+ else if (baseurl.ToLower().EndsWith("/mapagent")) //NOXLATE
+ baseurl = baseurl.Substring(0, baseurl.Length - "mapagent".Length); //NOXLATE
return baseurl;
}
@@ -1446,10 +1427,10 @@
/// <param name="themeIndex">If the layer is themed, this gives the theme index, otherwise set to 0</param>
/// <param name="type">The geometry type, 1 for point, 2 for line, 3 for area, 4 for composite</param>
/// <returns>The minature bitmap</returns>
- public override System.Drawing.Image GetLegendImage(double scale, string layerdefinition, int themeIndex, int type, int width, int height, string format)
+ public override Image GetLegendImage(double scale, string layerdefinition, int themeIndex, int type, int width, int height, string format)
{
string param = m_reqBuilder.GetLegendImage(scale, layerdefinition, themeIndex, type, width, height, format);
- return new System.Drawing.Bitmap(this.OpenRead(param));
+ return new Bitmap(this.OpenRead(param));
}
/// <summary>
@@ -1461,17 +1442,19 @@
{
try
{
- using (System.IO.FileStream fs = new System.IO.FileStream(filename, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.Read))
+ using (var fs = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read))
{
- System.Net.WebRequest req = m_reqBuilder.ApplyPackage(fs, callback);
+ var req = m_reqBuilder.ApplyPackage(fs, callback);
req.Credentials = _cred;
req.GetRequestStream().Flush();
req.GetRequestStream().Close();
byte[] buf = new byte[1];
- System.IO.Stream s = req.GetResponse().GetResponseStream();
- s.Read(buf, 0, 1);
- s.Close();
+ using (var s = req.GetResponse().GetResponseStream())
+ {
+ s.Read(buf, 0, 1);
+ s.Close();
+ }
}
}
catch (Exception ex)
@@ -1491,15 +1474,17 @@
{
try
{
- System.Net.WebRequest req = m_reqBuilder.UpdateRepository(resourceId, this.SerializeObject(header));
+ var req = m_reqBuilder.UpdateRepository(resourceId, this.SerializeObject(header));
req.Credentials = _cred;
req.GetRequestStream().Flush();
req.GetRequestStream().Close();
byte[] buf = new byte[1];
- System.IO.Stream s = req.GetResponse().GetResponseStream();
- s.Read(buf, 0, 1);
- s.Close();
+ using (var s = req.GetResponse().GetResponseStream())
+ {
+ s.Read(buf, 0, 1);
+ s.Close();
+ }
}
catch (Exception ex)
{
@@ -1514,14 +1499,16 @@
}
}
- public override object GetFolderOrResourceHeader(string resourceID)
+ public override object GetFolderOrResourceHeader(string resourceId)
{
- string req = m_reqBuilder.GetResourceHeader(resourceID);
- using (System.IO.Stream s = this.OpenRead(req))
- if (ResourceIdentifier.IsFolderResource(resourceID))
+ string req = m_reqBuilder.GetResourceHeader(resourceId);
+ using (var s = this.OpenRead(req))
+ {
+ if (ResourceIdentifier.IsFolderResource(resourceId))
return this.DeserializeObject<ResourceFolderHeaderType>(s);
else
return this.DeserializeObject<ResourceDocumentHeaderType>(s);
+ }
}
/// <summary>
@@ -1534,7 +1521,7 @@
if (m_cachedUserList == null)
{
string req = m_reqBuilder.EnumerateUsers(group);
- using (System.IO.Stream s = this.OpenRead(req))
+ using (var s = this.OpenRead(req))
m_cachedUserList = this.DeserializeObject<UserList>(s);
}
return m_cachedUserList;
@@ -1549,24 +1536,24 @@
if (m_cachedGroupList == null)
{
string req = m_reqBuilder.EnumerateGroups();
- using (System.IO.Stream s = this.OpenRead(req))
+ using (var s = this.OpenRead(req))
m_cachedGroupList = this.DeserializeObject<GroupList>(s);
}
return m_cachedGroupList;
}
- public override bool ResourceExists(string resourceid)
+ public override bool ResourceExists(string resourceID)
{
try
{
- string req = m_reqBuilder.ResourceExists(resourceid);
- using (System.IO.Stream s = this.OpenRead(req))
- using (System.IO.StreamReader sr = new System.IO.StreamReader(s))
+ string req = m_reqBuilder.ResourceExists(resourceID);
+ using (var s = this.OpenRead(req))
+ using (var sr = new System.IO.StreamReader(s))
return sr.ReadToEnd().Trim().Equals("true", StringComparison.InvariantCultureIgnoreCase);
}
catch (Exception ex)
{
- try { return base.ResourceExists(resourceid); }
+ try { return base.ResourceExists(resourceID); }
catch { throw ex; } //Throw original error
}
}
@@ -1574,9 +1561,9 @@
public string[] GetConnectionPropertyValues(string providerName, string propertyName, string partialConnectionString)
{
string req = m_reqBuilder.GetConnectionPropertyValues(providerName, propertyName, partialConnectionString);
- using (System.IO.Stream s = this.OpenRead(req))
+ using (var s = this.OpenRead(req))
{
- OSGeo.MapGuide.ObjectModels.Common.StringCollection strc = this.DeserializeObject<OSGeo.MapGuide.ObjectModels.Common.StringCollection>(s);
+ var strc = this.DeserializeObject<OSGeo.MapGuide.ObjectModels.Common.StringCollection>(s);
return strc.Item.ToArray();
}
}
@@ -1594,7 +1581,7 @@
#endregion IDisposable Members
- public override System.IO.Stream GetTile(string mapdefinition, string baselayergroup, int col, int row, int scaleindex, string format)
+ public override Stream GetTile(string mapdefinition, string baselayergroup, int col, int row, int scaleindex, string format)
{
string req = string.Empty;
if (mAnonymousUser)
@@ -1624,25 +1611,13 @@
}
}
- public bool SupportsResourcePreviews
- {
- get { return true; }
- }
+ public bool SupportsResourcePreviews => true;
- public IFeatureService FeatureService
- {
- get { return this; }
- }
+ public IFeatureService FeatureService => this;
- public IResourceService ResourceService
- {
- get { return this; }
- }
+ public IResourceService ResourceService => this;
- public IConnectionCapabilities Capabilities
- {
- get { return new HttpCapabilities(this); }
- }
+ public IConnectionCapabilities Capabilities => new HttpCapabilities(this);
public IService GetService(int serviceType)
{
@@ -1665,13 +1640,10 @@
throw new UnsupportedServiceTypeException(st);
}
- public const string PROP_USER_AGENT = "UserAgent";
- public const string PROP_BASE_URL = "BaseUrl";
+ public const string PROP_USER_AGENT = "UserAgent"; //NOXLATE
+ public const string PROP_BASE_URL = "BaseUrl"; //NOXLATE
- public override string[] GetCustomPropertyNames()
- {
- return new string[] { PROP_USER_AGENT, PROP_BASE_URL };
- }
+ public override string[] GetCustomPropertyNames() => new string[] { PROP_USER_AGENT, PROP_BASE_URL };
/// <summary>
/// Gets or sets the number of worker threads to spawn when initializing
@@ -1711,12 +1683,9 @@
throw new CustomPropertyNotFoundException();
}
- protected override IServerConnection GetInterface()
- {
- return this;
- }
+ protected override IServerConnection GetInterface() => this;
- public System.IO.Stream DescribeDrawing(string resourceID)
+ public Stream DescribeDrawing(string resourceID)
{
string req = m_reqBuilder.DescribeDrawing(resourceID);
return this.OpenRead(resourceID);
@@ -1725,7 +1694,7 @@
public string[] EnumerateDrawingLayers(string resourceID, string sectionName)
{
string req = m_reqBuilder.EnumerateDrawingLayers(resourceID, sectionName);
- using (System.IO.Stream s = this.OpenRead(req))
+ using (var s = this.OpenRead(req))
{
var list = this.DeserializeObject<OSGeo.MapGuide.ObjectModels.Common.StringCollection>(s);
//Workaround for #1727
@@ -1742,43 +1711,43 @@
public DrawingSectionResourceList EnumerateDrawingSectionResources(string resourceID, string sectionName)
{
string req = m_reqBuilder.EnumerateDrawingSectionResources(resourceID, sectionName);
- using (System.IO.Stream s = this.OpenRead(req))
+ using (var s = this.OpenRead(req))
return this.DeserializeObject<DrawingSectionResourceList>(s);
}
public DrawingSectionList EnumerateDrawingSections(string resourceID)
{
string req = m_reqBuilder.EnumerateDrawingSections(resourceID);
- using (System.IO.Stream s = this.OpenRead(req))
+ using (var s = this.OpenRead(req))
return this.DeserializeObject<DrawingSectionList>(s);
}
public string GetDrawingCoordinateSpace(string resourceID)
{
string req = m_reqBuilder.GetDrawingCoordinateSpace(resourceID);
- using (System.IO.StreamReader s = new System.IO.StreamReader(this.OpenRead(req)))
+ using (var s = new StreamReader(this.OpenRead(req)))
return s.ReadToEnd();
}
- public System.IO.Stream GetDrawing(string resourceID)
+ public Stream GetDrawing(string resourceID)
{
string req = m_reqBuilder.GetDrawing(resourceID);
return this.OpenRead(req);
}
- public System.IO.Stream GetLayer(string resourceID, string sectionName, string layerName)
+ public Stream GetLayer(string resourceID, string sectionName, string layerName)
{
string req = m_reqBuilder.GetDrawingLayer(resourceID, sectionName, layerName);
return this.OpenRead(req);
}
- public System.IO.Stream GetSection(string resourceID, string sectionName)
+ public Stream GetSection(string resourceID, string sectionName)
{
string req = m_reqBuilder.GetDrawingSection(resourceID, sectionName);
return this.OpenRead(req);
}
- public System.IO.Stream GetSectionResource(string resourceID, string resourceName)
+ public Stream GetSectionResource(string resourceID, string resourceName)
{
string req = m_reqBuilder.GetDrawingSectionResource(resourceID, resourceName);
return this.OpenRead(req);
@@ -1787,7 +1756,7 @@
public override DataStoreList EnumerateDataStores(string providerName, string partialConnString)
{
string req = m_reqBuilder.EnumerateDataStores(providerName, partialConnString);
- using (System.IO.Stream s = this.OpenRead(req))
+ using (var s = this.OpenRead(req))
{
var list = this.DeserializeObject<OSGeo.MapGuide.ObjectModels.Common.DataStoreList>(s);
return list;
@@ -1798,7 +1767,7 @@
{
string req = m_reqBuilder.GetProviderCapabilities(provider);
- var o = DeserializeObject<OSGeo.MapGuide.ObjectModels.Capabilities.v1_1_0.FdoProviderCapabilities>(this.OpenRead(req));
+ var o = DeserializeObject<ObjectModels.Capabilities.v1_1_0.FdoProviderCapabilities>(this.OpenRead(req));
return o;
}
@@ -1828,9 +1797,9 @@
newpath = FixAndValidateFolderPath(newpath);
string req = m_reqBuilder.MoveResource(oldpath, newpath, true);
- req += "&CASCADE=1";
+ req += "&CASCADE=1"; //NOXLATE
- using (System.IO.Stream resp = this.OpenRead(req))
+ using (var resp = this.OpenRead(req))
resp.ReadByte();
return true;
@@ -1852,9 +1821,9 @@
progress(this, la);
string req = m_reqBuilder.MoveResource(oldpath, newpath, true);
- req += "&CASCADE=1";
+ req += "&CASCADE=1"; //NOXLATE
- using (System.IO.Stream resp = this.OpenRead(req))
+ using (var resp = this.OpenRead(req))
resp.ReadByte();
return true;
@@ -1865,16 +1834,16 @@
}
}
- public override string QueryMapFeatures(Mapping.RuntimeMap map, int maxFeatures, string wkt, bool persist, string selectionVariant, QueryMapOptions extraOptions)
+ public override string QueryMapFeatures(RuntimeMap rtMap, int maxFeatures, string wkt, bool persist, string selectionVariant, QueryMapOptions extraOptions)
{
- string runtimeMapName = map.Name;
+ string runtimeMapName = rtMap.Name;
//The request may execeed the url limit of the server, when large geometries
- System.IO.MemoryStream ms = new System.IO.MemoryStream();
- System.Net.WebRequest req = m_reqBuilder.QueryMapFeatures(runtimeMapName, maxFeatures, wkt, persist, selectionVariant, extraOptions, ms);
+ var ms = new MemoryStream();
+ var req = m_reqBuilder.QueryMapFeatures(runtimeMapName, maxFeatures, wkt, persist, selectionVariant, extraOptions, ms);
req.Timeout = 200 * 1000;
ms.Position = 0;
- using (System.IO.Stream rs = req.GetRequestStream())
+ using (var rs = req.GetRequestStream())
{
Utility.CopyStream(ms, rs);
rs.Flush();
@@ -1944,7 +1913,7 @@
public override IServerConnection Clone()
{
if (this.IsAnonymous)
- return new HttpServerConnection(new Uri(this.ServerURI), "Anonymous", "", null, true);
+ return new HttpServerConnection(new Uri(this.ServerURI), "Anonymous", string.Empty, null, true); //NOXLATE
else
return new HttpServerConnection(new Uri(this.ServerURI), this.SessionID, null, true);
}
@@ -2029,10 +1998,7 @@
}
}
- public override Resource.Preview.IResourcePreviewUrlGenerator GetPreviewUrlGenerator()
- {
- return new HttpResourcePreviewUrlGenerator(this, m_reqBuilder.HostURI);
- }
+ public override Resource.Preview.IResourcePreviewUrlGenerator GetPreviewUrlGenerator() => new HttpResourcePreviewUrlGenerator(this, m_reqBuilder.HostURI);
internal TileProviderList GetTileProviders()
{
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/RequestBuilder.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/RequestBuilder.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/RequestBuilder.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -33,8 +33,8 @@
/// </summary>
internal class RequestBuilder
{
- private string m_userAgent = "MapGuide Maestro API";
- private string m_hosturi;
+ private string m_userAgent = "MapGuide Maestro API"; //NOXLATE
+ private readonly string m_hosturi;
private string m_sessionID = null;
private string m_locale = null;
@@ -57,9 +57,9 @@
/// the HTTP connection was initialized with only a session id, otherwise it can be set to false if the connection
/// was initialized with a username/password as requests use the already established authenticated credentials.
/// </summary>
- internal bool IncludeSessionIdInRequestParams { get; private set; }
+ internal bool IncludeSessionIdInRequestParams { get; }
- internal string Locale { get { return m_locale; } }
+ internal string Locale => m_locale;
internal string CreateSession()
{
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/XmlReaderBase.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/XmlReaderBase.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/XmlReaderBase.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -69,7 +69,7 @@
InitCommon(stream);
}
- public XmlReaderBase(HttpWebResponse resp)
+ protected XmlReaderBase(HttpWebResponse resp)
{
_resp = resp;
try
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/XmlRecord.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/XmlRecord.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/XmlRecord.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -37,9 +37,9 @@
this.Type = pvtype;
}
- public string Name { get; private set; }
+ public string Name { get; }
- public PropertyValueType Type { get; private set; }
+ public PropertyValueType Type { get; }
}
public class XmlRecord : RecordBase
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -77,7 +77,7 @@
Trace.TraceInformation("MapGuide Platform initialized in {0}ms", sw.ElapsedMilliseconds);
}
- public override OSGeo.MapGuide.MaestroAPI.Commands.ICommand CreateCommand(int cmdType)
+ public override ICommand CreateCommand(int cmdType)
{
CommandType ct = (CommandType)cmdType;
switch (ct)
@@ -107,7 +107,7 @@
get { return PROVIDER_NAME; }
}
- public override System.Collections.Specialized.NameValueCollection CloneParameters
+ public override NameValueCollection CloneParameters
{
get
{
@@ -120,18 +120,9 @@
private string _sessionId;
- public override string SessionID
- {
- get
- {
- return _sessionId;
- }
- }
+ public override string SessionID => _sessionId;
- protected override IServerConnection GetInterface()
- {
- return this;
- }
+ protected override IServerConnection GetInterface() => this;
private string _configFile;
private const string PARAM_CONFIG = "ConfigFile";
@@ -234,7 +225,7 @@
OnRequestDispatched(method + "(" + string.Join(", ", values) + ") " + ((success) ? "Success" : "Failure"));
}
- public override System.IO.Stream GetResourceXmlData(string resourceID)
+ public override Stream GetResourceXmlData(string resourceID)
{
var res = GetResourceService();
//var result = Native.Utility.MgStreamToNetStream(res, res.GetType().GetMethod("GetResourceContent"), new object[] { new MgResourceIdentifier(resourceID) });
@@ -415,7 +406,7 @@
callback(fi.Length, 0, fi.Length);
}
- public override void UpdateRepository(string resourceId, OSGeo.MapGuide.ObjectModels.Common.ResourceFolderHeaderType header)
+ public override void UpdateRepository(string resourceId, ResourceFolderHeaderType header)
{
throw new NotImplementedException();
}
@@ -432,9 +423,9 @@
}
}
- public override void SetResourceXmlData(string resourceid, System.IO.Stream content, System.IO.Stream header)
+ public override void SetResourceXmlData(string resourceId, Stream content, Stream header)
{
- bool exists = ResourceExists(resourceid);
+ bool exists = ResourceExists(resourceId);
var res = GetResourceService();
byte[] bufHeader = header == null ? new byte[0] : Utility.StreamAsArray(header);
@@ -458,12 +449,12 @@
rC = source.GetReader();
}
- res.SetResource(new MgResourceIdentifier(resourceid), rC, rH);
- LogMethodCall("MgResourceService::SetResource", true, resourceid, "MgByteReader", "MgByteReader");
+ res.SetResource(new MgResourceIdentifier(resourceId), rC, rH);
+ LogMethodCall("MgResourceService::SetResource", true, resourceId, "MgByteReader", "MgByteReader");
if (exists)
- OnResourceUpdated(resourceid);
+ OnResourceUpdated(resourceId);
else
- OnResourceAdded(resourceid);
+ OnResourceAdded(resourceId);
}
public override UnmanagedDataList EnumerateUnmanagedData(string startpath, string filter, bool recursive, UnmanagedDataTypes type)
@@ -499,10 +490,7 @@
{
var fes = GetFeatureService();
MgSpatialContextReader rd = fes.GetSpatialContexts(new MgResourceIdentifier(resourceID), activeOnly);
- GetByteReaderMethod fetch = () =>
- {
- return rd.ToXml();
- };
+ GetByteReaderMethod fetch = rd.ToXml;
LogMethodCall("MgFeatureService::GetSpatialContexts", true, resourceID, activeOnly.ToString());
return base.DeserializeObject<FdoSpatialContextList>(new MgReadOnlyStream(fetch));
}
@@ -541,15 +529,15 @@
}
}
- throw new Exception("Unable to find class: " + parts[1] + " in schema " + parts[0]);
+ throw new Exception($"Unable to find class: {parts[1]} in schema {parts[0]}"); //LOCALIZEME
}
- protected override FeatureSourceDescription DescribeFeatureSourceInternal(string resourceID)
+ protected override FeatureSourceDescription DescribeFeatureSourceInternal(string resourceId)
{
var fes = GetFeatureService();
- MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(fes.DescribeSchemaAsXml(new MgResourceIdentifier(resourceID), "")));
+ MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(fes.DescribeSchemaAsXml(new MgResourceIdentifier(resourceId), "")));
- LogMethodCall("MgFeatureService::DescribeSchemaAsXml", true, resourceID, "");
+ LogMethodCall("MgFeatureService::DescribeSchemaAsXml", true, resourceId, string.Empty);
return new FeatureSourceDescription(ms);
}
@@ -728,15 +716,15 @@
return new LocalNativeSqlReader(reader);
}
- public override IFeatureReader QueryFeatureSource(string resourceID, string schema, string query, string[] columns, NameValueCollection computedProperties)
+ public override IFeatureReader QueryFeatureSource(string resourceID, string className, string filter, string[] propertyNames, NameValueCollection computedProperties)
{
var fes = GetFeatureService();
MgFeatureQueryOptions mgf = new MgFeatureQueryOptions();
- if (query != null)
- mgf.SetFilter(query);
+ if (filter != null)
+ mgf.SetFilter(filter);
- if (columns != null && columns.Length != 0)
- foreach (string s in columns)
+ if (propertyNames != null && propertyNames.Length != 0)
+ foreach (string s in propertyNames)
mgf.AddFeatureProperty(s);
if (computedProperties != null && computedProperties.Count > 0)
@@ -744,9 +732,9 @@
mgf.AddComputedProperty(s, computedProperties[s]);
var fsId = new MgResourceIdentifier(resourceID);
- MgFeatureReader mr = fes.SelectFeatures(fsId, schema, mgf);
+ MgFeatureReader mr = fes.SelectFeatures(fsId, className, mgf);
- LogMethodCall("MgFeatureService::SelectFeatures", true, resourceID, schema, "MgFeatureQueryOptions");
+ LogMethodCall("MgFeatureService::SelectFeatures", true, resourceID, className, "MgFeatureQueryOptions");
return new LocalNativeFeatureReader(mr);
}
@@ -1081,7 +1069,7 @@
{
var impl = parent as LocalRuntimeMap;
if (impl == null)
- throw new ArgumentException("Instance is not a LocalRuntimeMap", "map"); //LOCALIZEME
+ throw new ArgumentException("Instance is not a LocalRuntimeMap", nameof(parent)); //LOCALIZEME
var rtGroup = new MgLayerGroup(group.Name);
rtGroup.DisplayInLegend = group.ShowInLegend;
@@ -1097,7 +1085,7 @@
{
var impl = parent as LocalRuntimeMap;
if (impl == null)
- throw new ArgumentException("Instance is not a LocalRuntimeMap", "map"); //LOCALIZEME
+ throw new ArgumentException("Instance is not a LocalRuntimeMap", nameof(parent)); //LOCALIZEME
var rtGroup = new MgLayerGroup(group.Name);
rtGroup.DisplayInLegend = group.ShowInLegend;
@@ -1124,7 +1112,7 @@
{
var impl = parent as LocalRuntimeMap;
if (impl == null)
- throw new ArgumentException("Instance is not a LocalRuntimeMap", "map"); //LOCALIZEME
+ throw new ArgumentException("Instance is not a LocalRuntimeMap", nameof(parent)); //LOCALIZEME
var group = new MgLayerGroup(name);
return new LocalRuntimeMapGroup(impl, group);
@@ -1134,7 +1122,7 @@
{
var impl = parent as LocalRuntimeMap;
if (impl == null)
- throw new ArgumentException("Instance is not a LocalRuntimeMap", "map"); //LOCALIZEME
+ throw new ArgumentException("Instance is not a LocalRuntimeMap", nameof(parent)); //LOCALIZEME
var ldfId = new MgResourceIdentifier(ldf.ResourceID);
var layer = new MgdLayer(ldfId, GetResourceService());
@@ -1158,11 +1146,11 @@
return impl;
}
- public Stream RenderDynamicOverlay(Mapping.RuntimeMap map, Mapping.MapSelection selection, string format, bool keepSelection)
+ public Stream RenderDynamicOverlay(RuntimeMap map, MapSelection selection, string format, bool keepSelection)
{
var impl = map as LocalRuntimeMap;
if (impl == null)
- throw new ArgumentException("Instance is not a LocalRuntimeMap", "map"); //LOCALIZEME
+ throw new ArgumentException("Instance is not a LocalRuntimeMap", nameof(map)); //LOCALIZEME
var renderSvc = GetRenderingService();
GetByteReaderMethod fetch = () =>
{
@@ -1173,11 +1161,11 @@
return new MgReadOnlyStream(fetch);
}
- public Stream RenderDynamicOverlay(Mapping.RuntimeMap map, Mapping.MapSelection selection, string format, System.Drawing.Color selectionColor, int behaviour)
+ public Stream RenderDynamicOverlay(RuntimeMap map, MapSelection selection, string format, System.Drawing.Color selectionColor, int behaviour)
{
var impl = map as LocalRuntimeMap;
if (impl == null)
- throw new ArgumentException("Instance is not a LocalRuntimeMap", "map"); //LOCALIZEME
+ throw new ArgumentException("Instance is not a LocalRuntimeMap", nameof(map)); //LOCALIZEME
var renderSvc = GetRenderingService();
GetByteReaderMethod fetch = () =>
{
@@ -1213,7 +1201,7 @@
{
var impl = map as LocalRuntimeMap;
if (impl == null)
- throw new ArgumentException("Instance is not a LocalRuntimeMap", "map"); //LOCALIZEME
+ throw new ArgumentException("Instance is not a LocalRuntimeMap", nameof(map)); //LOCALIZEME
var implMap = impl.GetWrappedInstance();
var renderSvc = GetRenderingService();
GetByteReaderMethod fetch = () =>
@@ -1248,7 +1236,7 @@
{
var impl = map as LocalRuntimeMap;
if (impl == null)
- throw new ArgumentException("Instance is not a LocalRuntimeMap", "map"); //LOCALIZEME
+ throw new ArgumentException("Instance is not a LocalRuntimeMap", nameof(map)); //LOCALIZEME
var implMap = impl.GetWrappedInstance();
var renderSvc = GetRenderingService();
GetByteReaderMethod fetch = () =>
@@ -1268,7 +1256,7 @@
{
var impl = map as LocalRuntimeMap;
if (impl == null)
- throw new ArgumentException("Instance is not a LocalRuntimeMap", "map"); //LOCALIZEME
+ throw new ArgumentException("Instance is not a LocalRuntimeMap", nameof(map)); //LOCALIZEME
var renderSvc = GetRenderingService();
GetByteReaderMethod fetch = () =>
{
@@ -1298,7 +1286,7 @@
{
var impl = rtMap as LocalRuntimeMap;
if (impl == null)
- throw new ArgumentException("Instance is not a LocalRuntimeMap", "map"); //LOCALIZEME
+ throw new ArgumentException("Instance is not a LocalRuntimeMap", nameof(rtMap)); //LOCALIZEME
var rs = GetRenderingService();
var res = GetResourceService();
@@ -1309,16 +1297,23 @@
string featureFilter = "";
int layerAttributeFilter = 0;
int op = MgFeatureSpatialOperations.Intersects;
- if (selectionVariant == "TOUCHES")
- op = MgFeatureSpatialOperations.Touches;
- else if (selectionVariant == "INTERSECTS")
- op = MgFeatureSpatialOperations.Intersects;
- else if (selectionVariant == "WITHIN")
- op = MgFeatureSpatialOperations.Within;
- else if (selectionVariant == "ENVELOPEINTERSECTS")
- op = MgFeatureSpatialOperations.EnvelopeIntersects;
- else
- throw new ArgumentException("Unknown or unsupported selection variant: " + selectionVariant);
+ switch (selectionVariant)
+ {
+ case "TOUCHES":
+ op = MgFeatureSpatialOperations.Touches;
+ break;
+ case "INTERSECTS":
+ op = MgFeatureSpatialOperations.Intersects;
+ break;
+ case "WITHIN":
+ op = MgFeatureSpatialOperations.Within;
+ break;
+ case "ENVELOPEINTERSECTS":
+ op = MgFeatureSpatialOperations.EnvelopeIntersects;
+ break;
+ default:
+ throw new ArgumentException("Unknown or unsupported selection variant: " + selectionVariant);
+ }
if (extraOptions != null)
{
@@ -1336,7 +1331,7 @@
MgdFeatureInformation info = rs.QueryFeatures(map, layerNames, r.Read(wkt), op, featureFilter, maxFeatures, layerAttributeFilter);
string xml = "";
- GetByteReaderMethod fetch = () => { return info.ToXml(); };
+ GetByteReaderMethod fetch = info.ToXml;
using (var sr = new StreamReader(new MgReadOnlyStream(fetch)))
{
xml = sr.ReadToEnd();
@@ -1381,46 +1376,22 @@
this.IsFrozen = rdr.IsFrozen();
}
- public string Name
- {
- get;
- private set;
- }
+ public string Name { get; }
- public string Description
- {
- get;
- private set;
- }
+ public string Description { get; }
- public string Owner
- {
- get;
- private set;
- }
+ public string Owner { get; }
- public string CreationDate
- {
- get;
- private set;
- }
+ public string CreationDate { get; }
- public bool IsActive
- {
- get;
- private set;
- }
+ public bool IsActive { get; }
- public bool IsFrozen
- {
- get;
- private set;
- }
+ public bool IsFrozen { get; }
}
internal class LocalLongTransactionList : ILongTransactionList
{
- private List<LocalLongTransaction> _transactions;
+ private readonly List<LocalLongTransaction> _transactions;
public LocalLongTransactionList(MgLongTransactionReader rdr)
{
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalRuntimeMap.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalRuntimeMap.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalRuntimeMap.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -263,7 +263,7 @@
}
set
{
- Action<double> setter = (val) => { _impl.SetViewScale(val); };
+ Action<double> setter = _impl.SetViewScale;
ObservableSet(_impl.ViewScale, value, setter, "ViewScale");
}
}
@@ -436,7 +436,7 @@
set
{
if (_disableChangeTracking) return; //Still initializing it seems
- Action<bool> setter = (val) => { _impl.SetDisplayInLegend(val); };
+ Action<bool> setter = _impl.SetDisplayInLegend;
ObservableSet(_impl.GetDisplayInLegend(), value, setter, "ShowInLegend");
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Commands/FeatureCommandsImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Commands/FeatureCommandsImpl.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Commands/FeatureCommandsImpl.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -71,9 +71,9 @@
internal static class GeomConverter
{
- private static MgAgfReaderWriter _agfRw;
+ private static readonly MgAgfReaderWriter _agfRw;
private static MgWktReaderWriter _wktRw;
- private static FixedWKTReader _reader;
+ private static readonly FixedWKTReader _reader;
static GeomConverter()
{
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Commands/LocalGetResourceContents.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Commands/LocalGetResourceContents.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Commands/LocalGetResourceContents.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -107,10 +107,6 @@
return resources;
}
- public IServerConnection Parent
- {
- get;
- private set;
- }
+ public IServerConnection Parent { get; }
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -191,20 +191,17 @@
get
{
MgFeatureService fes = this.Connection.CreateService(MgServiceType.FeatureService) as MgFeatureService;
- GetByteReaderMethod fetch = () =>
- {
- return fes.GetFeatureProviders();
- };
+ GetByteReaderMethod fetch = fes.GetFeatureProviders;
LogMethodCall("MgFeatureService::GetFeatureProviders", true);
var reg = base.DeserializeObject<FeatureProviderRegistry>(new MgReadOnlyStream(fetch));
return reg.FeatureProvider.ToArray();
}
}
- public string TestConnection(string providername, System.Collections.Specialized.NameValueCollection parameters)
+ public string TestConnection(string providername, NameValueCollection parameters)
{
MgFeatureService fes = this.Connection.CreateService(MgServiceType.FeatureService) as MgFeatureService;
- System.Text.StringBuilder sb = new System.Text.StringBuilder();
+ var sb = new StringBuilder();
if (parameters != null)
{
foreach (System.Collections.DictionaryEntry de in parameters)
@@ -260,9 +257,9 @@
return new MgReadOnlyStream(fetch);
}
- public override void SetResourceXmlData(string resourceid, System.IO.Stream content, System.IO.Stream header)
+ public override void SetResourceXmlData(string resourceId, Stream content, System.IO.Stream header)
{
- bool exists = ResourceExists(resourceid);
+ bool exists = ResourceExists(resourceId);
MgResourceService res = this.Connection.CreateService(MgServiceType.ResourceService) as MgResourceService;
@@ -270,12 +267,12 @@
byte[] bufContent = content == null ? new byte[0] : Utility.StreamAsArray(content);
MgByteReader rH = bufHeader.Length == 0 ? null : new MgByteReader(bufHeader, bufHeader.Length, "text/xml");
MgByteReader rC = bufContent.Length == 0 ? null : new MgByteReader(bufContent, bufContent.Length, "text/xml");
- res.SetResource(new MgResourceIdentifier(resourceid), rC, rH);
- LogMethodCall("MgResourceService::SetResource", true, resourceid, "MgByteReader", "MgByteReader");
+ res.SetResource(new MgResourceIdentifier(resourceId), rC, rH);
+ LogMethodCall("MgResourceService::SetResource", true, resourceId, "MgByteReader", "MgByteReader");
if (exists)
- OnResourceUpdated(resourceid);
+ OnResourceUpdated(resourceId);
else
- OnResourceAdded(resourceid);
+ OnResourceAdded(resourceId);
}
public IReader ExecuteSqlQuery(string featureSourceID, string sql)
@@ -286,24 +283,24 @@
return new LocalNativeSqlReader(reader);
}
- public override IFeatureReader QueryFeatureSource(string resourceID, string schema, string query, string[] columns, System.Collections.Specialized.NameValueCollection computedProperties)
+ public override IFeatureReader QueryFeatureSource(string resourceID, string className, string filter, string[] propertyNames, NameValueCollection computedProperties)
{
MgFeatureService fes = this.Connection.CreateService(MgServiceType.FeatureService) as MgFeatureService;
MgFeatureQueryOptions mgf = new MgFeatureQueryOptions();
- if (query != null)
- mgf.SetFilter(query);
+ if (filter != null)
+ mgf.SetFilter(filter);
- if (columns != null && columns.Length != 0)
- foreach (string s in columns)
+ if (propertyNames != null && propertyNames.Length != 0)
+ foreach (string s in propertyNames)
mgf.AddFeatureProperty(s);
if (computedProperties != null && computedProperties.Count > 0)
foreach (string s in computedProperties.Keys)
mgf.AddComputedProperty(s, computedProperties[s]);
- MgFeatureReader mr = fes.SelectFeatures(new MgResourceIdentifier(resourceID), schema, mgf);
+ MgFeatureReader mr = fes.SelectFeatures(new MgResourceIdentifier(resourceID), className, mgf);
- LogMethodCall("MgFeatureService::SelectFeatures", true, resourceID, schema, "MgFeatureQueryOptions");
+ LogMethodCall("MgFeatureService::SelectFeatures", true, resourceID, className, "MgFeatureQueryOptions");
return new LocalNativeFeatureReader(mr);
}
@@ -331,21 +328,17 @@
}
public override IReader AggregateQueryFeatureSource(string resourceID, string schema, string filter, string[] columns)
- {
- return AggregateQueryFeatureSourceCore(resourceID, schema, filter, columns, null);
- }
+ => AggregateQueryFeatureSourceCore(resourceID, schema, filter, columns, null);
- public override IReader AggregateQueryFeatureSource(string resourceID, string schema, string filter, System.Collections.Specialized.NameValueCollection aggregateFunctions)
- {
- return AggregateQueryFeatureSourceCore(resourceID, schema, filter, null, aggregateFunctions);
- }
+ public override IReader AggregateQueryFeatureSource(string resourceID, string schema, string filter, NameValueCollection aggregateFunctions)
+ => AggregateQueryFeatureSourceCore(resourceID, schema, filter, null, aggregateFunctions);
- protected override FeatureSourceDescription DescribeFeatureSourceInternal(string resourceID)
+ protected override FeatureSourceDescription DescribeFeatureSourceInternal(string resourceId)
{
MgFeatureService fes = this.Connection.CreateService(MgServiceType.FeatureService) as MgFeatureService;
- System.IO.MemoryStream ms = new System.IO.MemoryStream(System.Text.Encoding.UTF8.GetBytes(fes.DescribeSchemaAsXml(new MgResourceIdentifier(resourceID), "")));
+ var ms = new MemoryStream(Encoding.UTF8.GetBytes(fes.DescribeSchemaAsXml(new MgResourceIdentifier(resourceId), "")));
- LogMethodCall("MgFeatureService::DescribeSchemaAsXml", true, resourceID, "");
+ LogMethodCall("MgFeatureService::DescribeSchemaAsXml", true, resourceId, "");
return new FeatureSourceDescription(ms);
}
@@ -577,9 +570,9 @@
OnResourceAdded(newpath);
}
- public override System.IO.Stream RenderRuntimeMap(RuntimeMap rtmap, double x, double y, double scale, int width, int height, int dpi, string format, bool clip)
+ public override Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi, string format, bool clip)
{
- var resourceId = rtmap.ResourceID;
+ var resourceId = map.ResourceID;
MgRenderingService rnd = this.Connection.CreateService(MgServiceType.RenderingService) as MgRenderingService;
MgResourceService res = this.Connection.CreateService(MgServiceType.ResourceService) as MgResourceService;
MgGeometryFactory gf = new MgGeometryFactory();
@@ -588,21 +581,21 @@
GetByteReaderMethod fetch = () =>
{
- MgMap map = new MgMap();
- map.Open(res, mapname);
- MgSelection sel = new MgSelection(map);
+ MgMap m = new MgMap();
+ m.Open(res, mapname);
+ MgSelection sel = new MgSelection(m);
//The color accepted by MgColor has alpha as the last value, but the returned has alpha first
- MgColor color = new MgColor(Utility.ParseHTMLColor(map.GetBackgroundColor()));
+ MgColor color = new MgColor(Utility.ParseHTMLColor(m.GetBackgroundColor()));
MgCoordinate coord = gf.CreateCoordinateXY(x, y);
- return rnd.RenderMap(map, sel, coord, scale, width, height, color, format, true);
+ return rnd.RenderMap(m, sel, coord, scale, width, height, color, format, true);
};
- LogMethodCall("MgRenderingService::RenderMap", true, "MgMap", "MgSelection", "MgPoint(" + x + "," + y + ")", scale.ToString(), width.ToString(), height.ToString(), "MgColor", format, true.ToString());
+ LogMethodCall("MgRenderingService::RenderMap", true, nameof(MgMap), nameof(MgSelection), $"{nameof(MgPoint)}({x}, {y})", scale.ToString(), width.ToString(), height.ToString(), nameof(MgColor), format, true.ToString());
return new MgReadOnlyStream(fetch);
}
- public override System.IO.Stream RenderRuntimeMap(RuntimeMap rtmap, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format, bool clip)
+ public override Stream RenderRuntimeMap(RuntimeMap map, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format, bool clip)
{
- var resourceId = rtmap.ResourceID;
+ var resourceId = map.ResourceID;
MgRenderingService rnd = this.Connection.CreateService(MgServiceType.RenderingService) as MgRenderingService;
MgResourceService res = this.Connection.CreateService(MgServiceType.ResourceService) as MgResourceService;
MgGeometryFactory gf = new MgGeometryFactory();
@@ -613,16 +606,16 @@
GetByteReaderMethod fetch = () =>
{
- MgMap map = new MgMap();
- map.Open(res, mapname);
- MgSelection sel = new MgSelection(map);
+ MgMap m = new MgMap();
+ m.Open(res, mapname);
+ MgSelection sel = new MgSelection(m);
//The color accepted by MgColor has alpha as the last value, but the returned has alpha first
- MgColor color = new MgColor(Utility.ParseHTMLColor(map.GetBackgroundColor()));
+ MgColor color = new MgColor(Utility.ParseHTMLColor(m.GetBackgroundColor()));
MgEnvelope env = new MgEnvelope(gf.CreateCoordinateXY(x1, y1), gf.CreateCoordinateXY(x2, y2));
- return rnd.RenderMap(map, sel, env, width, height, color, format);
+ return rnd.RenderMap(m, sel, env, width, height, color, format);
};
- LogMethodCall("MgRenderingService::RenderMap", true, "MgMap", "MgSelection", "MgEnvelope", width.ToString(), height.ToString(), "MgColor", format);
+ LogMethodCall("MgRenderingService::RenderMap", true, nameof(MgMap), nameof(MgSelection), nameof(MgEnvelope), width.ToString(), height.ToString(), nameof(MgColor), format);
return new MgReadOnlyStream(fetch);
}
@@ -699,10 +692,7 @@
MgFeatureService fes = this.Connection.CreateService(MgServiceType.FeatureService) as MgFeatureService;
MgSpatialContextReader rd = fes.GetSpatialContexts(new MgResourceIdentifier(resourceID), activeOnly);
- GetByteReaderMethod fetch = () =>
- {
- return rd.ToXml();
- };
+ GetByteReaderMethod fetch = rd.ToXml;
LogMethodCall("MgFeatureService::GetSpatialContexts", true, resourceID, activeOnly.ToString());
return base.DeserializeObject<FdoSpatialContextList>(new MgReadOnlyStream(fetch));
}
@@ -811,19 +801,19 @@
MgByteReader rd = new MgByteReader(data, data.Length, "text/xml");
res.UpdateRepository(new MgResourceIdentifier(resourceId), null, rd);
- LogMethodCall("MgResourceService::UpdateRepository", true, resourceId, "null", "MgByteReader");
+ LogMethodCall("MgResourceService::UpdateRepository", true, resourceId, "null", nameof(MgByteReader));
}
}
- public override object GetFolderOrResourceHeader(string resourceID)
+ public override object GetFolderOrResourceHeader(string resourceId)
{
MgResourceService res = this.Connection.CreateService(MgServiceType.ResourceService) as MgResourceService;
GetByteReaderMethod fetch = () =>
{
- MgResourceIdentifier resId = new MgResourceIdentifier(resourceID);
+ MgResourceIdentifier resId = new MgResourceIdentifier(resourceId);
return res.GetResourceHeader(resId);
};
- if (ResourceIdentifier.IsFolderResource(resourceID))
+ if (ResourceIdentifier.IsFolderResource(resourceId))
return this.DeserializeObject<ResourceFolderHeaderType>(new MgReadOnlyStream(fetch));
else
return this.DeserializeObject<ResourceDocumentHeaderType>(new MgReadOnlyStream(fetch));
@@ -868,7 +858,7 @@
return m_cachedGroupList;
}
- public override System.IO.Stream GetTile(string mapdefinition, string baselayergroup, int col, int row, int scaleindex, string format)
+ public override Stream GetTile(string mapdefinition, string baselayergroup, int col, int row, int scaleindex, string format)
{
MgTileService ts = this.Connection.CreateService(MgServiceType.TileService) as MgTileService;
GetByteReaderMethod fetch = () =>
@@ -880,20 +870,20 @@
return new MgReadOnlyStream(fetch);
}
- public override bool ResourceExists(string resourceid)
+ public override bool ResourceExists(string resourceID)
{
//API is safe to call in MG 2.1 and newer
var version = this.SiteVersion;
if (version >= new Version(2, 1))
{
MgResourceService res = this.Connection.CreateService(MgServiceType.ResourceService) as MgResourceService;
- var result = res.ResourceExists(new MgResourceIdentifier(resourceid));
- LogMethodCall("MgResourceService::ResourceExists", true, resourceid);
+ var result = res.ResourceExists(new MgResourceIdentifier(resourceID));
+ LogMethodCall("MgResourceService::ResourceExists", true, resourceID);
return result;
}
else
{
- return base.ResourceExists(resourceid);
+ return base.ResourceExists(resourceID);
}
}
@@ -1368,16 +1358,23 @@
string featureFilter = "";
int layerAttributeFilter = 0;
int op = MgFeatureSpatialOperations.Intersects;
- if (selectionVariant == "TOUCHES")
- op = MgFeatureSpatialOperations.Touches;
- else if (selectionVariant == "INTERSECTS")
- op = MgFeatureSpatialOperations.Intersects;
- else if (selectionVariant == "WITHIN")
- op = MgFeatureSpatialOperations.Within;
- else if (selectionVariant == "ENVELOPEINTERSECTS")
- op = MgFeatureSpatialOperations.EnvelopeIntersects;
- else
- throw new ArgumentException("Unknown or unsupported selection variant: " + selectionVariant);
+ switch (selectionVariant)
+ {
+ case "TOUCHES":
+ op = MgFeatureSpatialOperations.Touches;
+ break;
+ case "INTERSECTS":
+ op = MgFeatureSpatialOperations.Intersects;
+ break;
+ case "WITHIN":
+ op = MgFeatureSpatialOperations.Within;
+ break;
+ case "ENVELOPEINTERSECTS":
+ op = MgFeatureSpatialOperations.EnvelopeIntersects;
+ break;
+ default:
+ throw new ArgumentException("Unknown or unsupported selection variant: " + selectionVariant);
+ }
if (extraOptions != null)
{
@@ -1395,7 +1392,7 @@
MgFeatureInformation info = rs.QueryFeatures(map, layerNames, r.Read(wkt), op, featureFilter, maxFeatures, layerAttributeFilter);
string xml = "";
- GetByteReaderMethod fetch = () => { return info.ToXml(); };
+ GetByteReaderMethod fetch = info.ToXml;
using (var sr = new StreamReader(new MgReadOnlyStream(fetch)))
{
xml = sr.ReadToEnd();
@@ -1557,46 +1554,22 @@
this.IsFrozen = rdr.IsFrozen();
}
- public string Name
- {
- get;
- private set;
- }
+ public string Name { get; }
- public string Description
- {
- get;
- private set;
- }
+ public string Description { get; }
- public string Owner
- {
- get;
- private set;
- }
+ public string Owner { get; }
- public string CreationDate
- {
- get;
- private set;
- }
+ public string CreationDate { get; }
- public bool IsActive
- {
- get;
- private set;
- }
+ public bool IsActive { get; }
- public bool IsFrozen
- {
- get;
- private set;
- }
+ public bool IsFrozen { get; }
}
internal class LocalLongTransactionList : ILongTransactionList
{
- private List<LocalLongTransaction> _transactions;
+ private readonly List<LocalLongTransaction> _transactions;
public LocalLongTransactionList(MgLongTransactionReader rdr)
{
@@ -1608,9 +1581,6 @@
rdr.Close();
}
- public IEnumerable<ILongTransaction> Transactions
- {
- get { return _transactions; }
- }
+ public IEnumerable<ILongTransaction> Transactions => _transactions;
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeCoordinateSystem.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeCoordinateSystem.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeCoordinateSystem.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -26,7 +26,7 @@
{
public class LocalNativeMpuCalculator : IMpuCalculator
{
- private MgCoordinateSystemFactory _csFact;
+ private readonly MgCoordinateSystemFactory _csFact;
public LocalNativeMpuCalculator()
{
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeSqlReader.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeSqlReader.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeSqlReader.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -29,7 +29,7 @@
{
public class LocalNativeSqlReader : ReaderBase
{
- private MgSqlDataReader _reader;
+ private readonly MgSqlDataReader _reader;
private FixedWKTReader _mgReader;
private MgAgfReaderWriter _agfRw;
private MgWktReaderWriter _wktRw;
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/MgReadOnlyStream.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/MgReadOnlyStream.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/MgReadOnlyStream.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -37,7 +37,7 @@
/// </summary>
public class MgReadOnlyStream : ReadOnlyRewindableStream
{
- private MgByteReader _reader;
+ private readonly MgByteReader _reader;
/// <summary>
/// Creates a new instance
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Utility.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Utility.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Utility.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -207,36 +207,34 @@
for (int i = 0; i < pcount; i++)
{
var prop = props.GetItem(i);
- if (prop.PropertyType == MgFeaturePropertyType.DataProperty)
+ switch (prop.PropertyType)
{
- MgDataPropertyDefinition mgData = (MgDataPropertyDefinition)prop;
- var dp = ConvertDataProperty(mgData);
+ case MgFeaturePropertyType.DataProperty:
+ MgDataPropertyDefinition mgData = (MgDataPropertyDefinition)prop;
+ var dp = ConvertDataProperty(mgData);
- //API Bug? passing object reference gives incorrect result for identity
- //properties
- bool identity = (mgClass.GetIdentityProperties().Contains(prop.Name));
- cls.AddProperty(dp, identity);
- }
- else if (prop.PropertyType == MgFeaturePropertyType.GeometricProperty)
- {
- MgGeometricPropertyDefinition mgGeom = (MgGeometricPropertyDefinition)prop;
- var geom = ConvertGeometricProperty(mgGeom);
+ //API Bug? passing object reference gives incorrect result for identity
+ //properties
+ bool identity = (mgClass.GetIdentityProperties().Contains(prop.Name));
+ cls.AddProperty(dp, identity);
+ break;
+ case MgFeaturePropertyType.GeometricProperty:
+ MgGeometricPropertyDefinition mgGeom = (MgGeometricPropertyDefinition)prop;
+ var geom = ConvertGeometricProperty(mgGeom);
- cls.AddProperty(geom);
- }
- else if (prop.PropertyType == MgFeaturePropertyType.RasterProperty)
- {
- MgRasterPropertyDefinition mgRaster = (MgRasterPropertyDefinition)prop;
- var raster = ConvertRasterProperty(mgRaster);
+ cls.AddProperty(geom);
+ break;
+ case MgFeaturePropertyType.RasterProperty:
+ MgRasterPropertyDefinition mgRaster = (MgRasterPropertyDefinition)prop;
+ var raster = ConvertRasterProperty(mgRaster);
- cls.AddProperty(raster);
+ cls.AddProperty(raster);
+ break;
+ case MgFeaturePropertyType.ObjectProperty:
+ break;
+ case MgFeaturePropertyType.AssociationProperty:
+ break;
}
- else if (prop.PropertyType == MgFeaturePropertyType.ObjectProperty)
- {
- }
- else if (prop.PropertyType == MgFeaturePropertyType.AssociationProperty)
- {
- }
}
cls.DefaultGeometryPropertyName = mgClass.DefaultGeometryPropertyName;
Modified: trunk/Tools/Maestro/RtMapInspector/MainForm.cs
===================================================================
--- trunk/Tools/Maestro/RtMapInspector/MainForm.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/RtMapInspector/MainForm.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -26,6 +26,7 @@
using OSGeo.MapGuide.MaestroAPI.Services;
using OSGeo.MapGuide.ObjectModels.Common;
using System;
+using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
@@ -48,37 +49,31 @@
private class PointDecorator
{
- private string _str;
+ private readonly string _str;
public PointDecorator(IPoint2D pt)
{
- _str = "(" + pt.X + ", " + pt.Y + ")";
+ _str = $"({pt.X}, {pt.Y})"; //NOXLATE
}
- public override string ToString()
- {
- return _str;
- }
+ public override string ToString() =>_str;
}
private class BoxDecorator
{
- private string _str;
+ private readonly string _str;
public BoxDecorator(IEnvelope env)
{
- _str = string.Format("( ({0}, {1}), ({2}, {3}) )", env.MinX, env.MinY, env.MaxX, env.MaxY);
+ _str = $"( ({env.MinX}, {env.MinX}), ({env.MaxX}, {env.MaxY}) )"; //NOXLATE
}
- public override string ToString()
- {
- return _str;
- }
+ public override string ToString() => _str;
}
private class MapDecorator
{
- private RuntimeMap _map;
+ private readonly RuntimeMap _map;
[Category("Map Properties")]
[ReadOnly(true)]
@@ -130,38 +125,23 @@
[Category("Map Properties")]
[ReadOnly(true)]
- public string ObjectId
- {
- get { return _map.ObjectId; }
- }
+ public string ObjectId => _map.ObjectId;
[Category("Map Properties")]
[ReadOnly(true)]
- public string CoordinateSystem
- {
- get { return _map.CoordinateSystem; }
- }
+ public string CoordinateSystem => _map.CoordinateSystem;
[Category("Map Properties")]
[ReadOnly(true)]
- public double MetersPerUnit
- {
- get { return _map.MetersPerUnit; }
- }
+ public double MetersPerUnit => _map.MetersPerUnit;
[Category("Map Properties")]
[ReadOnly(true)]
- public PointDecorator ViewCenter
- {
- get { return new PointDecorator(_map.ViewCenter); }
- }
+ public PointDecorator ViewCenter => new PointDecorator(_map.ViewCenter);
[Category("Map Properties")]
[ReadOnly(true)]
- public BoxDecorator DataExtent
- {
- get { return new BoxDecorator(_map.DataExtent); }
- }
+ public BoxDecorator DataExtent => new BoxDecorator(_map.DataExtent);
public MapDecorator(RuntimeMap map)
{
@@ -171,7 +151,7 @@
private class GroupDecorator
{
- private RuntimeMapGroup _group;
+ private readonly RuntimeMapGroup _group;
public GroupDecorator(RuntimeMapGroup group)
{
@@ -227,10 +207,7 @@
[Category("Group properties")]
[ReadOnly(true)]
- public int Type
- {
- get { return _group.Type; }
- }
+ public int Type => _group.Type;
[Category("Group properties")]
[ReadOnly(true)]
@@ -243,7 +220,7 @@
private class LayerDecorator
{
- private RuntimeMapLayer _layer;
+ private readonly RuntimeMapLayer _layer;
public LayerDecorator(RuntimeMapLayer layer)
{
@@ -252,10 +229,7 @@
[Category("Layer Properties")]
[ReadOnly(true)]
- public double DisplayOrder
- {
- get { return _layer.DisplayOrder; }
- }
+ public double DisplayOrder => _layer.DisplayOrder;
[Category("Layer Properties")]
[ReadOnly(true)]
@@ -267,24 +241,15 @@
[Category("Layer Properties")]
[ReadOnly(true)]
- public string FeatureSourceID
- {
- get { return _layer.FeatureSourceID; }
- }
+ public string FeatureSourceID => _layer.FeatureSourceID;
[Category("Layer Properties")]
[ReadOnly(true)]
- public string Filter
- {
- get { return _layer.Filter; }
- }
+ public string Filter => _layer.Filter;
[Category("Layer Properties")]
[ReadOnly(true)]
- public string GeometryPropertyName
- {
- get { return _layer.GeometryPropertyName; }
- }
+ public string GeometryPropertyName => _layer.GeometryPropertyName;
[Category("Layer Properties")]
[ReadOnly(true)]
@@ -296,24 +261,15 @@
[Category("Layer Properties")]
[ReadOnly(true)]
- public bool HasTooltips
- {
- get { return _layer.HasTooltips; }
- }
+ public bool HasTooltips => _layer.HasTooltips;
[Category("Layer Properties")]
[ReadOnly(true)]
- public string[] IdentityProperties
- {
- get { return new IdentityPropertyCollection(_layer.IdentityProperties).ToArray(); }
- }
+ public string[] IdentityProperties => _layer.IdentityProperties.Select(p => $"{p.Name} ({p.Type.FullName})").ToArray();
[Category("Layer Properties")]
[ReadOnly(true)]
- public string LayerDefinition
- {
- get { return _layer.LayerDefinitionID; }
- }
+ public string LayerDefinition => _layer.LayerDefinitionID;
[Category("Layer Properties")]
[ReadOnly(true)]
@@ -333,38 +289,23 @@
[Category("Layer Properties")]
[ReadOnly(true)]
- public bool NeedsRefresh
- {
- get { return _layer.NeedsRefresh; }
- }
+ public bool NeedsRefresh => _layer.NeedsRefresh;
[Category("Layer Properties")]
[ReadOnly(true)]
- public string ObjectId
- {
- get { return _layer.ObjectId; }
- }
+ public string ObjectId => _layer.ObjectId;
[Category("Layer Properties")]
[ReadOnly(true)]
- public string FeatureClass
- {
- get { return _layer.QualifiedClassName; }
- }
+ public string FeatureClass => _layer.QualifiedClassName;
[Category("Layer Properties")]
[ReadOnly(true)]
- public string[] ScaleRanges
- {
- get { return new ScaleRangeCollection(_layer.ScaleRanges).ToArray(); }
- }
+ public string[] ScaleRanges => _layer.ScaleRanges.Select(s => $"{s.MinScale} : {s.MaxScale}").ToArray();
[Category("Layer Properties")]
[ReadOnly(true)]
- public string SchemaName
- {
- get { return _layer.SchemaName; }
- }
+ public string SchemaName => _layer.SchemaName;
[Category("Layer Properties")]
[ReadOnly(true)]
@@ -384,10 +325,7 @@
[Category("Layer Properties")]
[ReadOnly(true)]
- public int Type
- {
- get { return _layer.Type; }
- }
+ public int Type => _layer.Type;
[Category("Layer Properties")]
[ReadOnly(true)]
@@ -400,44 +338,19 @@
private class DrawOrderDisplayItem
{
- public string Label { get; private set; }
+ public string Label { get; }
- public LayerDecorator Decorator { get; private set; }
+ public LayerDecorator Decorator { get; }
public DrawOrderDisplayItem(RuntimeMapLayer layer)
{
- this.Label = layer.Name + " (" + layer.LegendLabel + ")";
+ this.Label = $"{layer.Name} ({layer.LegendLabel})"; //NOXLATE
this.Decorator = new LayerDecorator(layer);
}
- public override string ToString()
- {
- return this.Label;
- }
+ public override string ToString() => this.Label;
}
-
- private class ScaleRangeCollection : List<string>
- {
- public ScaleRangeCollection(RuntimeMapLayer.ScaleRange[] ranges)
- {
- foreach (var s in ranges)
- {
- Add(s.MinScale + " : " + s.MaxScale);
- }
- }
- }
-
- private class IdentityPropertyCollection : List<string>
- {
- public IdentityPropertyCollection(PropertyInfo[] props)
- {
- foreach (var p in props)
- {
- Add(p.Name + " (" + p.Type.FullName + ")");
- }
- }
- }
-
+
#endregion Design-time property wrappers
protected override void OnLoad(EventArgs e)
@@ -469,7 +382,7 @@
trvSelection.Nodes.Clear();
if (rdMapName.Checked)
{
- _rtMap = _mappingSvc.OpenMap(string.Format("Session:{0}//{1}.Map", txtSessionId.Text, txtMapName.Text));
+ _rtMap = _mappingSvc.OpenMap($"Session:{txtSessionId.Text}//{txtMapName.Text}.Map"); //NOXLATE
}
else if (rdResourceId.Checked)
{
@@ -560,7 +473,7 @@
for (int i = 0; i < sel.Count; i++)
{
var rtLayer = sel[i].Layer;
- var node = new TreeNode(rtLayer.Name + " (" + sel[i].Count + " objects selected)");
+ var node = new TreeNode($"{rtLayer.Name} ({sel[i].Count} objects selected)"); //LOCALIZEME
node.Tag = new LayerDecorator(rtLayer);
node.ImageIndex = node.SelectedImageIndex = IDX_LAYER;
trvSelection.Nodes.Add(node);
Modified: trunk/Tools/Maestro/SignMapGuideApi/Program.cs
===================================================================
--- trunk/Tools/Maestro/SignMapGuideApi/Program.cs 2015-08-10 15:52:45 UTC (rev 8737)
+++ trunk/Tools/Maestro/SignMapGuideApi/Program.cs 2015-08-11 15:11:47 UTC (rev 8738)
@@ -7,7 +7,7 @@
{
internal class Program
{
- private static string[] files = { "MapGuideDotNetApi", "OSGeo.MapGuide.Foundation", "OSGeo.MapGuide.Geometry", "OSGeo.MapGuide.MapGuideCommon", "OSGeo.MapGuide.PlatformBase", "OSGeo.MapGuide.Web" };
+ private static readonly string[] files = { "MapGuideDotNetApi", "OSGeo.MapGuide.Foundation", "OSGeo.MapGuide.Geometry", "OSGeo.MapGuide.MapGuideCommon", "OSGeo.MapGuide.PlatformBase", "OSGeo.MapGuide.Web" };
private static Dictionary<string, string[]> ilasm32Paths = new Dictionary<string, string[]>()
{
More information about the mapguide-commits
mailing list