[mapguide-commits] r8741 - in trunk/Tools/Maestro: Generated Maestro.AddIn.Local/UI Maestro.AddIn.Rest/UI Maestro.AddIn.Scripting Maestro.AddIn.Scripting/Lang/Python Maestro.AddIn.Scripting/Services Maestro.AddIn.Scripting/UI Maestro.Base Maestro.Base/Commands Maestro.Base/Services Maestro.Base/UI Maestro.Editors/Common Maestro.Editors/Common/Expression Maestro.Editors/Generic/XmlEditor/AutoCompletion Maestro.Editors/LayerDefinition/Vector/GridEditor Maestro.Editors/LayerDefinition/Vector/StyleEditors Maestro.Editors/LayerDefinition/Vector/Thematics Maestro.Editors/MapDefinition Maestro.Editors/TileSetDefinition Maestro.LiveMapEditor Maestro.Login Maestro.MapViewer Maestro.Shared.UI MgCooker OSGeo.FDO.Expressions OSGeo.MapGuide.MaestroAPI OSGeo.MapGuide.MaestroAPI/Capability OSGeo.MapGuide.MaestroAPI/Commands OSGeo.MapGuide.MaestroAPI/CoordinateSystem OSGeo.MapGuide.MaestroAPI/CrossConnection OSGeo.MapGuide.MaestroAPI/Feature OSGeo.MapGuide.MaestroAPI/Mapping OSGeo.MapGuide.MaestroAPI/Resource /Comparison OSGeo.MapGuide.MaestroAPI/Resource/Conversion OSGeo.MapGuide.MaestroAPI/Resource/Validation OSGeo.MapGuide.MaestroAPI/Schema OSGeo.MapGuide.MaestroAPI/SchemaOverrides OSGeo.MapGuide.MaestroAPI/Serialization OSGeo.MapGuide.MaestroAPI/Tile OSGeo.MapGuide.MaestroAPI.Http OSGeo.MapGuide.MaestroAPI.Http/Commands OSGeo.MapGuide.MaestroAPI.Local OSGeo.MapGuide.MaestroAPI.Native OSGeo.MapGuide.ObjectModels/WebLayout Properties
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Wed Aug 12 10:10:41 PDT 2015
Author: jng
Date: 2015-08-12 10:10:40 -0700 (Wed, 12 Aug 2015)
New Revision: 8741
Modified:
trunk/Tools/Maestro/Generated/TileSetDefinition-3.0.0.designer.cs
trunk/Tools/Maestro/Maestro.AddIn.Local/UI/MapPreviewWindow.cs
trunk/Tools/Maestro/Maestro.AddIn.Local/UI/ZoomScaleDialog.cs
trunk/Tools/Maestro/Maestro.AddIn.Rest/UI/RestConfigurationEditor.cs
trunk/Tools/Maestro/Maestro.AddIn.Rest/UI/RestExplorer.cs
trunk/Tools/Maestro/Maestro.AddIn.Scripting/Lang/Python/PythonConsole.cs
trunk/Tools/Maestro/Maestro.AddIn.Scripting/Lang/Python/PythonConsoleHost.cs
trunk/Tools/Maestro/Maestro.AddIn.Scripting/Lang/Python/PythonOutputStream.cs
trunk/Tools/Maestro/Maestro.AddIn.Scripting/ScriptingConfigProperties.cs
trunk/Tools/Maestro/Maestro.AddIn.Scripting/Services/ScriptingClasses.cs
trunk/Tools/Maestro/Maestro.AddIn.Scripting/UI/IronPythonPreferences.cs
trunk/Tools/Maestro/Maestro.Base/Commands/PasteCommand.cs
trunk/Tools/Maestro/Maestro.Base/Commands/ViewXmlChangesCommand.cs
trunk/Tools/Maestro/Maestro.Base/Maestro.Base.csproj
trunk/Tools/Maestro/Maestro.Base/Services/ClipboardService.cs
trunk/Tools/Maestro/Maestro.Base/UI/DirtyStateConfirmationDialog.cs
trunk/Tools/Maestro/Maestro.Base/WorkbenchInitializer.cs
trunk/Tools/Maestro/Maestro.Editors/Common/ColorComboBox.cs
trunk/Tools/Maestro/Maestro.Editors/Common/Expression/ExpressionDisplayDialog.cs
trunk/Tools/Maestro/Maestro.Editors/Common/Expression/FdoExpressionCompletionDataProvider.cs
trunk/Tools/Maestro/Maestro.Editors/Common/ExpressionEditor.cs
trunk/Tools/Maestro/Maestro.Editors/Common/MonoCompatibleExpressionEditor.cs
trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/AutoCompletion/QualifiedName.cs
trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/AutoCompletion/XmlElementPath.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/GridEditor/VectorScaleRangeGrid.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/PointFeatureStyleEditor.cs
trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.cs
trunk/Tools/Maestro/Maestro.Editors/MapDefinition/GroupPropertiesCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/TileSetDefinition/GroupPropertiesCtrl.cs
trunk/Tools/Maestro/Maestro.LiveMapEditor/AboutDialog.cs
trunk/Tools/Maestro/Maestro.Login/PreferedSite.cs
trunk/Tools/Maestro/Maestro.MapViewer/LegendPresenter.cs
trunk/Tools/Maestro/Maestro.MapViewer/MapViewer.cs
trunk/Tools/Maestro/Maestro.Shared.UI/ViewContentBase.cs
trunk/Tools/Maestro/Maestro.Shared.UI/WorkbenchBase.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/FdoExpression.cs
trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoFilter.cs
trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoParseable.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/HttpGetTileProviders.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpCapabilities.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpCoordinateSystemCatalog.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/XmlDataReader.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/XmlFeatureReader.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalCapabilities.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeCoordinateSystemCatalog.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeDataReader.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/Capability/ConnectionCapabilities.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Commands/FeatureManipulationCommandImpl.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/ActualCoordinateSystem.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/CoordinateSystem.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/CoordinateSystemBase.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/CoordinateSystemCategory.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/MeterBasedCoordinateSystem.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CrossConnection/ResourceMigrator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/FeatureReaderBase.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/LimitingFeatureReader.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/MutableFeatureBase.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/PropertyValue.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/ReaderBase.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/RecordBase.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/LengthyOperationCallbackArgs.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/Collections.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/MapSelection.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapLayer.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/MgServerConnectionBase.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Comparison/DiffEngine.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Conversion/IResourceConverter.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ApplicationDefinitionValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/DrawingSourceValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/FeatureSourceValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/LayerDefinitionValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/LoadProcedureValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/MapDefinitionValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/PrintLayoutValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ResourceValidationContext.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/SymbolDefinitionValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/SymbolLibraryValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ValidationResultSet.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/WebLayoutValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/ClassDefinition.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/DataPropertyDefinition.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/FeatureSchema.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/GeometricPropertyDefinition.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/RasterPropertyDefinition.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/ConfigurationDocument.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/GdalConfigurationDocument.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/GdalRasterItem.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/RasterWmsItem.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/WmsConfigurationDocument.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Serialization/MgBinaryDeserializer.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Serialization/MgBinarySerializer.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Tile/BatchSettings.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Utility.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/XmlValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WebLayout/WebLayoutInterfaces.cs
trunk/Tools/Maestro/Properties/CodeAnalysisRules.cs
Log:
#2565: The RES-instigated cleanup continues.
Modified: trunk/Tools/Maestro/Generated/TileSetDefinition-3.0.0.designer.cs
===================================================================
--- trunk/Tools/Maestro/Generated/TileSetDefinition-3.0.0.designer.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Generated/TileSetDefinition-3.0.0.designer.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -1,3 +1,4 @@
+#pragma warning disable 1591, 0114, 0108
// ------------------------------------------------------------------------------
// <auto-generated>
// Generated by Xsd2Code. Version 3.4.0.32989
Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/UI/MapPreviewWindow.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Local/UI/MapPreviewWindow.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.AddIn.Local/UI/MapPreviewWindow.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -38,7 +38,7 @@
InitializeComponent();
_conn = conn;
- new MapViewerController(viewer, legend, this, propertyPane, toolbar);
+ var cntrl = new MapViewerController(viewer, legend, this, propertyPane, toolbar);
this.Disposed += OnDisposed;
}
Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/UI/ZoomScaleDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Local/UI/ZoomScaleDialog.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.AddIn.Local/UI/ZoomScaleDialog.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -34,19 +34,10 @@
numScale.Maximum = Convert.ToDecimal(int.MaxValue);
}
- public double Value
- {
- get { return Convert.ToDouble(numScale.Value); }
- }
+ public double Value => Convert.ToDouble(numScale.Value);
- 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;
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.AddIn.Rest/UI/RestConfigurationEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Rest/UI/RestConfigurationEditor.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.AddIn.Rest/UI/RestConfigurationEditor.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -24,21 +24,14 @@
using Maestro.Editors.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
-using Newtonsoft.Json.Linq;
using OSGeo.MapGuide.MaestroAPI;
using OSGeo.MapGuide.ObjectModels;
-using OSGeo.MapGuide.ObjectModels.FeatureSource;
using OSGeo.MapGuide.ObjectModels.LayerDefinition;
using RestSharp;
using System;
using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
using System.Dynamic;
-using System.Linq;
using System.Text;
-using System.Threading.Tasks;
using System.Windows.Forms;
namespace Maestro.AddIn.Rest.UI
@@ -62,62 +55,48 @@
_client = client;
if (!isNew)
{
- var dataLen = "data/".Length;
- var configLen = "/config".Length;
- txtUriPart.Text = uriPart.Substring(uriPart.IndexOf("data/") + dataLen, uriPart.Length - dataLen - configLen);
+ var dataLen = "data/".Length; //NOXLATE
+ var configLen = "/config".Length; //NOXLATE
+ txtUriPart.Text = uriPart.Substring(uriPart.IndexOf("data/") + dataLen, uriPart.Length - dataLen - configLen); //NOXLATE
}
txtUriPart.ReadOnly = !isNew;
txtJson.Text = json;
}
- public bool IsNew
- {
- get { return !txtUriPart.ReadOnly; }
- }
+ public bool IsNew => !txtUriPart.ReadOnly;
- public string GetUriPart()
- {
- return "data/" + txtUriPart.Text + "/config";
- }
+ public string GetUriPart() => $"data/{txtUriPart.Text}/config"; //NOXLATE
- public string GetJson()
- {
- string json = txtJson.Text;
+ public string GetJson() => txtJson.Text;
- return json;
- }
+ private void btnCancel_Click(object sender, EventArgs e) => this.DialogResult = DialogResult.Cancel;
- private void btnCancel_Click(object sender, EventArgs e)
- {
- this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- }
-
private void btnSave_Click(object sender, EventArgs e)
{
if (!txtUriPart.ReadOnly && string.IsNullOrEmpty(txtUriPart.Text))
{
- MessageBox.Show(Maestro.AddIn.Rest.Strings.UriPartRequrired);
+ MessageBox.Show(Strings.UriPartRequrired);
txtUriPart.Focus();
return;
}
var req = new RestRequest(this.GetUriPart(), Method.POST);
- req.AddFile("data", Encoding.UTF8.GetBytes(this.GetJson()), "restcfg.json");
+ req.AddFile("data", Encoding.UTF8.GetBytes(this.GetJson()), "restcfg.json"); //NOXLATE
var resp = _client.Execute(req);
if (resp.StatusCode != System.Net.HttpStatusCode.OK)
- MessageBox.Show(string.Format(Maestro.AddIn.Rest.Strings.ErrorSavingConfiguration, resp.Content));
+ MessageBox.Show(string.Format(Strings.ErrorSavingConfiguration, resp.Content));
else
- MessageBox.Show(Maestro.AddIn.Rest.Strings.ConfigurationSaved);
+ MessageBox.Show(Strings.ConfigurationSaved);
- this.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.DialogResult = DialogResult.OK;
}
private void featureSourceToolStripMenuItem_Click(object sender, EventArgs e)
{
using (var picker = new ResourcePicker(_conn, ResourceTypes.FeatureSource.ToString(), ResourcePickerMode.OpenResource))
{
- if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+ if (picker.ShowDialog() == DialogResult.OK)
{
dynamic conf = GetConfigurationObject();
dynamic source = new ExpandoObject();
@@ -125,7 +104,7 @@
source.FeatureSource = picker.ResourceID;
string[] classNames = _conn.FeatureService.GetClassNames(picker.ResourceID, null);
- string className = GenericItemSelectionDialog.SelectItem(Maestro.AddIn.Rest.Strings.FdoClass, Maestro.AddIn.Rest.Strings.SelectClassName, classNames);
+ string className = GenericItemSelectionDialog.SelectItem(Strings.FdoClass, Strings.SelectClassName, classNames);
if (className != null)
{
source.FeatureClass = className;
@@ -140,7 +119,7 @@
{
using (var picker = new ResourcePicker(_conn, ResourceTypes.LayerDefinition.ToString(), ResourcePickerMode.OpenResource))
{
- if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+ if (picker.ShowDialog() == DialogResult.OK)
{
dynamic conf = GetConfigurationObject();
dynamic source = new ExpandoObject();
@@ -163,13 +142,13 @@
private RestSourceContext GetSourceContext(dynamic conf)
{
var source = conf.Source as IDictionary<string, object>;
- if (source.ContainsKey("LayerDefinition"))
+ if (source.ContainsKey("LayerDefinition")) //NOXLATE
{
string resId = conf.Source.LayerDefinition;
ILayerDefinition ldf = (ILayerDefinition)_conn.ResourceService.GetResource(resId);
IVectorLayerDefinition vl = ldf.SubLayer as IVectorLayerDefinition;
if (vl == null)
- throw new InvalidOperationException(string.Format(Maestro.AddIn.Rest.Strings.NotAVectorLayer, resId));
+ throw new InvalidOperationException(string.Format(Strings.NotAVectorLayer, resId));
return new RestSourceContext(_conn, new RestSource()
{
@@ -177,7 +156,7 @@
ClassName = vl.FeatureName
});
}
- else if (source.ContainsKey("FeatureSource"))
+ else if (source.ContainsKey("FeatureSource")) //NOXLATE
{
string resId = conf.Source.FeatureSource;
@@ -188,19 +167,19 @@
});
}
- throw new InvalidOperationException(Maestro.AddIn.Rest.Strings.InvalidSourceConfiguration);
+ throw new InvalidOperationException(Strings.InvalidSourceConfiguration);
}
private void xmlToolStripMenuItem_Click(object sender, EventArgs e)
{
var conf = GetConfigurationObject();
- if (!((IDictionary<string, object>)conf).ContainsKey("Source"))
+ if (!((IDictionary<string, object>)conf).ContainsKey("Source")) //NOXLATE
{
- MessageBox.Show(Maestro.AddIn.Rest.Strings.NoSourceInConfiguration);
+ MessageBox.Show(Strings.NoSourceInConfiguration);
return;
}
var ctx = GetSourceContext(conf);
- if (new NewRepresentationDialog("xml", conf, ctx).ShowDialog() == System.Windows.Forms.DialogResult.OK)
+ if (new NewRepresentationDialog("xml", conf, ctx).ShowDialog() == DialogResult.OK) //NOXLATE
{
txtJson.Text = JsonConvert.SerializeObject(conf, Formatting.Indented);
}
@@ -209,13 +188,13 @@
private void geoJSONToolStripMenuItem_Click(object sender, EventArgs e)
{
var conf = GetConfigurationObject();
- if (!((IDictionary<string, object>)conf).ContainsKey("Source"))
+ if (!((IDictionary<string, object>)conf).ContainsKey("Source")) //NOXLATE
{
- MessageBox.Show(Maestro.AddIn.Rest.Strings.NoSourceInConfiguration);
+ MessageBox.Show(Strings.NoSourceInConfiguration);
return;
}
var ctx = GetSourceContext(conf);
- if (new NewRepresentationDialog("geojson", conf, ctx).ShowDialog() == System.Windows.Forms.DialogResult.OK)
+ if (new NewRepresentationDialog("geojson", conf, ctx).ShowDialog() == DialogResult.OK) //NOXLATE
{
txtJson.Text = JsonConvert.SerializeObject(conf, Formatting.Indented);
}
@@ -224,13 +203,13 @@
private void csvToolStripMenuItem_Click(object sender, EventArgs e)
{
var conf = GetConfigurationObject();
- if (!((IDictionary<string, object>)conf).ContainsKey("Source"))
+ if (!((IDictionary<string, object>)conf).ContainsKey("Source")) //NOXLATE
{
- MessageBox.Show(Maestro.AddIn.Rest.Strings.NoSourceInConfiguration);
+ MessageBox.Show(Strings.NoSourceInConfiguration);
return;
}
var ctx = GetSourceContext(conf);
- if (new NewRepresentationDialog("csv", conf, ctx).ShowDialog() == System.Windows.Forms.DialogResult.OK)
+ if (new NewRepresentationDialog("csv", conf, ctx).ShowDialog() == DialogResult.OK) //NOXLATE
{
txtJson.Text = JsonConvert.SerializeObject(conf, Formatting.Indented);
}
@@ -239,13 +218,13 @@
private void imageToolStripMenuItem_Click(object sender, EventArgs e)
{
var conf = GetConfigurationObject();
- if (!((IDictionary<string, object>)conf).ContainsKey("Source"))
+ if (!((IDictionary<string, object>)conf).ContainsKey("Source")) //NOXLATE
{
- MessageBox.Show(Maestro.AddIn.Rest.Strings.NoSourceInConfiguration);
+ MessageBox.Show(Strings.NoSourceInConfiguration);
return;
}
var ctx = GetSourceContext(conf);
- if (new NewRepresentationDialog("image", conf, ctx).ShowDialog() == System.Windows.Forms.DialogResult.OK)
+ if (new NewRepresentationDialog("image", conf, ctx).ShowDialog() == DialogResult.OK) //NOXLATE
{
txtJson.Text = JsonConvert.SerializeObject(conf, Formatting.Indented);
}
@@ -254,13 +233,13 @@
private void templateToolStripMenuItem_Click(object sender, EventArgs e)
{
var conf = GetConfigurationObject();
- if (!((IDictionary<string, object>)conf).ContainsKey("Source"))
+ if (!((IDictionary<string, object>)conf).ContainsKey("Source")) //NOXLATE
{
- MessageBox.Show(Maestro.AddIn.Rest.Strings.NoSourceInConfiguration);
+ MessageBox.Show(Strings.NoSourceInConfiguration);
return;
}
var ctx = GetSourceContext(conf);
- if (new NewRepresentationDialog("template", conf, ctx).ShowDialog() == System.Windows.Forms.DialogResult.OK)
+ if (new NewRepresentationDialog("template", conf, ctx).ShowDialog() == DialogResult.OK) //NOXLATE
{
txtJson.Text = JsonConvert.SerializeObject(conf, Formatting.Indented);
}
Modified: trunk/Tools/Maestro/Maestro.AddIn.Rest/UI/RestExplorer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Rest/UI/RestExplorer.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.AddIn.Rest/UI/RestExplorer.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -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;
@@ -45,29 +45,14 @@
public RestExplorer()
{
InitializeComponent();
- this.Title = this.Description = Maestro.AddIn.Rest.Strings.RestExplorer;
+ this.Title = this.Description = Strings.RestExplorer;
}
- public override ViewRegion DefaultRegion
- {
- get
- {
- return ViewRegion.Right;
- }
- }
+ public override ViewRegion DefaultRegion => ViewRegion.Right;
- public override bool AllowUserClose
- {
- get
- {
- return false;
- }
- }
+ public override bool AllowUserClose => false;
- private bool IsConnected
- {
- get { return _client != null; }
- }
+ private bool IsConnected => _client != null;
private void btnConnect_Click(object sender, EventArgs e)
{
@@ -81,7 +66,7 @@
private void DoRefresh()
{
- _client.ExecuteGetRequestAsync<DataConfigurationResponse>("data/configs.json", (resp, ex) =>
+ _client.ExecuteGetRequestAsync<DataConfigurationResponse>("data/configs.json", (resp, ex) => //NOXLATE
{
this.UIThreadInvoke(() =>
{
@@ -95,7 +80,7 @@
{
var conn = connMgr.GetConnection(name);
var param = conn.CloneParameters;
- if (resp.DataConfigurationList.MapAgentUrl.IndexOf(param["Url"] ?? Guid.NewGuid().ToString()) >= 0)
+ if (resp.DataConfigurationList.MapAgentUrl.IndexOf(param["Url"] ?? Guid.NewGuid().ToString()) >= 0) //NOXLATE
{
_conn = conn;
break;
@@ -131,8 +116,8 @@
foreach (var conf in list.Configuration)
{
string name = conf.ConfigUriPart;
- if (name.EndsWith("/config"))
- name = name.Substring(0, name.Length - "/config".Length);
+ if (name.EndsWith("/config")) //NOXLATE
+ name = name.Substring(0, name.Length - "/config".Length); //NOXLATE
var node = root.Nodes.Add(name);
node.Tag = conf;
node.ImageIndex = node.SelectedImageIndex = IDX_CONFIG;
@@ -157,18 +142,15 @@
btnDelete.Enabled = true;
}
- private void LoadConfig(string json, string uriPart, bool isNew)
- {
- new RestConfigurationEditor(_conn, _client, json, uriPart, isNew).ShowDialog();
- }
+ private void LoadConfig(string json, string uriPart, bool isNew) => new RestConfigurationEditor(_conn, _client, json, uriPart, isNew).ShowDialog();
private void trvRestExplorer_AfterExpand(object sender, TreeViewEventArgs e)
{
var conf = e.Node.Tag as DataConfiguration;
- if (conf != null && e.Node.Nodes[0].Text == "dummy")
+ if (conf != null && e.Node.Nodes[0].Text == "dummy") //NOXLATE
{
e.Node.Nodes.Clear();
- var req = new RestRequest(conf.ConfigUriPart.Replace("/config", "/files.json"));
+ var req = new RestRequest(conf.ConfigUriPart.Replace("/config", "/files.json")); //NOXLATE
_client.ExecuteAsync<DataFileListResponse>(req, (resp) =>
{
var list = resp.Data.DataConfigurationFileList;
@@ -208,10 +190,10 @@
var list = trvRestExplorer.SelectedNode.Tag as DataFileList;
if (conf != null)
{
- if (MessageBox.Show(Maestro.AddIn.Rest.Strings.PromptDeleteConfiguration, Maestro.AddIn.Rest.Strings.DeleteConfiguration, MessageBoxButtons.YesNo) == DialogResult.Yes)
+ if (MessageBox.Show(Strings.PromptDeleteConfiguration, Strings.DeleteConfiguration, MessageBoxButtons.YesNo) == DialogResult.Yes)
{
var req = new RestRequest(conf.ConfigUriPart, Method.POST);
- req.AddHeader("X-HTTP-METHOD-OVERRIDE", "DELETE");
+ req.AddHeader("X-HTTP-METHOD-OVERRIDE", "DELETE"); //NOXLATE
_client.ExecuteAsync(req, (resp) =>
{
if (resp.StatusCode == System.Net.HttpStatusCode.OK)
@@ -233,11 +215,11 @@
conf = trvRestExplorer.SelectedNode.Parent.Tag as DataConfiguration;
if (conf != null)
{
- if (MessageBox.Show(Maestro.AddIn.Rest.Strings.DeleteFilePrompt, Maestro.AddIn.Rest.Strings.DeleteFile, MessageBoxButtons.YesNo) == DialogResult.Yes)
+ if (MessageBox.Show(Strings.DeleteFilePrompt, Strings.DeleteFile, MessageBoxButtons.YesNo) == DialogResult.Yes)
{
- var req = new RestRequest(conf.ConfigUriPart.Replace("/config", "/file"), Method.POST);
- req.AddHeader("X-HTTP-METHOD-OVERRIDE", "DELETE");
- req.AddParameter("filename", file);
+ var req = new RestRequest(conf.ConfigUriPart.Replace("/config", "/file"), Method.POST); //NOXLATE
+ req.AddHeader("X-HTTP-METHOD-OVERRIDE", "DELETE"); //NOXLATE
+ req.AddParameter("filename", file); //NOXLATE
_client.ExecuteAsync(req, (resp) =>
{
if (resp.StatusCode == System.Net.HttpStatusCode.OK)
@@ -269,9 +251,9 @@
{
if (picker.ShowDialog() == DialogResult.OK)
{
- var req = new RestRequest(conf.ConfigUriPart.Replace("/config", "/file"), Method.POST);
- req.AddParameter("filename", Path.GetFileName(picker.FileName));
- req.AddFile("data", picker.FileName);
+ var req = new RestRequest(conf.ConfigUriPart.Replace("/config", "/file"), Method.POST); //NOXLATE
+ req.AddParameter("filename", Path.GetFileName(picker.FileName)); //NOXLATE
+ req.AddFile("data", picker.FileName); //NOXLATE
_client.ExecuteAsync(req, (resp) =>
{
if (resp.StatusCode == System.Net.HttpStatusCode.OK)
@@ -289,14 +271,8 @@
}
}
- private void btnNew_Click(object sender, EventArgs e)
- {
- LoadConfig("{}", "", true);
- }
+ private void btnNew_Click(object sender, EventArgs e) => LoadConfig("{}", string.Empty, true);
- private void btnRefresh_Click(object sender, EventArgs e)
- {
- this.DoRefresh();
- }
+ private void btnRefresh_Click(object sender, EventArgs e) => this.DoRefresh();
}
}
Modified: trunk/Tools/Maestro/Maestro.AddIn.Scripting/Lang/Python/PythonConsole.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Scripting/Lang/Python/PythonConsole.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.AddIn.Scripting/Lang/Python/PythonConsole.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -41,7 +41,6 @@
using System.Diagnostics;
using System.Drawing;
using System.IO;
-using System.Text;
using System.Threading;
using System.Windows.Forms;
@@ -77,13 +76,7 @@
textEditor.IndentStyle = IndentStyle.None;
}
- public void Dispose()
- {
- disposedEvent.Set();
- //TextArea textArea = textEditor.ActiveTextAreaControl.TextArea;
- //textArea.KeyEventHandler -= ProcessKeyPress;
- //textArea.DoProcessDialogKey -= ProcessDialogKey;
- }
+ public void Dispose() => disposedEvent.Set();
public TextWriter Output
{
@@ -114,15 +107,9 @@
/// <summary>
/// Gets the member names of the specified item.
/// </summary>
- public IList<string> GetMemberNames(string name)
- {
- return commandLine.GetMemberNames(name);
- }
+ public IList<string> GetMemberNames(string name) => commandLine.GetMemberNames(name);
- public IList<string> GetGlobals(string name)
- {
- return commandLine.GetGlobals(name);
- }
+ public IList<string> GetGlobals(string name) => commandLine.GetGlobals(name);
/// <summary>
/// Returns the next line typed in by the console user. If no line is available this method
@@ -179,18 +166,12 @@
/// <summary>
/// Writes text followed by a newline to the console.
/// </summary>
- public void WriteLine(string text, Style style)
- {
- Write(text + Environment.NewLine, style);
- }
+ public void WriteLine(string text, Style style) => Write(text + Environment.NewLine, style);
/// <summary>
/// Writes an empty line to the console.
/// </summary>
- public void WriteLine()
- {
- Write(Environment.NewLine, Style.Out);
- }
+ public void WriteLine() => Write(Environment.NewLine, Style.Out);
/// <summary>
/// Indicates whether there is a line already read by the console and waiting to be processed.
@@ -220,15 +201,9 @@
/// Gets the lines that have not been returned by the ReadLine method. This does not
/// include the current line.
/// </summary>
- public string[] GetUnreadLines()
- {
- return previousLines.ToArray();
- }
+ public string[] GetUnreadLines() => previousLines.ToArray();
- private string GetLastTextEditorLine()
- {
- return textEditor.GetLine(textEditor.TotalLines - 1);
- }
+ private string GetLastTextEditorLine() => textEditor.GetLine(textEditor.TotalLines - 1);
private readonly object _syncInput = new object();
private bool _IsReadingInput;
@@ -271,9 +246,7 @@
this.IsReadingInput = false;
return lineInput;
}
-
-
private string ReadLineFromTextEditor()
{
Debug.WriteLine(string.Format("({0}): ReadLineFromTextEditor()", Thread.CurrentThread.ManagedThreadId));
@@ -401,26 +374,17 @@
/// <summary>
/// Returns true if the cursor is in a readonly text editor region.
/// </summary>
- private bool IsInReadOnlyRegion
- {
- get { return IsCurrentLineReadOnly || IsInPrompt; }
- }
+ private bool IsInReadOnlyRegion => IsCurrentLineReadOnly || IsInPrompt;
/// <summary>
/// Only the last line in the text editor is not read only.
/// </summary>
- private bool IsCurrentLineReadOnly
- {
- get { return textEditor.Line < textEditor.TotalLines - 1; }
- }
+ private bool IsCurrentLineReadOnly => textEditor.Line < textEditor.TotalLines - 1;
/// <summary>
/// Determines whether the current cursor position is in a prompt.
/// </summary>
- private bool IsInPrompt
- {
- get { return textEditor.Column - promptLength < 0; }
- }
+ private bool IsInPrompt => textEditor.Column - promptLength < 0;
/// <summary>
/// Returns true if the user can backspace at the current cursor position.
@@ -444,10 +408,7 @@
/// <summary>
/// The home position is at the start of the line after the prompt.
/// </summary>
- private void MoveToHomePosition()
- {
- textEditor.Column = promptLength;
- }
+ private void MoveToHomePosition() => textEditor.Column = promptLength;
/// <summary>
/// Shows the previous command line in the command line history.
Modified: trunk/Tools/Maestro/Maestro.AddIn.Scripting/Lang/Python/PythonConsoleHost.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Scripting/Lang/Python/PythonConsoleHost.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.AddIn.Scripting/Lang/Python/PythonConsoleHost.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -59,17 +59,14 @@
private ITextEditor textEditor;
private PythonConsole pythonConsole;
- public PythonConsole Console { get { return pythonConsole; } }
+ public PythonConsole Console => pythonConsole;
public PythonConsoleHost(ITextEditor textEditor)
{
this.textEditor = textEditor;
}
- protected override Type Provider
- {
- get { return typeof(PythonContext); }
- }
+ protected override Type Provider => typeof(PythonContext);
/// <summary>
/// Runs the console host in its own thread.
@@ -93,15 +90,9 @@
}
}
- protected override CommandLine CreateCommandLine()
- {
- return new PythonCommandLine();
- }
+ protected override CommandLine CreateCommandLine() => new PythonCommandLine();
- protected override OptionsParser CreateOptionsParser()
- {
- return new PythonOptionsParser();
- }
+ protected override OptionsParser CreateOptionsParser() => new PythonOptionsParser();
protected override ScriptRuntimeSetup CreateRuntimeSetup()
{
@@ -162,9 +153,6 @@
/// <summary>
/// Runs the console.
/// </summary>
- private void RunConsole()
- {
- Run(new string[0]);
- }
+ private void RunConsole() => Run(new string[0]);
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.AddIn.Scripting/Lang/Python/PythonOutputStream.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Scripting/Lang/Python/PythonOutputStream.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.AddIn.Scripting/Lang/Python/PythonOutputStream.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -52,25 +52,13 @@
this.textEditor = textEditor;
}
- public override bool CanRead
- {
- get { return true; }
- }
+ public override bool CanRead => true;
- public override bool CanSeek
- {
- get { return false; }
- }
+ public override bool CanSeek => false;
- public override bool CanWrite
- {
- get { return true; }
- }
+ public override bool CanWrite => true;
- public override long Length
- {
- get { return 0; }
- }
+ public override long Length => 0;
public override long Position
{
@@ -82,10 +70,7 @@
{
}
- public override long Seek(long offset, SeekOrigin origin)
- {
- return 0;
- }
+ public override long Seek(long offset, SeekOrigin origin) => 0;
public override void SetLength(long value)
{
Modified: trunk/Tools/Maestro/Maestro.AddIn.Scripting/ScriptingConfigProperties.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Scripting/ScriptingConfigProperties.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.AddIn.Scripting/ScriptingConfigProperties.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -33,18 +33,12 @@
/// <summary>
/// Default IronPython module path
/// </summary>
- public static string DefaultIronPythonModulePath
- {
- get { return Path.Combine(FileUtility.ApplicationRootPath, "AddIns\\Scripting\\Lib"); } //NOXLATE
- }
+ public static string DefaultIronPythonModulePath => Path.Combine(FileUtility.ApplicationRootPath, "AddIns\\Scripting\\Lib");
/// <summary>
/// Show the IronPython console by default
/// </summary>
- public static bool DefaultShowIronPythonConsole
- {
- get { return true; }
- }
+ public static bool DefaultShowIronPythonConsole => true;
/// <summary>
/// IronPython module path (property name)
Modified: trunk/Tools/Maestro/Maestro.AddIn.Scripting/Services/ScriptingClasses.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Scripting/Services/ScriptingClasses.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.AddIn.Scripting/Services/ScriptingClasses.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -58,29 +58,20 @@
/// <summary>
/// The main application window
/// </summary>
- public Workbench MainWindow
- {
- get { return Workbench.Instance; }
- }
+ public Workbench MainWindow => Workbench.Instance;
/// <summary>
/// Returns a list of the names of all currently open connections
/// </summary>
/// <returns></returns>
- public string[] GetConnectionNames()
- {
- return ServiceRegistry.GetService<ServerConnectionManager>().GetConnectionNames().ToArray();
- }
+ public string[] GetConnectionNames() => ServiceRegistry.GetService<ServerConnectionManager>().GetConnectionNames().ToArray();
/// <summary>
/// Gets the connection by its specified name
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public IServerConnection GetConnection(string name)
- {
- return ServiceRegistry.GetService<ServerConnectionManager>().GetConnection(name);
- }
+ public IServerConnection GetConnection(string name) => ServiceRegistry.GetService<ServerConnectionManager>().GetConnection(name);
/// <summary>
/// Gets the XML content of the given resource id
@@ -131,29 +122,20 @@
/// <param name="title"></param>
/// <param name="question"></param>
/// <returns></returns>
- public bool AskQuestion(string title, string question)
- {
- return MessageService.AskQuestion(question, title);
- }
+ public bool AskQuestion(string title, string question) => MessageService.AskQuestion(question, title);
/// <summary>
/// Displays a message
/// </summary>
/// <param name="title"></param>
/// <param name="message"></param>
- public void ShowMessage(string title, string message)
- {
- MessageService.ShowMessage(message, title);
- }
+ public void ShowMessage(string title, string message) => MessageService.ShowMessage(message, title);
/// <summary>
/// Displays an exception in a dialog
/// </summary>
/// <param name="ex"></param>
- public void ShowError(Exception ex)
- {
- ErrorDialog.Show(ex);
- }
+ public void ShowError(Exception ex) => ErrorDialog.Show(ex);
/// <summary>
/// Displays a resource picker for opening
@@ -311,9 +293,6 @@
/// must be done on this thread
/// </summary>
/// <param name="method"></param>
- public void UIInvoke(Delegate method)
- {
- this.MainWindow.Invoke(method);
- }
+ public void UIInvoke(Delegate method) => this.MainWindow.Invoke(method);
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.AddIn.Scripting/UI/IronPythonPreferences.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Scripting/UI/IronPythonPreferences.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.AddIn.Scripting/UI/IronPythonPreferences.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -44,15 +44,9 @@
txtModulePaths.Text = Props.Get(ScriptingConfigProperties.IronPythonModulePath, ScriptingConfigProperties.DefaultIronPythonModulePath);
}
- public string Title
- {
- get { return Strings.Title_IronPython_Console; }
- }
+ public string Title => Strings.Title_IronPython_Console;
- public Control ContentControl
- {
- get { return this; }
- }
+ public Control ContentControl => this;
public bool ApplyChanges()
{
Modified: trunk/Tools/Maestro/Maestro.Base/Commands/PasteCommand.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Commands/PasteCommand.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.Base/Commands/PasteCommand.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -164,12 +164,16 @@
private static RepositoryItem[] GetItems(ClipboardService clip)
{
object o = clip.Get();
+
+ var ri = o as RepositoryItem;
+ var riArr = o as RepositoryItem[];
+
if (o == null)
return new RepositoryItem[0];
- else if (o is RepositoryItem[])
- return (RepositoryItem[])o;
- else if (o is RepositoryItem)
- return new RepositoryItem[] { (RepositoryItem)o };
+ else if (riArr != null)
+ return riArr;
+ else if (ri != null)
+ return new RepositoryItem[] { ri };
return new RepositoryItem[0];
}
}
Modified: trunk/Tools/Maestro/Maestro.Base/Commands/ViewXmlChangesCommand.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Commands/ViewXmlChangesCommand.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.Base/Commands/ViewXmlChangesCommand.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -80,10 +80,8 @@
}
catch (Exception ex)
{
- string tmp = string.Format("{0}{1}{1}***STACK***{1}{2}",
- ex.Message,
- Environment.NewLine,
- ex.StackTrace);
+ string nl = Environment.NewLine;
+ string tmp = $"{ex.Message}{nl}{nl}***STACK***{nl}{ex.StackTrace}";
MessageBox.Show(tmp, Strings.CompareError);
return;
}
Modified: trunk/Tools/Maestro/Maestro.Base/Maestro.Base.csproj
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Maestro.Base.csproj 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.Base/Maestro.Base.csproj 2015-08-12 17:10:40 UTC (rev 8741)
@@ -601,6 +601,7 @@
</EmbeddedResource>
<EmbeddedResource Include="UI\DirtyStateConfirmationDialog.resx">
<DependentUpon>DirtyStateConfirmationDialog.cs</DependentUpon>
+ <SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="UI\IncompatibleResourcesDialog.resx">
<DependentUpon>IncompatibleResourcesDialog.cs</DependentUpon>
Modified: trunk/Tools/Maestro/Maestro.Base/Services/ClipboardService.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Services/ClipboardService.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.Base/Services/ClipboardService.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -90,6 +90,10 @@
Check.ArgumentNotEmpty(resId, nameof(resId));
var state = RepositoryItem.ClipboardAction.None;
object o = null;
+
+ var riArr = o as RepositoryItem[];
+ var ri = o as RepositoryItem;
+
lock (_clipLock)
{
o = _item;
@@ -98,9 +102,9 @@
{
state = RepositoryItem.ClipboardAction.None;
}
- else if (o is RepositoryItem[])
+ else if (riArr != null)
{
- foreach (RepositoryItem r in (RepositoryItem[])o)
+ foreach (var r in riArr)
{
if (resId.Equals(r.ResourceId))
{
@@ -109,12 +113,11 @@
}
}
}
- else if (o is RepositoryItem)
+ else if (ri != null)
{
- var r = ((RepositoryItem)o);
- if (resId.Equals(r.ResourceId))
+ if (resId.Equals(ri.ResourceId))
{
- state = r.ClipboardState;
+ state = ri.ClipboardState;
}
}
return state;
Modified: trunk/Tools/Maestro/Maestro.Base/UI/DirtyStateConfirmationDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/UI/DirtyStateConfirmationDialog.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.Base/UI/DirtyStateConfirmationDialog.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -98,10 +98,8 @@
}
catch (Exception ex)
{
- string tmp = string.Format("{0}{1}{1}***STACK***{1}{2}",
- ex.Message,
- Environment.NewLine,
- ex.StackTrace);
+ string nl = Environment.NewLine;
+ string tmp = $"{ex.Message}{nl}{nl}***STACK***{nl}{ex.StackTrace}";
MessageBox.Show(tmp, Strings.CompareError);
return;
}
Modified: trunk/Tools/Maestro/Maestro.Base/WorkbenchInitializer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/WorkbenchInitializer.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.Base/WorkbenchInitializer.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -25,6 +25,7 @@
using Maestro.Shared.UI;
using System.Collections.Generic;
using System.Windows.Forms;
+using System.Linq;
namespace Maestro.Base
{
@@ -63,18 +64,16 @@
/// <param name="toolstrips"></param>
public void UpdateMenuItemStatus(MenuStrip menu, IEnumerable<ToolStrip> toolstrips)
{
- foreach (ToolStripItem item in menu.Items)
+ foreach (var item in menu.Items.OfType<IStatusUpdate>())
{
- if (item is IStatusUpdate)
- (item as IStatusUpdate).UpdateStatus();
+ item.UpdateStatus();
}
foreach (ToolStrip ts in toolstrips)
{
- foreach (ToolStripItem item in ts.Items)
+ foreach (var item in ts.Items.OfType<IStatusUpdate>())
{
- if (item is IStatusUpdate)
- (item as IStatusUpdate).UpdateStatus();
+ item.UpdateStatus();
}
}
}
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/ColorComboBox.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/ColorComboBox.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/ColorComboBox.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -267,10 +267,11 @@
if (value == null)
return false;
- if (value.GetType() == typeof(SpecialCell))
+ var sc = value as SpecialCell;
+ if (sc != null)
{
if (value == m_currentColor)
- color = ((SpecialCell)value).Color;
+ color = sc.Color;
else
return false;
}
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/Expression/ExpressionDisplayDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/Expression/ExpressionDisplayDialog.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/Expression/ExpressionDisplayDialog.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -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;
@@ -55,9 +55,9 @@
private TreeNode LoadTree(FdoParseable obj)
{
- if (obj is FdoFilter)
+ if (obj.ParseableType == FdoParseableType.Filter)
return LoadFilterTree((FdoFilter)obj);
- else
+ else //Expression
return LoadExpressionTree((FdoExpression)obj);
}
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/Expression/FdoExpressionCompletionDataProvider.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/Expression/FdoExpressionCompletionDataProvider.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/Expression/FdoExpressionCompletionDataProvider.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -341,7 +341,7 @@
sb.Append(Environment.NewLine);
foreach (var argDef in sig.Arguments)
{
- sb.AppendFormat(" [{0}] - {1}{2}", argDef.Name, argDef.Description, Environment.NewLine);
+ sb.Append($" [{argDef.Name}] - {argDef.Description}{Environment.NewLine}"); //NOXLATE
}
argDesc = sb.ToString();
}
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/ExpressionEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/ExpressionEditor.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/ExpressionEditor.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -460,7 +460,7 @@
var tag = ColumnValue.Tag;
if (tag != null)
{
- if (ColumnValue.Tag == typeof(string) && (ColumnValue.SelectedIndex != 0 || ColumnValue.Text != "NULL")) //NOXLATE
+ if (ColumnValue.Tag as Type == typeof(string) && (ColumnValue.SelectedIndex != 0 || ColumnValue.Text != "NULL")) //NOXLATE
{
InsertText($"'{ColumnValue.Text}'"); //NOXLATE
}
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/MonoCompatibleExpressionEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/MonoCompatibleExpressionEditor.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/MonoCompatibleExpressionEditor.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -221,15 +221,14 @@
ToolStripMenuItem btn = new ToolStripMenuItem();
btn.Name = name;
btn.ToolTipText = desc;
-
- string fmt = "{0}({1})"; //NOXLATE
+
List<string> args = new List<string>();
foreach (var argDef in sig.Arguments)
{
args.Add(argDef.Name.Trim());
}
- string expr = string.Format(fmt, name, FdoExpressionCompletionDataProvider.StringifyFunctionArgs(args));
- btn.Text = expr + " : " + sig.ReturnType;
+ string expr = $"{name}({FdoExpressionCompletionDataProvider.StringifyFunctionArgs(args)})"; //NOXLATE
+ btn.Text = $"{expr} : {sig.ReturnType}"; //NOXLATE
btn.Click += (s, e) =>
{
InsertText(expr);
@@ -326,8 +325,7 @@
{
if (!string.IsNullOrEmpty(op))
{
- string filterTemplate = "<geometry property> {0} GeomFromText('<FGF geometry text>')";
- string exprText = string.Format(filterTemplate, op);
+ string exprText = $"<geometry property> {op} GeomFromText('<FGF geometry text>')"; //LOCALIZEME
InsertText(exprText);
}
}
@@ -583,13 +581,12 @@
var sigs = ExpressionEditor.MakeUniqueSignatures(func);
foreach (var sig in sigs)
{
- string fmt = "{0}({1})"; //NOXLATE
- List<string> args = new List<string>();
+ var args = new List<string>();
foreach (var argDef in sig.Arguments)
{
args.Add(argDef.Name.Trim());
}
- string expr = string.Format(fmt, func.Name, FdoExpressionCompletionDataProvider.StringifyFunctionArgs(args));
+ string expr = $"{func.Name}({FdoExpressionCompletionDataProvider.StringifyFunctionArgs(args)})"; //NOXLATE
if (!_autoCompleteItems.ContainsKey(func.Name))
_autoCompleteItems[func.Name] = new List<AutoCompleteItem>();
_autoCompleteItems[func.Name].Add(new FunctionItem(func, sig, expr));
@@ -680,32 +677,36 @@
private void HandleKeyDown(KeyEventArgs e)
{
Keys code = e.KeyCode;
- if (code == Keys.Escape)
+ switch (code)
{
- if (_autoBox.Visible)
- {
- e.SuppressKeyPress = true;
- _autoBox.Hide();
- _autoCompleteTooltip.Hide(this);
- }
+ case Keys.Escape:
+ if (_autoBox.Visible)
+ {
+ e.SuppressKeyPress = true;
+ _autoBox.Hide();
+ _autoCompleteTooltip.Hide(this);
+ }
+
+ break;
+ case Keys.Up:
+ case Keys.Down:
+ if (_autoBox.Visible)
+ {
+ e.SuppressKeyPress = true;
+ }
+
+ break;
+ case Keys.Enter: // || Keys.Return
+ if (_autoBox.Visible && _autoBox.SelectedItems.Count == 1)
+ {
+ e.SuppressKeyPress = true;
+ PutAutoCompleteSuggestion();
+ _autoBox.Hide();
+ _autoCompleteTooltip.Hide(this);
+ }
+
+ break;
}
- else if (code == Keys.Up || code == Keys.Down)
- {
- if (_autoBox.Visible)
- {
- e.SuppressKeyPress = true;
- }
- }
- else if (code == Keys.Enter || code == Keys.Return)
- {
- if (_autoBox.Visible && _autoBox.SelectedItems.Count == 1)
- {
- e.SuppressKeyPress = true;
- PutAutoCompleteSuggestion();
- _autoBox.Hide();
- _autoCompleteTooltip.Hide(this);
- }
- }
}
private void HandleKeyUp(KeyEventArgs e)
@@ -852,7 +853,7 @@
using (new WaitCursor(this))
{
string filter = null;
- var expr = "UNIQUE(" + ColumnName.Text + ")";
+ var expr = $"UNIQUE({ColumnName.Text})";
bool bFallback = false;
ColumnValue.Items.Clear();
ColumnValue.Tag = null;
@@ -970,14 +971,14 @@
var tag = ColumnValue.Tag;
if (tag != null)
{
- if (ColumnValue.Tag == typeof(string) && (ColumnValue.SelectedIndex != 0 || ColumnValue.Text != "NULL"))
+ if (ColumnValue.Tag as Type == typeof(string) && (ColumnValue.SelectedIndex != 0 || ColumnValue.Text != "NULL"))
{
- InsertText("'" + ColumnValue.Text + "'");
+ InsertText($"'{ColumnValue.Text}'"); //NOXLATE
}
else
{
if (tag is PropertyValueType && (PropertyValueType)tag == PropertyValueType.String)
- InsertText("'" + ColumnValue.Text + "'");
+ InsertText($"'{ColumnValue.Text}'"); //NOXLATE
else
InsertText(ColumnValue.Text);
}
@@ -1006,10 +1007,10 @@
{
using (var picker = new ColorDialog())
{
- if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+ if (picker.ShowDialog() == DialogResult.OK)
{
var c = picker.Color;
- this.InsertText(string.Format("ARGB({0}, {1}, {2}, {3})", c.A, c.R, c.G, c.B));
+ this.InsertText($"ARGB({c.A}, {c.R}, {c.G}, {c.B})"); //NOXLATE
}
}
}
@@ -1018,10 +1019,10 @@
{
using (var picker = new ColorDialog())
{
- if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+ if (picker.ShowDialog() == DialogResult.OK)
{
var c = picker.Color;
- this.InsertText(string.Format("HTMLCOLOR({0}, {1}, {2})", c.R, c.G, c.B));
+ this.InsertText($"HTMLCOLOR({c.R}, {c.G}, {c.B})"); //NOXLATE
}
}
}
@@ -1035,7 +1036,7 @@
}
using (var picker = new LookupExpressionBuilder(propNames.ToArray()))
{
- if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+ if (picker.ShowDialog() == DialogResult.OK)
{
this.InsertText(picker.GetExpression());
}
@@ -1051,7 +1052,7 @@
}
using (var picker = new RangeExpressionBuilder(propNames.ToArray()))
{
- if (picker.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+ if (picker.ShowDialog() == DialogResult.OK)
{
this.InsertText(picker.GetExpression());
}
@@ -1202,7 +1203,7 @@
this.DrawMode = DrawMode.OwnerDrawFixed;
}
- protected override void OnDrawItem(System.Windows.Forms.DrawItemEventArgs e)
+ protected override void OnDrawItem(DrawItemEventArgs e)
{
e.DrawBackground();
e.DrawFocusRectangle();
Modified: trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/AutoCompletion/QualifiedName.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/AutoCompletion/QualifiedName.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/AutoCompletion/QualifiedName.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -111,6 +111,7 @@
return equals;
}
+
/// <summary>
/// Returns the hash code for the QualifiedName
/// </summary>
Modified: trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/AutoCompletion/XmlElementPath.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/AutoCompletion/XmlElementPath.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditor/AutoCompletion/XmlElementPath.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -52,10 +52,7 @@
/// Gets the elements specifying the path.
/// </summary>
/// <remarks>The order of the elements determines the path.</remarks>
- public QualifiedNameCollection Elements
- {
- get { return elements; }
- }
+ public QualifiedNameCollection Elements => elements;
/// <summary>
/// Compacts the path so it only contains the elements that are from
@@ -86,10 +83,13 @@
/// </summary>
public override bool Equals(object obj)
{
- if (!(obj is XmlElementPath)) return false;
- if (this == obj) return true;
+ var rhs = obj as XmlElementPath;
- XmlElementPath rhs = (XmlElementPath)obj;
+ if (rhs == null)
+ return false;
+ if (this == obj)
+ return true;
+
if (elements.Count == rhs.elements.Count)
{
for (int i = 0; i < elements.Count; ++i)
@@ -105,10 +105,7 @@
return false;
}
- public override int GetHashCode()
- {
- return elements.GetHashCode();
- }
+ public override int GetHashCode() => elements.GetHashCode();
/// <summary>
/// Gets a string that represents the XmlElementPath.
@@ -134,7 +131,7 @@
}
return toString.ToString();
}
- return String.Empty;
+ return string.Empty;
}
/// <summary>
@@ -182,7 +179,7 @@
{
if (name.Prefix.Length > 0)
{
- return name.Prefix + ":" + name.Name;
+ return $"{name.Prefix}:{name.Name}";
}
return name.Name;
}
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/GridEditor/VectorScaleRangeGrid.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/GridEditor/VectorScaleRangeGrid.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/GridEditor/VectorScaleRangeGrid.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -289,7 +289,7 @@
private void SetActiveControl(RuleGridView activeGrid)
{
- Debug.WriteLine(string.Format("Set active composite rule grid to: {0}", activeGrid.GetHashCode()));
+ Debug.WriteLine($"Set active composite rule grid to: {activeGrid.GetHashCode()}");
splitContainer1.Panel2.Controls.Clear();
activeGrid.Dock = DockStyle.Fill;
splitContainer1.Panel2.Controls.Add(activeGrid);
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/PointFeatureStyleEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/PointFeatureStyleEditor.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/StyleEditors/PointFeatureStyleEditor.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -1434,11 +1434,13 @@
if (m_inUpdate)
return;
+ var fontSym = m_item.Symbol as IFontSymbol;
//TODO: Validate
- if (!(m_item.Symbol is IFontSymbol))
+ if (fontSym == null)
return;
- ((IFontSymbol)m_item.Symbol).FontName = fontCombo.Text;
+ fontSym.FontName = fontCombo.Text;
+
comboBoxCharacter.Items.Clear();
try
{
@@ -1577,9 +1579,10 @@
private void ReferenceY_Leave(object sender, EventArgs e)
{
double d;
- if (m_item.Symbol is IMarkSymbol)
- 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);
+ var markSym = m_item.Symbol as IMarkSymbol;
+
+ if (markSym != null && !double.TryParse(markSym.InsertionPointY, NumberStyles.Float, CultureInfo.InvariantCulture, out d))
+ MessageBox.Show(this, Strings.InsertionPointYError, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
private void FontBoldButton_Click(object sender, EventArgs e)
Modified: trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -134,9 +134,10 @@
private bool DrawColorSetPreview(DrawItemEventArgs args, object o)
{
- if (o is ColorBrewer.ColorBrewerListItem)
+ var cbLi = o as ColorBrewer.ColorBrewerListItem;
+ if (cbLi != null)
{
- ColorBrewer cb = (o as ColorBrewer.ColorBrewerListItem).Set;
+ var cb = cbLi.Set;
int maxItems = (args.Bounds.Width - 2) / 10;
int items = Math.Min(maxItems, cb.Colors.Count);
@@ -628,7 +629,7 @@
string.Format(System.Globalization.CultureInfo.InvariantCulture, "\"{0}\" = '{1}'", ColumnCombo.Text, items[i]),
string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", items[i]),
colors[i]);
- r.IndividualValue = "'" + items[i].ToString() + "'";
+ r.IndividualValue = $"'{items[i].ToString()}'";
result.Add(r);
}
else
@@ -954,18 +955,13 @@
RuleItem defaultRule = null;
foreach (var rule in rules)
{
- if (rule.IndividualValue == "''")
+ if (rule.IndividualValue == "''") //NOXLATE
defaultRule = rule;
else
- strings.Add(string.Format("{0}, ARGB({1}, {2}, {3}, {4})", rule.IndividualValue, rule.Color.A, rule.Color.R, rule.Color.G, rule.Color.B));
+ strings.Add($"{rule.IndividualValue}, ARGB({rule.Color.A}, {rule.Color.R}, {rule.Color.G}, {rule.Color.B})"); //NOXLATE
}
- _inserter.InsertText(string.Format("LOOKUP({0}, ARGB({1}, {2}, {3}, {4}), {5})",
- ColumnCombo.Text,
- defaultRule.Color.A,
- defaultRule.Color.R,
- defaultRule.Color.G,
- defaultRule.Color.B,
- string.Join(", ", strings.ToArray())));
+
+ _inserter.InsertText($"LOOKUP({ColumnCombo.Text}, ARGB({defaultRule.Color.A}, {defaultRule.Color.R}, {defaultRule.Color.G}, {defaultRule.Color.B}), {string.Join(", ", strings.ToArray())})"); //NOXLATE
}
this.DialogResult = DialogResult.OK;
this.Close();
@@ -1032,7 +1028,7 @@
foreach (RuleItem entry in rules)
{
var r = (template != null) ? CreateCompositeRule(template, _factory) : _factory.CreateDefaultCompositeRule();
- Debug.WriteLine("Made rule {0}", r.GetHashCode());
+ Debug.WriteLine($"Made rule {r.GetHashCode()}"); //NOXLATE
r.Filter = entry.Filter;
r.LegendLabel = entry.Label;
if (r.CompositeSymbolization != null)
@@ -1074,13 +1070,13 @@
string color = path.FillColor;
if (source.Value == FillColorSource.PathFillColor)
{
- path.FillColor = "0x" + fillAlpha + Utility.SerializeHTMLColor(entry.Color, string.IsNullOrEmpty(fillAlpha));
- Debug.WriteLine(string.Format("Set fill color to {0} for symbol instance {1} of symbolization {2} in rule {3}", path.FillColor, symInst.GetHashCode(), r.CompositeSymbolization.GetHashCode(), r.GetHashCode()));
+ path.FillColor = FormatColor(fillAlpha, entry);
+ Debug.WriteLine($"Set fill color to {path.FillColor} for symbol instance {symInst.GetHashCode()} of symbolization {r.CompositeSymbolization.GetHashCode()} in rule {r.GetHashCode()}"); //NOXLATE
bSetFill = true;
break;
}
//Is this a parameter?
- if (color.StartsWith("%") && color.EndsWith("%"))
+ if (IsSymbolParameter(color))
{
string paramName = color.Substring(1, color.Length - 2);
if (simpleSym.ParameterDefinition != null)
@@ -1094,8 +1090,8 @@
{
if (source.Value == FillColorSource.SymbolParameterFillColorDefaultValue)
{
- paramDef.DefaultValue = "0x" + fillAlpha + Utility.SerializeHTMLColor(entry.Color, string.IsNullOrEmpty(fillAlpha));
- Debug.WriteLine(string.Format("Set fill color default parameter value to {0} for symbol instance {1} of symbolization {2} in rule {3}", paramDef.DefaultValue, symInst.GetHashCode(), r.CompositeSymbolization.GetHashCode(), r.GetHashCode()));
+ paramDef.DefaultValue = FormatColor(fillAlpha, entry);
+ Debug.WriteLine($"Set fill color default parameter value to {paramDef.DefaultValue} for symbol instance {symInst.GetHashCode()} of symbolization {r.CompositeSymbolization.GetHashCode()} in rule {r.GetHashCode()}"); //NOXLATE
bSetFill = true;
break;
}
@@ -1113,8 +1109,8 @@
{
if (source.Value == FillColorSource.SymbolParameterFillColorOverride)
{
- pov.ParameterValue = "0x" + fillAlpha + Utility.SerializeHTMLColor(entry.Color, string.IsNullOrEmpty(fillAlpha));
- Debug.WriteLine(string.Format("Set fill color parameter override value to {0} for symbol instance {1} of symbolization {2} in rule {3}", pov.ParameterValue, symInst.GetHashCode(), r.CompositeSymbolization.GetHashCode(), r.GetHashCode()));
+ pov.ParameterValue = FormatColor(fillAlpha, entry);
+ Debug.WriteLine($"Set fill color parameter override value to {pov.ParameterValue} for symbol instance {symInst.GetHashCode()} of symbolization {r.CompositeSymbolization.GetHashCode()} in rule {r.GetHashCode()}"); //NOXLATE
bSetFill = true;
break;
}
@@ -1131,13 +1127,13 @@
string color = path.LineColor;
if (source.Value == FillColorSource.PathLineColor)
{
- path.LineColor = "0x" + fillAlpha + Utility.SerializeHTMLColor(entry.Color, string.IsNullOrEmpty(fillAlpha));
- Debug.WriteLine(string.Format("Set line color to {0} for symbol instance {1} of symbolization {2} in rule {3}", path.FillColor, symInst.GetHashCode(), r.CompositeSymbolization.GetHashCode(), r.GetHashCode()));
+ path.LineColor = FormatColor(fillAlpha, entry);
+ Debug.WriteLine($"Set line color to {path.FillColor} for symbol instance {symInst.GetHashCode()} of symbolization {r.CompositeSymbolization.GetHashCode()} in rule {r.GetHashCode()}"); //NOXLATE
bSetFill = true;
break;
}
//Is this a parameter?
- if (color.StartsWith("%") && color.EndsWith("%"))
+ if (IsSymbolParameter(color))
{
string paramName = color.Substring(1, color.Length - 2);
if (simpleSym.ParameterDefinition != null)
@@ -1151,8 +1147,8 @@
{
if (source.Value == FillColorSource.SymbolParameterLineColorDefaultValue)
{
- paramDef.DefaultValue = "0x" + fillAlpha + Utility.SerializeHTMLColor(entry.Color, string.IsNullOrEmpty(fillAlpha));
- Debug.WriteLine(string.Format("Set line color default parameter value to {0} for symbol instance {1} of symbolization {2} in rule {3}", paramDef.DefaultValue, symInst.GetHashCode(), r.CompositeSymbolization.GetHashCode(), r.GetHashCode()));
+ paramDef.DefaultValue = FormatColor(fillAlpha, entry);
+ Debug.WriteLine($"Set line color default parameter value to {paramDef.DefaultValue} for symbol instance {symInst.GetHashCode()} of symbolization {r.CompositeSymbolization.GetHashCode()} in rule {r.GetHashCode()}"); //NOXLATE
bSetFill = true;
break;
}
@@ -1170,8 +1166,8 @@
{
if (source.Value == FillColorSource.SymbolParameterLineColorOverride)
{
- pov.ParameterValue = "0x" + fillAlpha + Utility.SerializeHTMLColor(entry.Color, string.IsNullOrEmpty(fillAlpha));
- Debug.WriteLine(string.Format("Set line color parameter override value to {0} for symbol instance {1} of symbolization {2} in rule {3}", pov.ParameterValue, symInst.GetHashCode(), r.CompositeSymbolization.GetHashCode(), r.GetHashCode()));
+ pov.ParameterValue = FormatColor(fillAlpha, entry);
+ Debug.WriteLine($"Set line color parameter override value to {pov.ParameterValue} for symbol instance {symInst.GetHashCode()} of symbolization {r.CompositeSymbolization.GetHashCode()} in rule {r.GetHashCode()}"); //NOXLATE
bSetFill = true;
break;
}
@@ -1188,6 +1184,10 @@
}
}
+ static bool IsSymbolParameter(string str) => (str?.StartsWith("%") == true) && (str?.EndsWith("%") == true); //NOXLATE
+
+ static string FormatColor(string fillAlpha, RuleItem entry) => $"0x{fillAlpha}{Utility.SerializeHTMLColor(entry.Color, string.IsNullOrEmpty(fillAlpha))}";
+
private void IdentifyColorSource(ICompositeRule template, ref FillColorSource? source, ref string fillAlpha)
{
// FIXME: This is very naive. It will identify the first color it finds and runs with it.
@@ -1230,7 +1230,7 @@
{
string color = path.FillColor;
//Is this a parameter?
- if (color.StartsWith("%") && color.EndsWith("%"))
+ if (IsSymbolParameter(color))
{
string paramName = color.Substring(1, color.Length - 2);
if (simpleSym.ParameterDefinition != null)
@@ -1317,7 +1317,7 @@
{
string color = path.LineColor;
//Is this a parameter?
- if (color.StartsWith("%") && color.EndsWith("%"))
+ if (IsSymbolParameter(color))
{
string paramName = color.Substring(1, color.Length - 2);
if (simpleSym.ParameterDefinition != null)
Modified: trunk/Tools/Maestro/Maestro.Editors/MapDefinition/GroupPropertiesCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/MapDefinition/GroupPropertiesCtrl.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.Editors/MapDefinition/GroupPropertiesCtrl.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -55,21 +55,7 @@
group.PropertyChanged += WeakEventHandler.Wrap<PropertyChangedEventHandler>(OnGroupChanged, (eh) => group.PropertyChanged -= eh);
string currentName = group.Name;
txtName.Text = currentName;
- //TextBoxBinder.BindText(txtName, group, "Name");
- /*
- IMapDefinition mdf = group.Parent;
- string currentName = group.Name;
- txtName.Text = currentName;
- txtName.TextChanged += (s, e) =>
- {
- string newName = txtName.Text;
- group.Name = newName;
- mdf.UpdateDynamicGroupName(currentName, newName);
- System.Diagnostics.Debug.WriteLine(string.Format("Updated group name {0} -> {1}", currentName, newName));
- currentName = newName;
- };*/
-
- TextBoxBinder.BindText(txtLegendLabel, group, "LegendLabel");
+ TextBoxBinder.BindText(txtLegendLabel, group, nameof(group.LegendLabel));
}
finally
{
@@ -131,7 +117,7 @@
string currentName = _el.Name;
_el.Name = newName;
_mdf.UpdateDynamicGroupName(currentName, newName);
- System.Diagnostics.Debug.WriteLine(string.Format("Updated group name {0} -> {1}", currentName, newName));
+ System.Diagnostics.Debug.WriteLine($"Updated group name {currentName} -> {newName}");
}
else
{
Modified: trunk/Tools/Maestro/Maestro.Editors/TileSetDefinition/GroupPropertiesCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/TileSetDefinition/GroupPropertiesCtrl.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.Editors/TileSetDefinition/GroupPropertiesCtrl.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -56,20 +56,6 @@
group.PropertyChanged += WeakEventHandler.Wrap<PropertyChangedEventHandler>(OnGroupChanged, (eh) => group.PropertyChanged -= eh);
string currentName = group.Name;
txtName.Text = currentName;
- //TextBoxBinder.BindText(txtName, group, "Name");
- /*
- IMapDefinition mdf = group.Parent;
- string currentName = group.Name;
- txtName.Text = currentName;
- txtName.TextChanged += (s, e) =>
- {
- string newName = txtName.Text;
- group.Name = newName;
- mdf.UpdateDynamicGroupName(currentName, newName);
- System.Diagnostics.Debug.WriteLine(string.Format("Updated group name {0} -> {1}", currentName, newName));
- currentName = newName;
- };*/
-
TextBoxBinder.BindText(txtLegendLabel, group, nameof(group.LegendLabel));
}
finally
Modified: trunk/Tools/Maestro/Maestro.LiveMapEditor/AboutDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.LiveMapEditor/AboutDialog.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.LiveMapEditor/AboutDialog.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -31,9 +31,9 @@
public AboutDialog()
{
InitializeComponent();
- this.Text = String.Format("About {0}", AssemblyTitle);
+ this.Text = $"About {AssemblyTitle}"; //LOCALIZEME
this.labelProductName.Text = AssemblyProduct;
- this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
+ this.labelVersion.Text = "Version {AssemblyVersion}"; //LOCALIZEME
this.labelCopyright.Text = AssemblyCopyright;
this.labelCompanyName.Text = AssemblyCompany;
this.textBoxDescription.Text = AssemblyDescription;
@@ -49,7 +49,7 @@
if (attributes.Length > 0)
{
AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
- if (titleAttribute.Title != "")
+ if (titleAttribute.Title != string.Empty)
{
return titleAttribute.Title;
}
@@ -58,13 +58,7 @@
}
}
- public string AssemblyVersion
- {
- get
- {
- return Assembly.GetExecutingAssembly().GetName().Version.ToString();
- }
- }
+ public string AssemblyVersion => Assembly.GetExecutingAssembly().GetName().Version.ToString();
public string AssemblyDescription
{
@@ -73,7 +67,7 @@
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
if (attributes.Length == 0)
{
- return "";
+ return string.Empty;
}
return ((AssemblyDescriptionAttribute)attributes[0]).Description;
}
@@ -86,7 +80,7 @@
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
if (attributes.Length == 0)
{
- return "";
+ return string.Empty;
}
return ((AssemblyProductAttribute)attributes[0]).Product;
}
@@ -99,7 +93,7 @@
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
if (attributes.Length == 0)
{
- return "";
+ return string.Empty;
}
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
}
@@ -112,7 +106,7 @@
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
if (attributes.Length == 0)
{
- return "";
+ return string.Empty;
}
return ((AssemblyCompanyAttribute)attributes[0]).Company;
}
Modified: trunk/Tools/Maestro/Maestro.Login/PreferedSite.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Login/PreferedSite.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.Login/PreferedSite.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -371,7 +371,7 @@
[System.Xml.Serialization.XmlIgnore]
public string UnscrambledPassword
{
- get { return System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(m_scrambledPassword == null ? string.Empty : m_scrambledPassword)); }
+ get { return System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(m_scrambledPassword ?? string.Empty)); }
set { m_scrambledPassword = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(value)); }
}
Modified: trunk/Tools/Maestro/Maestro.MapViewer/LegendPresenter.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.MapViewer/LegendPresenter.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.MapViewer/LegendPresenter.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -1044,25 +1044,22 @@
/// <summary>
/// Gets the legend label
/// </summary>
- public string LegendLabel { get { return this.Group.LegendLabel; } }
+ public string LegendLabel => this.Group.LegendLabel;
/// <summary>
/// Gets the name of the parent group
/// </summary>
- public string ParentGroupName { get { return this.Group.Group; } }
+ public string ParentGroupName => this.Group.Group;
/// <summary>
/// Gets the name of this group
/// </summary>
- public string Name { get { return this.Group.Name; } }
+ public string Name => this.Group.Name;
/// <summary>
/// Gets the unique id of this group
/// </summary>
- public override string ObjectId
- {
- get { return this.Group.ObjectId; }
- }
+ public override string ObjectId => this.Group.ObjectId;
}
/// <summary>
@@ -1187,20 +1184,17 @@
/// <summary>
/// Gets the parent group name
/// </summary>
- public string ParentGroupName { get { return this.Layer.Group; } }
+ public string ParentGroupName => this.Layer.Group;
/// <summary>
/// Gets the name
/// </summary>
- public string Name { get { return this.Layer.Name; } }
+ public string Name => this.Layer.Name;
/// <summary>
/// Gets the object id
/// </summary>
- public override string ObjectId
- {
- get { return this.Layer.ObjectId; }
- }
+ public override string ObjectId => this.Layer.ObjectId;
private bool? _isRaster;
@@ -1215,7 +1209,7 @@
return _isRaster.Value;
if (!string.IsNullOrEmpty(this.LayerDefinitionContent))
- _isRaster = this.LayerDefinitionContent.Contains("<GridLayerDefinition");
+ _isRaster = this.LayerDefinitionContent.Contains("<GridLayerDefinition"); //NOXLATE
if (_isRaster.HasValue)
return _isRaster.Value;
Modified: trunk/Tools/Maestro/Maestro.MapViewer/MapViewer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.MapViewer/MapViewer.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.MapViewer/MapViewer.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -1764,18 +1764,12 @@
/// <summary>
/// Gets the current index in the view history stack
/// </summary>
- public int ViewHistoryIndex
- {
- get { return _viewHistoryIndex; }
- }
+ public int ViewHistoryIndex => _viewHistoryIndex;
/// <summary>
/// Gets the view history stack. The first item being the earliest and the last item being the most recent.
/// </summary>
- public ReadOnlyCollection<MapViewHistoryEntry> ViewHistory
- {
- get { return _viewHistory.AsReadOnly(); }
- }
+ public ReadOnlyCollection<MapViewHistoryEntry> ViewHistory => _viewHistory.AsReadOnly();
internal void ZoomToView(double x, double y, double scale, bool refresh, bool raiseEvents, bool addToHistoryStack)
{
Modified: trunk/Tools/Maestro/Maestro.Shared.UI/ViewContentBase.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Shared.UI/ViewContentBase.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.Shared.UI/ViewContentBase.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -44,12 +44,12 @@
/// <summary>
/// Gets whether this instance is a modal window
/// </summary>
- public virtual bool IsModalWindow { get { return false; } }
+ public virtual bool IsModalWindow => false;
/// <summary>
/// Gets whether this instance can only be docked to the document region
/// </summary>
- public virtual bool IsExclusiveToDocumentRegion { get { return false; } }
+ public virtual bool IsExclusiveToDocumentRegion => false;
private string _title;
@@ -67,9 +67,7 @@
if (_title != value)
{
_title = value;
- var handler = this.TitleChanged;
- if (handler != null)
- handler(this, EventArgs.Empty);
+ this.TitleChanged?.Invoke(this, EventArgs.Empty);
}
}
}
@@ -90,17 +88,9 @@
_parent.FormClosing += new FormClosingEventHandler(OnParentFormClosed);
}
- private void OnParentFormClosed(object sender, FormClosingEventArgs e)
- {
- var h = this.ViewContentClosed;
- if (h != null)
- h(this, EventArgs.Empty);
- }
+ private void OnParentFormClosed(object sender, FormClosingEventArgs e) => this.ViewContentClosed?.Invoke(this, EventArgs.Empty);
- private void OnParentFormClosing(object sender, FormClosingEventArgs e)
- {
- e.Cancel = CheckCancelEvents();
- }
+ private void OnParentFormClosing(object sender, FormClosingEventArgs e) => e.Cancel = CheckCancelEvents();
/// <summary>
/// Fires when the title has been changed
@@ -112,29 +102,19 @@
/// in any way. All view content can still be programmatically closed if they inherit from <see cref="ViewContentBase"/> and
/// does not override the default implementation of <see cref="Close"/>
/// </summary>
- public virtual bool AllowUserClose
- {
- get { return true; }
- }
+ public virtual bool AllowUserClose => true;
internal bool CheckCancelEvents()
{
CancelEventArgs ce = new CancelEventArgs(false);
- var ceHandler = this.ViewContentClosing;
- if (ceHandler != null)
- ceHandler(this, ce);
-
+ this.ViewContentClosing?.Invoke(this, ce);
return ce.Cancel;
}
/// <summary>
/// Closes the view. This raises the <see cref="ViewContentClosing"/> event
/// </summary>
- public virtual void Close()
- {
- if (_parent != null)
- _parent.Close();
- }
+ public virtual void Close() => _parent?.Close();
/// <summary>
/// Fired when the view has been closed internally
@@ -145,31 +125,20 @@
/// Displays an exception message
/// </summary>
/// <param name="ex">The exception object</param>
- public void ShowError(Exception ex)
- {
- ErrorDialog.Show(ex);
- }
+ public void ShowError(Exception ex) => ErrorDialog.Show(ex);
/// <summary>
/// Displays an error message
/// </summary>
/// <param name="message">The message</param>
- public virtual void ShowError(string message)
- {
- //MessageService.ShowError(message);
- ErrorDialog.Show(message, message);
- }
+ public virtual void ShowError(string message) => ErrorDialog.Show(message, message);
/// <summary>
/// Displays an alert message
/// </summary>
/// <param name="title">The title of this message</param>
/// <param name="message">The message</param>
- public virtual void ShowMessage(string title, string message)
- {
- //MessageService.ShowMessage(message, title);
- MessageBox.Show(message, title);
- }
+ public virtual void ShowMessage(string title, string message) => MessageBox.Show(message, title);
/// <summary>
/// Make a request for confirmation
@@ -179,11 +148,8 @@
/// <returns>
/// true if confirmed, false otherwise
/// </returns>
- public virtual bool Confirm(string title, string message)
- {
- //return MessageService.AskQuestion(message, title);
- return MessageBox.Show(message, title, MessageBoxButtons.YesNo) == DialogResult.Yes;
- }
+ public virtual bool Confirm(string title, string message)
+ => MessageBox.Show(message, title, MessageBoxButtons.YesNo) == DialogResult.Yes;
/// <summary>
/// Make a request for confirmation
@@ -194,11 +160,8 @@
/// <returns>
/// true if confirmed, false otherwise
/// </returns>
- public virtual bool ConfirmFormatted(string title, string format, params string[] args)
- {
- //return MessageService.AskQuestion(string.Format(format, args), title);
- return MessageBox.Show(string.Format(format, args), title, MessageBoxButtons.YesNo) == DialogResult.Yes;
- }
+ public virtual bool ConfirmFormatted(string title, string format, params string[] args)
+ => MessageBox.Show(string.Format(format, args), title, MessageBoxButtons.YesNo) == DialogResult.Yes;
/// <summary>
/// The underlying control
@@ -224,9 +187,7 @@
if (_description != value)
{
_description = value;
- var handler = this.DescriptionChanged;
- if (handler != null)
- handler(this, EventArgs.Empty);
+ this.DescriptionChanged?.Invoke(this, EventArgs.Empty);
}
}
}
@@ -239,12 +200,7 @@
/// <summary>
/// Makes this content active
/// </summary>
- public void Activate()
- {
- var handler = this.ViewContentActivating;
- if (handler != null)
- handler(this, EventArgs.Empty);
- }
+ public void Activate() => this.ViewContentActivating?.Invoke(this, EventArgs.Empty);
/// <summary>
/// Fired when the view is going to hide
@@ -265,12 +221,7 @@
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence"/>
/// <IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/>
/// </PermissionSet>
- void IViewContent.Hide()
- {
- var handler = this.ViewContentHiding;
- if (handler != null)
- handler(this, EventArgs.Empty);
- }
+ void IViewContent.Hide() => this.ViewContentHiding?.Invoke(this, EventArgs.Empty);
/// <summary>
/// Indicates whether this view is attached to a workbench
@@ -284,18 +235,12 @@
/// <summary>
/// Indicates the default region this view content will be put in
/// </summary>
- public virtual ViewRegion DefaultRegion
- {
- get { return ViewRegion.Document; }
- }
+ public virtual ViewRegion DefaultRegion => ViewRegion.Document;
/// <summary>
/// Gets the icon for this view
/// </summary>
- public virtual Icon ViewIcon
- {
- get { return null; }
- }
+ public virtual Icon ViewIcon => null;
/// <summary>
/// Fired when the view has been closed internally
Modified: trunk/Tools/Maestro/Maestro.Shared.UI/WorkbenchBase.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Shared.UI/WorkbenchBase.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Maestro.Shared.UI/WorkbenchBase.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -281,28 +281,19 @@
/// Gets the toolbar names.
/// </summary>
/// <value>The toolbar names.</value>
- public ICollection<string> ToolbarNames
- {
- get { return _toolstrips.Keys; }
- }
+ public ICollection<string> ToolbarNames => _toolstrips.Keys;
/// <summary>
/// Sets the status label.
/// </summary>
/// <param name="text">The text.</param>
- public void SetStatusLabel(string text)
- {
- statusLabel.Text = text;
- }
+ public void SetStatusLabel(string text) => statusLabel.Text = text;
/// <summary>
/// Sets the title.
/// </summary>
/// <param name="title">The title.</param>
- public void SetTitle(string title)
- {
- this.Text = title;
- }
+ public void SetTitle(string title) => this.Text = title;
/// <summary>
/// Gets the active view in the document region
@@ -378,13 +369,10 @@
}
}
- private void OnApplicationIdle(object sender, EventArgs e)
- {
- // Use the Idle event to update the status of menu and toolbar.
- // Depending on your application and the number of menu items with complex conditions,
- // you might want to update the status less frequently.
- _workbenchInitializer.UpdateMenuItemStatus(menu, _toolstrips.Values);
- }
+ // Use the Idle event to update the status of menu and toolbar.
+ // Depending on your application and the number of menu items with complex conditions,
+ // you might want to update the status less frequently.
+ private void OnApplicationIdle(object sender, EventArgs e) => _workbenchInitializer.UpdateMenuItemStatus(menu, _toolstrips.Values);
private void closeToolStripMenuItem_Click(object sender, EventArgs e)
{
Modified: trunk/Tools/Maestro/MgCooker/Progress.cs
===================================================================
--- trunk/Tools/Maestro/MgCooker/Progress.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/MgCooker/Progress.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -153,11 +153,11 @@
TimeSpan elapsed = DateTime.Now - m_grandBegin;
DateTime finish = DateTime.Now + (new TimeSpan(m_prevDuration.Ticks * m_grandTotalTiles) - elapsed);
TimeSpan remain = finish - DateTime.Now;
-
+
if (finish < DateTime.Now)
finishEstimate.Text = Strings.InsufficientTimePassed;
else
- finishEstimate.Text = string.Format(Strings.RemainingTime, finish.ToShortTimeString(), string.Format("{0}:{1}:{2}", (int)Math.Floor(remain.TotalHours), remain.Minutes.ToString("00"), remain.Seconds.ToString("00")));
+ finishEstimate.Text = string.Format(Strings.RemainingTime, finish.ToShortTimeString(), $"{Math.Floor(remain.TotalHours)}:{remain.Minutes.ToString("00")}:{remain.Seconds.ToString("00")}");
}
}
Modified: trunk/Tools/Maestro/MgCooker/SetupRun.cs
===================================================================
--- trunk/Tools/Maestro/MgCooker/SetupRun.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/MgCooker/SetupRun.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -341,15 +341,17 @@
private void btnSaveScript_Click(object sender, EventArgs e)
{
- if (System.Environment.OSVersion.Platform == PlatformID.Unix)
+ if (Environment.OSVersion.Platform == PlatformID.Unix)
+ {
saveFileDialog.Filter =
string.Format(Strings.FileTypeShellScript + "|{0}", "*.sh") + //NOXLATE
string.Format(Strings.FileTypeAllFiles + "|{0}", "*.*"); //NOXLATE
+ }
if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
{
//Common args for all map defintions to be tiled
- List<string> args = new List<string>();
+ var args = new List<string>();
PushArg(args, TileRunParameters.PROVIDER, txtProvider.Text);
PushArg(args, TileRunParameters.CONNECTIONPARAMS, txtConnectionString.Text);
@@ -371,19 +373,19 @@
string cmdExecutable = "MgCookerCmd.exe"; //NOXLATE
//Windows has problems with console output from GUI applications...
- if (System.Environment.OSVersion.Platform != PlatformID.Unix && executable == "MgCooker.exe" && System.IO.File.Exists(System.IO.Path.Combine(Application.StartupPath, cmdExecutable))) //NOXLATE
- executable = System.IO.Path.Combine(Application.StartupPath, cmdExecutable); //NOXLATE
+ if (Environment.OSVersion.Platform != PlatformID.Unix && executable == "MgCooker.exe" && System.IO.File.Exists(System.IO.Path.Combine(Application.StartupPath, cmdExecutable))) //NOXLATE
+ executable = Path.Combine(Application.StartupPath, cmdExecutable); //NOXLATE
else
- executable = System.IO.Path.Combine(Application.StartupPath, executable);
+ executable = Path.Combine(Application.StartupPath, executable);
- string exeName = System.IO.Path.GetFileName(executable);
- string exePath = System.IO.Path.GetDirectoryName(executable);
+ string exeName = Path.GetFileName(executable);
+ string exePath = Path.GetDirectoryName(executable);
executable = $"\"{executable}\""; //NOXLATE
- using (System.IO.StreamWriter sw = new System.IO.StreamWriter(saveFileDialog.FileName))
+ using (var sw = new StreamWriter(saveFileDialog.FileName))
{
- if (System.Environment.OSVersion.Platform == PlatformID.Unix)
+ if (Environment.OSVersion.Platform == PlatformID.Unix)
{
sw.WriteLine("#!/bin/sh"); //NOXLATE
executable = "mono " + executable; //NOXLATE
@@ -396,8 +398,8 @@
//If on windows, wrap the exe call in a pushd/popd so that the executable is
//executed from its own directory
- if (System.Environment.OSVersion.Platform != PlatformID.MacOSX ||
- System.Environment.OSVersion.Platform != PlatformID.Unix)
+ if (Environment.OSVersion.Platform != PlatformID.MacOSX ||
+ Environment.OSVersion.Platform != PlatformID.Unix)
{
sw.WriteLine($"pushd \"{exePath}\""); //NOXLATE
}
@@ -406,8 +408,8 @@
{
//Map-specific args
List<string> argsMap = new List<string>();
- if (System.Environment.OSVersion.Platform != PlatformID.MacOSX ||
- System.Environment.OSVersion.Platform != PlatformID.Unix)
+ if (Environment.OSVersion.Platform != PlatformID.MacOSX ||
+ Environment.OSVersion.Platform != PlatformID.Unix)
{
argsMap.Add(exeName);
}
@@ -460,8 +462,8 @@
sw.WriteLine();
}
- if (System.Environment.OSVersion.Platform != PlatformID.MacOSX ||
- System.Environment.OSVersion.Platform != PlatformID.Unix)
+ if (Environment.OSVersion.Platform != PlatformID.MacOSX ||
+ Environment.OSVersion.Platform != PlatformID.Unix)
{
sw.WriteLine("popd"); //NOXLATE
}
@@ -624,7 +626,7 @@
BusyWaitDialog.Run(Strings.CalculatingMpu, () =>
{
var currentPath = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath);
- var mpuCalc = Path.Combine(currentPath, "AddIns/Local/MpuCalc.exe");
+ var mpuCalc = Path.Combine(currentPath, "AddIns/Local/MpuCalc.exe"); //NOXLATE
if (!File.Exists(mpuCalc) && mapDef.EndsWith(ResourceTypes.MapDefinition.ToString()))
{
int[] cmdTypes = m_connection.Capabilities.SupportedCommands;
Modified: trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoBinaryExpression.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoBinaryExpression.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoBinaryExpression.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -38,10 +38,7 @@
public class FdoBinaryExpression : FdoExpression
{
- public override ExpressionType ExpressionType
- {
- get { return Expressions.ExpressionType.BinaryExpression; }
- }
+ public override ExpressionType ExpressionType => ExpressionType.BinaryExpression;
public FdoExpression Left { get; }
@@ -127,7 +124,7 @@
this.Operator = BinaryOperator.Multiply;
break;
default:
- throw new FdoParseException("Unknown binary operator: " + opStr);
+ throw new FdoParseException($"Unknown binary operator: {opStr}"); //LOCALIZEME
}
this.Right = FdoExpression.ParseNode(node.ChildNodes[2]);
}
Modified: trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoExpression.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoExpression.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoExpression.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -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
{
@@ -45,6 +41,8 @@
public abstract class FdoExpression : FdoParseable
{
+ public override FdoParseableType ParseableType => FdoParseableType.Expression;
+
public abstract ExpressionType ExpressionType { get; }
public static FdoExpression Parse(string str)
Modified: trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoFilter.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoFilter.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoFilter.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -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
{
@@ -41,6 +37,8 @@
public abstract class FdoFilter : FdoParseable
{
+ public override FdoParseableType ParseableType => FdoParseableType.Filter;
+
public abstract FilterType FilterType { get; }
public static FdoFilter Parse(string str)
Modified: trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoParseable.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoParseable.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.FDO.Expressions/FdoParseable.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -27,7 +27,14 @@
namespace OSGeo.FDO.Expressions
{
+ public enum FdoParseableType
+ {
+ Expression,
+ Filter
+ }
+
public abstract class FdoParseable
{
+ public abstract FdoParseableType ParseableType { get; }
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Capability/ConnectionCapabilities.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Capability/ConnectionCapabilities.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Capability/ConnectionCapabilities.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -76,34 +76,34 @@
Version ver = new Version(1, 0, 0);
switch (resourceType)
{
- case "ApplicationDefinition":
+ case nameof(ResourceTypes.ApplicationDefinition):
if (!SupportsFusion())
- throw new UnsupportedResourceTypeException("ApplicationDefinition");
+ throw new UnsupportedResourceTypeException(nameof(ResourceTypes.ApplicationDefinition));
break;
- case "WatermarkDefinition":
+ case nameof(ResourceTypes.WatermarkDefinition):
ver = GetMaxWatermarkDefinitionVersion();
break;
- case "MapDefinition":
+ case nameof(ResourceTypes.MapDefinition):
ver = GetMaxMapDefinitionVersion();
break;
- case "LayerDefinition":
+ case nameof(ResourceTypes.LayerDefinition):
ver = GetMaxLayerDefinitionVersion();
break;
- case "LoadProcedure":
+ case nameof(ResourceTypes.LoadProcedure):
ver = GetMaxLoadProcedureVersion();
break;
- case "WebLayout":
+ case nameof(ResourceTypes.WebLayout):
ver = GetMaxWebLayoutVersion();
break;
- case "SymbolDefinition":
+ case nameof(ResourceTypes.SymbolDefinition):
if (!SupportsAdvancedSymbols())
- throw new UnsupportedResourceTypeException("SymbolDefinition");
+ throw new UnsupportedResourceTypeException(nameof(ResourceTypes.SymbolDefinition));
else
ver = GetMaxSymbolDefinitionVersion();
break;
@@ -115,19 +115,13 @@
/// Supportses the advanced symbols.
/// </summary>
/// <returns></returns>
- protected virtual bool SupportsAdvancedSymbols()
- {
- return (_parent.SiteVersion >= new Version(1, 2));
- }
+ protected virtual bool SupportsAdvancedSymbols() => (_parent.SiteVersion >= new Version(1, 2));
/// <summary>
/// Supportses the fusion.
/// </summary>
/// <returns></returns>
- protected virtual bool SupportsFusion()
- {
- return (_parent.SiteVersion >= new Version(2, 0));
- }
+ protected virtual bool SupportsFusion() => (_parent.SiteVersion >= new Version(2, 0));
/// <summary>
/// Gets the max watermark definition version
@@ -294,42 +288,27 @@
/// <summary>
/// Gets whether this connection supports publishing resources for WFS
/// </summary>
- public virtual bool SupportsWfsPublishing
- {
- get { return true; }
- }
+ public virtual bool SupportsWfsPublishing => true;
/// <summary>
/// Gets whether this connection supports publishing resources for WMS
/// </summary>
- public virtual bool SupportsWmsPublishing
- {
- get { return true; }
- }
+ public virtual bool SupportsWmsPublishing => true;
/// <summary>
/// Gets whether this connection supports resource reference tracking
/// </summary>
- public virtual bool SupportsResourceReferences
- {
- get { return true; }
- }
+ public virtual bool SupportsResourceReferences => true;
/// <summary>
/// Gets whether this connection supports resource security
/// </summary>
- public virtual bool SupportsResourceSecurity
- {
- get { return true; }
- }
+ public virtual bool SupportsResourceSecurity => true;
/// <summary>
/// Gets whether this connection supports the concept of resource headers
/// </summary>
- public virtual bool SupportsResourceHeaders
- {
- get { return true; }
- }
+ public virtual bool SupportsResourceHeaders => true;
/// <summary>
/// Gets the array of supported resource types
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Commands/FeatureManipulationCommandImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Commands/FeatureManipulationCommandImpl.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Commands/FeatureManipulationCommandImpl.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -34,7 +34,7 @@
/// <summary>
/// Gets the connection implementation.
/// </summary>
- public TConn ConnImpl { get { return (TConn)this.Parent; } }
+ public TConn ConnImpl => (TConn)this.Parent;
/// <summary>
/// Initializes a new instance of the <see cref="DefaultCommand<TConn>"/> class.
@@ -297,7 +297,7 @@
/// <value>
/// The schema.
/// </value>
- public OSGeo.MapGuide.MaestroAPI.Schema.FeatureSchema Schema
+ public Schema.FeatureSchema Schema
{
get;
set;
@@ -344,7 +344,7 @@
/// <value>
/// The schema.
/// </value>
- public OSGeo.MapGuide.MaestroAPI.Schema.FeatureSchema Schema
+ public Schema.FeatureSchema Schema
{
get;
set;
@@ -396,7 +396,7 @@
throw new InvalidOperationException(Strings.ErrorNoFeatureSourceIdSpecified);
if (string.IsNullOrEmpty(this.CoordinateSystemWkt))
throw new InvalidOperationException(Strings.ErrorNoCoordinateSystemWktSpecified);
- if (this.Extent == null && this.ExtentType != OSGeo.MapGuide.ObjectModels.Common.FdoSpatialContextListSpatialContextExtentType.Dynamic)
+ if (this.Extent == null && this.ExtentType != ObjectModels.Common.FdoSpatialContextListSpatialContextExtentType.Dynamic)
throw new InvalidOperationException(Strings.ErrorNoExtentSpecifiedForStaticType);
if (string.IsNullOrEmpty(this.FileName))
throw new InvalidOperationException(Strings.ErrorNoFileNameSpecified);
@@ -456,7 +456,7 @@
/// <value>
/// The extent.
/// </value>
- public OSGeo.MapGuide.ObjectModels.Common.IEnvelope Extent
+ public ObjectModels.Common.IEnvelope Extent
{
get;
set;
@@ -468,7 +468,7 @@
/// <value>
/// The type of the extent.
/// </value>
- public OSGeo.MapGuide.ObjectModels.Common.FdoSpatialContextListSpatialContextExtentType ExtentType
+ public ObjectModels.Common.FdoSpatialContextListSpatialContextExtentType ExtentType
{
get;
set;
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/ActualCoordinateSystem.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/ActualCoordinateSystem.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/ActualCoordinateSystem.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -67,7 +67,5 @@
double[] points = m_transform.MathTransform.Transform(new double[] { p1.X, p1.Y, p2.X, p2.Y });
return base.DistanceInMeters(new Point(points[0], points[1]), new Point(points[2], points[3]));
}
-
- //public override Topology.CoordinateSystems.ICoordinateSystem CoordinateSystem { get { return m_transform.SourceCS; } }
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/CoordinateSystem.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/CoordinateSystem.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/CoordinateSystem.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -131,37 +131,37 @@
/// Gets the projection.
/// </summary>
/// <value>The projection.</value>
- public string Projection { get { return m_projection; } }
+ public string Projection => m_projection;
/// <summary>
/// Gets the projection description.
/// </summary>
/// <value>The projection description.</value>
- public string ProjectionDescription { get { return m_projectionDescription; } }
+ public string ProjectionDescription => m_projectionDescription;
/// <summary>
/// Gets the datum.
/// </summary>
/// <value>The datum.</value>
- public string Datum { get { return m_datum; } }
+ public string Datum => m_datum;
/// <summary>
/// Gets the datum description.
/// </summary>
/// <value>The datum description.</value>
- public string DatumDescription { get { return m_datumDescription; } }
+ public string DatumDescription => m_datumDescription;
/// <summary>
/// Gets the ellipsoid.
/// </summary>
/// <value>The ellipsoid.</value>
- public string Ellipsoid { get { return m_ellipsoid; } }
+ public string Ellipsoid => m_ellipsoid;
/// <summary>
/// Gets the ellipsoid description.
/// </summary>
/// <value>The ellipsoid description.</value>
- public string EllipsoidDescription { get { return m_ellipsoidDescription; } }
+ public string EllipsoidDescription => m_ellipsoidDescription;
/// <summary>
/// Gets or sets the WKT.
@@ -214,7 +214,7 @@
else if (m_code == null)
return m_description;
else
- return m_description + " (" + m_code + ")"; //NOXLATE
+ return $"{m_description} ({m_code})"; //NOXLATE
}
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/CoordinateSystemBase.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/CoordinateSystemBase.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/CoordinateSystemBase.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -120,7 +120,7 @@
{
Check.ArgumentNotNull(bbox, nameof(bbox));
var env = AdjustBoundingBox(new Envelope(bbox.MinX, bbox.MaxX, bbox.MinY, bbox.MaxY), scale, size);
- return OSGeo.MapGuide.ObjectModels.ObjectFactory.CreateEnvelope(env.MinX, env.MinY, env.MaxX, env.MaxY);
+ return ObjectFactory.CreateEnvelope(env.MinX, env.MinY, env.MaxX, env.MaxY);
}
/// <summary>
@@ -140,12 +140,7 @@
/// <param name="x2"></param>
/// <param name="y2"></param>
/// <returns></returns>
- public double DistanceInMeters(double x1, double y1, double x2, double y2)
- {
- return DistanceInMeters(
- new Point(x1, y1),
- new Point(x2, y2));
- }
+ public double DistanceInMeters(double x1, double y1, double x2, double y2) => DistanceInMeters(new Point(x1, y1), new Point(x2, y2));
/// <summary>
/// Calculates the distance from one point to another, in meters
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/CoordinateSystemCategory.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/CoordinateSystemCategory.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/CoordinateSystemCategory.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -46,9 +46,9 @@
/// Gets the name.
/// </summary>
/// <value>The name.</value>
- public string Name { get { return m_name; } }
+ public string Name => m_name;
- internal ICoordinateSystemCatalog Parent { get { return _parent; } }
+ internal ICoordinateSystemCatalog Parent => _parent;
/// <summary>
/// Gets an array of all coordinate systems in this category
@@ -74,9 +74,6 @@
/// <returns>
/// A <see cref="System.String"/> that represents this instance.
/// </returns>
- public override string ToString()
- {
- return m_name;
- }
+ public override string ToString() => m_name;
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/MeterBasedCoordinateSystem.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/MeterBasedCoordinateSystem.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CoordinateSystem/MeterBasedCoordinateSystem.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -21,7 +21,6 @@
#endregion Disclaimer / License
using GeoAPI.Geometries;
-using NetTopologySuite.Geometries;
using System;
using System.Drawing;
@@ -51,9 +50,9 @@
UDM_Y = meters_pr_y_unit;
}
- public override double MetersPerUnitX { get { return UDM_X; } }
+ public override double MetersPerUnitX => UDM_X;
- public override double MetersPerUnitY { get { return UDM_Y; } }
+ public override double MetersPerUnitY => UDM_Y;
protected override double CalculateScale(IEnvelope bbox, Size size)
{
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CrossConnection/ResourceMigrator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CrossConnection/ResourceMigrator.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/CrossConnection/ResourceMigrator.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -531,17 +531,11 @@
/// <summary>
/// Gets the source connection
/// </summary>
- public IServerConnection Source
- {
- get { return _source; }
- }
+ public IServerConnection Source => _source;
/// <summary>
/// Gets the target connection
/// </summary>
- public IServerConnection Target
- {
- get { return _target; }
- }
+ public IServerConnection Target => _target;
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/FeatureReaderBase.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/FeatureReaderBase.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/FeatureReaderBase.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -62,10 +62,7 @@
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public IFeatureReader GetFeatureObject(string name)
- {
- return ((IFeature)this.Current).GetFeatureObject(name);
- }
+ public IFeatureReader GetFeatureObject(string name) => ((IFeature)this.Current).GetFeatureObject(name);
/// <summary>
/// Gets a <see cref="T:OSGeo.MapGuide.MaestroAPI.Feature.IFeatureReader"/> containing
@@ -73,30 +70,21 @@
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public IFeatureReader GetFeatureObject(int index)
- {
- return ((IFeature)this.Current).GetFeatureObject(index);
- }
+ public IFeatureReader GetFeatureObject(int index) => ((IFeature)this.Current).GetFeatureObject(index);
/// <summary>
/// Gets the name of the field at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public override string GetName(int index)
- {
- return this.ClassDefinition.Properties[index].Name;
- }
+ public override string GetName(int index) => this.ClassDefinition.Properties[index].Name;
/// <summary>
/// Gets the CLR type of the field at the specified index
/// </summary>
/// <param name="i"></param>
/// <returns></returns>
- public override Type GetFieldType(int i)
- {
- return ClrFdoTypeMap.GetClrType(this.ClassDefinition[i]);
- }
+ public override Type GetFieldType(int i) => ClrFdoTypeMap.GetClrType(this.ClassDefinition[i]);
/// <summary>
/// Gets the type of the reader.
@@ -104,19 +92,13 @@
/// <value>
/// The type of the reader.
/// </value>
- public override ReaderType ReaderType
- {
- get { return ReaderType.Feature; }
- }
+ public override ReaderType ReaderType => ReaderType.Feature;
/// <summary>
/// Reads the next record.
/// </summary>
/// <returns></returns>
- protected override IRecord ReadNextRecord()
- {
- return ReadNextFeature();
- }
+ protected override IRecord ReadNextRecord() => ReadNextFeature();
private class Enumerator : IEnumerator<IFeature>
{
@@ -127,24 +109,15 @@
_reader = reader;
}
- public IFeature Current
- {
- get { return (IFeature)_reader.Current; }
- }
+ public IFeature Current => (IFeature)_reader.Current;
public void Dispose()
{
}
- object IEnumerator.Current
- {
- get { return this.Current; }
- }
+ object IEnumerator.Current => this.Current;
- public bool MoveNext()
- {
- return _reader.ReadNext();
- }
+ public bool MoveNext() => _reader.ReadNext();
public void Reset()
{
@@ -158,10 +131,7 @@
/// <returns>
/// A <see cref="T:System.Collections.Generic.IEnumerator`1"/> that can be used to iterate through the collection.
/// </returns>
- public IEnumerator<IFeature> GetEnumerator()
- {
- return new Enumerator(this);
- }
+ public IEnumerator<IFeature> GetEnumerator() => new Enumerator(this);
/// <summary>
/// Returns an enumerator that iterates through a collection.
@@ -169,9 +139,6 @@
/// <returns>
/// An <see cref="T:System.Collections.IEnumerator"/> object that can be used to iterate through the collection.
/// </returns>
- IEnumerator IEnumerable.GetEnumerator()
- {
- return new Enumerator(this);
- }
+ IEnumerator IEnumerable.GetEnumerator() => new Enumerator(this);
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/LimitingFeatureReader.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/LimitingFeatureReader.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/LimitingFeatureReader.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -48,211 +48,57 @@
return bRet;
}
- public void Close()
- {
- if (_reader != null)
- {
- _reader.Close();
- }
- }
+ public void Close() => _reader?.Close();
public void Dispose()
{
- if (_reader != null)
- {
- _reader.Dispose();
- _reader = null;
- }
+ _reader?.Dispose();
+ _reader = null;
}
- public int FieldCount
- {
- get { return _reader.FieldCount; }
- }
+ public int FieldCount => _reader.FieldCount;
- public string GetName(int index)
- {
- return _reader.GetName(index);
- }
+ public string GetName(int index) => _reader.GetName(index);
+ public Type GetFieldType(int i) => _reader.GetFieldType(i);
+ public bool IsNull(string name) => _reader.IsNull(name);
+ public bool IsNull(int index) => _reader.IsNull(index);
+ public bool GetBoolean(string name) => _reader.GetBoolean(name);
+ public byte GetByte(string name) => _reader.GetByte(name);
+ public byte[] GetBlob(string name) => _reader.GetBlob(name);
+ public char[] GetClob(string name) => _reader.GetClob(name);
+ public double GetDouble(string name) => _reader.GetDouble(name);
+ public DateTime GetDateTime(string name) => _reader.GetDateTime(name);
+ public short GetInt16(string name) => _reader.GetInt16(name);
+ public int GetInt32(string name) => _reader.GetInt32(name);
+ public long GetInt64(string name) => _reader.GetInt64(name);
+ public float GetSingle(string name) => _reader.GetSingle(name);
+ public string GetString(string name) => _reader.GetString(name);
+ public GeoAPI.Geometries.IGeometry GetGeometry(string name) => _reader.GetGeometry(name);
+ public bool GetBoolean(int index) => _reader.GetBoolean(index);
+ public byte GetByte(int index) => _reader.GetByte(index);
+ public byte[] GetBlob(int index) => _reader.GetBlob(index);
+ public char[] GetClob(int index) => _reader.GetClob(index);
+ public double GetDouble(int index) => _reader.GetDouble(index);
+ public DateTime GetDateTime(int index) => _reader.GetDateTime(index);
+ public short GetInt16(int index) => _reader.GetInt16(index);
+ public int GetInt32(int index) => _reader.GetInt32(index);
+ public long GetInt64(int index) => _reader.GetInt64(index);
+ public float GetSingle(int index) => _reader.GetSingle(index);
+ public string GetString(int index) => _reader.GetString(index);
+ public GeoAPI.Geometries.IGeometry GetGeometry(int index) => _reader.GetGeometry(index);
- public Type GetFieldType(int i)
- {
- return _reader.GetFieldType(i);
- }
+ public object this[int index] => _reader[index];
- public bool IsNull(string name)
- {
- return _reader.IsNull(name);
- }
+ public object this[string name] => _reader[name];
- public bool IsNull(int index)
- {
- return _reader.IsNull(index);
- }
+ public Schema.PropertyValueType GetPropertyType(string name) => _reader.GetPropertyType(name);
+ public Schema.PropertyValueType GetPropertyType(int index) => _reader.GetPropertyType(index);
- public bool GetBoolean(string name)
- {
- return _reader.GetBoolean(name);
- }
+ public Schema.ClassDefinition ClassDefinition => _reader.ClassDefinition;
- public byte GetByte(string name)
- {
- return _reader.GetByte(name);
- }
-
- public byte[] GetBlob(string name)
- {
- return _reader.GetBlob(name);
- }
-
- public char[] GetClob(string name)
- {
- return _reader.GetClob(name);
- }
-
- public double GetDouble(string name)
- {
- return _reader.GetDouble(name);
- }
-
- public DateTime GetDateTime(string name)
- {
- return _reader.GetDateTime(name);
- }
-
- public short GetInt16(string name)
- {
- return _reader.GetInt16(name);
- }
-
- public int GetInt32(string name)
- {
- return _reader.GetInt32(name);
- }
-
- public long GetInt64(string name)
- {
- return _reader.GetInt64(name);
- }
-
- public float GetSingle(string name)
- {
- return _reader.GetSingle(name);
- }
-
- public string GetString(string name)
- {
- return _reader.GetString(name);
- }
-
- public GeoAPI.Geometries.IGeometry GetGeometry(string name)
- {
- return _reader.GetGeometry(name);
- }
-
- public bool GetBoolean(int index)
- {
- return _reader.GetBoolean(index);
- }
-
- public byte GetByte(int index)
- {
- return _reader.GetByte(index);
- }
-
- public byte[] GetBlob(int index)
- {
- return _reader.GetBlob(index);
- }
-
- public char[] GetClob(int index)
- {
- return _reader.GetClob(index);
- }
-
- public double GetDouble(int index)
- {
- return _reader.GetDouble(index);
- }
-
- public DateTime GetDateTime(int index)
- {
- return _reader.GetDateTime(index);
- }
-
- public short GetInt16(int index)
- {
- return _reader.GetInt16(index);
- }
-
- public int GetInt32(int index)
- {
- return _reader.GetInt32(index);
- }
-
- public long GetInt64(int index)
- {
- return _reader.GetInt64(index);
- }
-
- public float GetSingle(int index)
- {
- return _reader.GetSingle(index);
- }
-
- public string GetString(int index)
- {
- return _reader.GetString(index);
- }
-
- public GeoAPI.Geometries.IGeometry GetGeometry(int index)
- {
- return _reader.GetGeometry(index);
- }
-
- public object this[int index]
- {
- get { return _reader[index]; }
- }
-
- public object this[string name]
- {
- get { return _reader[name]; }
- }
-
- public Schema.PropertyValueType GetPropertyType(string name)
- {
- return _reader.GetPropertyType(name);
- }
-
- public Schema.PropertyValueType GetPropertyType(int index)
- {
- return _reader.GetPropertyType(index);
- }
-
- public Schema.ClassDefinition ClassDefinition
- {
- get { return _reader.ClassDefinition; }
- }
-
- public IFeatureReader GetFeatureObject(string name)
- {
- return _reader.GetFeatureObject(name);
- }
-
- public IFeatureReader GetFeatureObject(int index)
- {
- return _reader.GetFeatureObject(index);
- }
-
- public IEnumerator<IFeature> GetEnumerator()
- {
- return _reader.GetEnumerator();
- }
-
- System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
- {
- return _reader.GetEnumerator();
- }
+ public IFeatureReader GetFeatureObject(string name) => _reader.GetFeatureObject(name);
+ public IFeatureReader GetFeatureObject(int index) => _reader.GetFeatureObject(index);
+ public IEnumerator<IFeature> GetEnumerator() => _reader.GetEnumerator();
+ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() => _reader.GetEnumerator();
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/MutableFeatureBase.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/MutableFeatureBase.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/MutableFeatureBase.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -57,9 +57,6 @@
/// <summary>
/// Gets the associated class definition
/// </summary>
- public ClassDefinition ClassDefinition
- {
- get { return _clsDef; }
- }
+ public ClassDefinition ClassDefinition => _clsDef;
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/PropertyValue.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/PropertyValue.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/PropertyValue.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -52,10 +52,7 @@
/// <summary>
/// Sets the value to null.
/// </summary>
- public virtual void SetNull()
- {
- this.IsNull = true;
- }
+ public virtual void SetNull() => this.IsNull = true;
/// <summary>
/// Gets the type.
@@ -109,13 +106,7 @@
/// <value>
/// <c>true</c> if this instance is null; otherwise, <c>false</c>.
/// </value>
- public override bool IsNull
- {
- get
- {
- return !_value.HasValue;
- }
- }
+ public override bool IsNull => !_value.HasValue;
/// <summary>
/// Gets or sets the value.
@@ -141,10 +132,7 @@
/// <summary>
/// Sets the value to null.
/// </summary>
- public override void SetNull()
- {
- _value = null;
- }
+ public override void SetNull() => _value = null;
/// <summary>
/// Gets the suggsted property definition type for this value
@@ -152,10 +140,7 @@
/// <value>
/// The suggsted property definition type.
/// </value>
- public override PropertyDefinitionType PropertyDefType
- {
- get { return PropertyDefinitionType.Data; }
- }
+ public override PropertyDefinitionType PropertyDefType => PropertyDefinitionType.Data;
}
/// <summary>
@@ -231,10 +216,7 @@
/// <summary>
/// Gets the type.
/// </summary>
- public override PropertyValueType Type
- {
- get { return PropertyValueType.Byte; }
- }
+ public override PropertyValueType Type => PropertyValueType.Byte;
/// <summary>
/// Gets the value as a string
@@ -273,10 +255,7 @@
/// <summary>
/// Gets the type.
/// </summary>
- public override PropertyValueType Type
- {
- get { return PropertyValueType.Boolean; }
- }
+ public override PropertyValueType Type => PropertyValueType.Boolean;
/// <summary>
/// Gets the value as a string
@@ -315,10 +294,7 @@
/// <summary>
/// Gets the type.
/// </summary>
- public override PropertyValueType Type
- {
- get { return PropertyValueType.Blob; }
- }
+ public override PropertyValueType Type => PropertyValueType.Blob;
/// <summary>
/// Gets the suggsted property definition type for this value
@@ -326,10 +302,7 @@
/// <value>
/// The suggsted property definition type.
/// </value>
- public override PropertyDefinitionType PropertyDefType
- {
- get { return PropertyDefinitionType.Data; }
- }
+ public override PropertyDefinitionType PropertyDefType => PropertyDefinitionType.Data;
/// <summary>
/// Gets the value as a string
@@ -365,10 +338,7 @@
/// <summary>
/// Gets the type.
/// </summary>
- public override PropertyValueType Type
- {
- get { return PropertyValueType.Clob; }
- }
+ public override PropertyValueType Type => PropertyValueType.Clob;
/// <summary>
/// Gets the suggsted property definition type for this value
@@ -376,10 +346,7 @@
/// <value>
/// The suggsted property definition type.
/// </value>
- public override PropertyDefinitionType PropertyDefType
- {
- get { return PropertyDefinitionType.Data; }
- }
+ public override PropertyDefinitionType PropertyDefType => PropertyDefinitionType.Data;
/// <summary>
/// Gets the value as a string
@@ -415,10 +382,7 @@
/// <summary>
/// Gets the type.
/// </summary>
- public override PropertyValueType Type
- {
- get { return PropertyValueType.DateTime; }
- }
+ public override PropertyValueType Type => PropertyValueType.DateTime;
private static string PadLeft(string str, char ch, int totalChars)
{
@@ -472,10 +436,7 @@
/// <summary>
/// Gets the type.
/// </summary>
- public override PropertyValueType Type
- {
- get { return PropertyValueType.Double; }
- }
+ public override PropertyValueType Type => PropertyValueType.Double;
/// <summary>
/// Gets the value as a string
@@ -514,10 +475,7 @@
/// <summary>
/// Gets the type.
/// </summary>
- public override PropertyValueType Type
- {
- get { return PropertyValueType.Feature; }
- }
+ public override PropertyValueType Type => PropertyValueType.Feature;
/// <summary>
/// Gets the suggsted property definition type for this value
@@ -525,10 +483,7 @@
/// <value>
/// The suggsted property definition type.
/// </value>
- public override PropertyDefinitionType PropertyDefType
- {
- get { return PropertyDefinitionType.Object; }
- }
+ public override PropertyDefinitionType PropertyDefType => PropertyDefinitionType.Object;
/// <summary>
/// Gets the value as a string
@@ -567,10 +522,7 @@
/// <summary>
/// Gets the type.
/// </summary>
- public override PropertyValueType Type
- {
- get { return PropertyValueType.Geometry; }
- }
+ public override PropertyValueType Type => PropertyValueType.Geometry;
/// <summary>
/// Gets the suggsted property definition type for this value
@@ -578,10 +530,7 @@
/// <value>
/// The suggsted property definition type.
/// </value>
- public override PropertyDefinitionType PropertyDefType
- {
- get { return PropertyDefinitionType.Geometry; }
- }
+ public override PropertyDefinitionType PropertyDefType => PropertyDefinitionType.Geometry;
/// <summary>
/// Gets the value as a string
@@ -620,10 +569,7 @@
/// <summary>
/// Gets the type.
/// </summary>
- public override PropertyValueType Type
- {
- get { return PropertyValueType.Int16; }
- }
+ public override PropertyValueType Type => PropertyValueType.Int16;
/// <summary>
/// Gets the value as a string
@@ -662,10 +608,7 @@
/// <summary>
/// Gets the type.
/// </summary>
- public override PropertyValueType Type
- {
- get { return PropertyValueType.Int32; }
- }
+ public override PropertyValueType Type => PropertyValueType.Int32;
/// <summary>
/// Gets the value as a string
@@ -704,10 +647,7 @@
/// <summary>
/// Gets the type.
/// </summary>
- public override PropertyValueType Type
- {
- get { return PropertyValueType.Int64; }
- }
+ public override PropertyValueType Type => PropertyValueType.Int64;
/// <summary>
/// Gets the value as a string
@@ -746,10 +686,7 @@
/// <summary>
/// Gets the type.
/// </summary>
- public override PropertyValueType Type
- {
- get { return PropertyValueType.Raster; }
- }
+ public override PropertyValueType Type => PropertyValueType.Raster;
/// <summary>
/// Gets the suggsted property definition type for this value
@@ -757,10 +694,7 @@
/// <value>
/// The suggsted property definition type.
/// </value>
- public override PropertyDefinitionType PropertyDefType
- {
- get { return PropertyDefinitionType.Raster; }
- }
+ public override PropertyDefinitionType PropertyDefType => PropertyDefinitionType.Raster;
/// <summary>
/// Gets the value as a string
@@ -796,10 +730,7 @@
/// <summary>
/// Gets the type.
/// </summary>
- public override PropertyValueType Type
- {
- get { return PropertyValueType.Single; }
- }
+ public override PropertyValueType Type => PropertyValueType.Single;
/// <summary>
/// Gets the value as a string
@@ -838,10 +769,7 @@
/// <summary>
/// Gets the type.
/// </summary>
- public override PropertyValueType Type
- {
- get { return PropertyValueType.String; }
- }
+ public override PropertyValueType Type => PropertyValueType.String;
/// <summary>
/// Gets the suggsted property definition type for this value
@@ -849,10 +777,7 @@
/// <value>
/// The suggsted property definition type.
/// </value>
- public override PropertyDefinitionType PropertyDefType
- {
- get { return PropertyDefinitionType.Data; }
- }
+ public override PropertyDefinitionType PropertyDefType => PropertyDefinitionType.Data;
/// <summary>
/// Gets the value as a string
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/ReaderBase.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/ReaderBase.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/ReaderBase.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -102,10 +102,7 @@
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public bool IsNull(string name)
- {
- return this.Current.IsNull(name);
- }
+ public bool IsNull(string name) => this.Current.IsNull(name);
/// <summary>
/// Gets whether the property value at the specified index has a null property value. You must
@@ -113,279 +110,198 @@
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public bool IsNull(int index)
- {
- return this.Current.IsNull(index);
- }
+ public bool IsNull(int index) => this.Current.IsNull(index);
/// <summary>
/// Gets the boolean value of the specified property
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public bool GetBoolean(string name)
- {
- return this.Current.GetBoolean(name);
- }
+ public bool GetBoolean(string name) => this.Current.GetBoolean(name);
/// <summary>
/// Gets the byte value of the specified property
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public byte GetByte(string name)
- {
- return this.Current.GetByte(name);
- }
+ public byte GetByte(string name) => this.Current.GetByte(name);
/// <summary>
/// Gets the blob value of the specified property
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public byte[] GetBlob(string name)
- {
- return this.Current.GetBlob(name);
- }
+ public byte[] GetBlob(string name) => this.Current.GetBlob(name);
/// <summary>
/// Gets the clob value of the specified property
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public char[] GetClob(string name)
- {
- return this.Current.GetClob(name);
- }
+ public char[] GetClob(string name) => this.Current.GetClob(name);
/// <summary>
/// Gets the double value of the specified property
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public double GetDouble(string name)
- {
- return this.Current.GetDouble(name);
- }
+ public double GetDouble(string name) => this.Current.GetDouble(name);
/// <summary>
/// Gets the datetime value of the specified property
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public DateTime GetDateTime(string name)
- {
- return this.Current.GetDateTime(name);
- }
+ public DateTime GetDateTime(string name) => this.Current.GetDateTime(name);
/// <summary>
/// Gets the int16 value of the specified property
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public short GetInt16(string name)
- {
- return this.Current.GetInt16(name);
- }
+ public short GetInt16(string name) => this.Current.GetInt16(name);
/// <summary>
/// Gets the int32 value of the specified property
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public int GetInt32(string name)
- {
- return this.Current.GetInt32(name);
- }
+ public int GetInt32(string name) => this.Current.GetInt32(name);
/// <summary>
/// Gets the int64 value of the specified property
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public long GetInt64(string name)
- {
- return this.Current.GetInt64(name);
- }
+ public long GetInt64(string name) => this.Current.GetInt64(name);
/// <summary>
/// Gets the single value of the specified property
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public float GetSingle(string name)
- {
- return this.Current.GetSingle(name);
- }
+ public float GetSingle(string name) => this.Current.GetSingle(name);
/// <summary>
/// Gets the string value of the specified property
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public string GetString(string name)
- {
- return this.Current.GetString(name);
- }
+ public string GetString(string name) => this.Current.GetString(name);
/// <summary>
/// Gets the geometry value of the specified property
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public IGeometry GetGeometry(string name)
- {
- return this.Current.GetGeometry(name);
- }
+ public IGeometry GetGeometry(string name) => this.Current.GetGeometry(name);
/// <summary>
/// Gets the boolean value at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public bool GetBoolean(int index)
- {
- return this.Current.GetBoolean(index);
- }
+ public bool GetBoolean(int index) => this.Current.GetBoolean(index);
/// <summary>
/// Gets the byte value at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public byte GetByte(int index)
- {
- return this.Current.GetByte(index);
- }
+ public byte GetByte(int index) => this.Current.GetByte(index);
/// <summary>
/// Gets the blob value at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public byte[] GetBlob(int index)
- {
- return this.Current.GetBlob(index);
- }
+ public byte[] GetBlob(int index) => this.Current.GetBlob(index);
/// <summary>
/// Gets the clob value at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public char[] GetClob(int index)
- {
- return this.Current.GetClob(index);
- }
+ public char[] GetClob(int index) => this.Current.GetClob(index);
/// <summary>
/// Gets the double value at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public double GetDouble(int index)
- {
- return this.Current.GetDouble(index);
- }
+ public double GetDouble(int index) => this.Current.GetDouble(index);
/// <summary>
/// Gets the datetime value at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public DateTime GetDateTime(int index)
- {
- return this.Current.GetDateTime(index);
- }
+ public DateTime GetDateTime(int index) => this.Current.GetDateTime(index);
/// <summary>
/// Gets the int16 value at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public short GetInt16(int index)
- {
- return this.Current.GetInt16(index);
- }
+ public short GetInt16(int index) => this.Current.GetInt16(index);
/// <summary>
/// Gets the int32 value at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public int GetInt32(int index)
- {
- return this.Current.GetInt32(index);
- }
+ public int GetInt32(int index) => this.Current.GetInt32(index);
/// <summary>
/// Gets the int64 value at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public long GetInt64(int index)
- {
- return this.Current.GetInt64(index);
- }
+ public long GetInt64(int index) => this.Current.GetInt64(index);
/// <summary>
/// Gets the single value at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public float GetSingle(int index)
- {
- return this.Current.GetSingle(index);
- }
+ public float GetSingle(int index) => this.Current.GetSingle(index);
/// <summary>
/// Gets the string value at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public string GetString(int index)
- {
- return this.Current.GetString(index);
- }
+ public string GetString(int index) => this.Current.GetString(index);
/// <summary>
/// Gets the geometry value at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public IGeometry GetGeometry(int index)
- {
- return this.Current.GetGeometry(index);
- }
+ public IGeometry GetGeometry(int index) => this.Current.GetGeometry(index);
/// <summary>
/// Gets the <see cref="System.Object"/> at the specified index.
/// </summary>
- public object this[int index]
- {
- get { return this.Current[index]; }
- }
+ public object this[int index] => this.Current[index];
/// <summary>
/// Gets the <see cref="System.Object"/> with the specified name.
/// </summary>
- public object this[string name]
- {
- get { return this.Current[name]; }
- }
+ public object this[string name] => this.Current[name];
/// <summary>
/// Gets the type of the property.
/// </summary>
/// <param name="name">The name.</param>
/// <returns></returns>
- public abstract OSGeo.MapGuide.MaestroAPI.Schema.PropertyValueType GetPropertyType(string name);
+ public abstract Schema.PropertyValueType GetPropertyType(string name);
/// <summary>
/// Gets the type of the property at the specified index.
/// </summary>
/// <param name="index">The index.</param>
/// <returns></returns>
- public abstract OSGeo.MapGuide.MaestroAPI.Schema.PropertyValueType GetPropertyType(int index);
+ public abstract Schema.PropertyValueType GetPropertyType(int index);
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/RecordBase.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/RecordBase.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/RecordBase.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -57,20 +57,14 @@
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public PropertyValue GetValue(string name)
- {
- return _values[name];
- }
+ public PropertyValue GetValue(string name) => _values[name];
/// <summary>
/// Gets whether the specified named property exists
/// </summary>
/// <param name="name">The property name.</param>
/// <returns></returns>
- public bool PropertyExists(string name)
- {
- return _values.ContainsKey(name);
- }
+ public bool PropertyExists(string name) => _values.ContainsKey(name);
/// <summary>
/// Adds the specified property value
@@ -91,10 +85,7 @@
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public bool IsNull(string name)
- {
- return _values[name].IsNull;
- }
+ public bool IsNull(string name) => _values[name].IsNull;
/// <summary>
/// Gets whether the property value at the specified index has a null property value. You must
@@ -102,278 +93,194 @@
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public bool IsNull(int index)
- {
- return IsNull(_ordinalMap[index]);
- }
+ public bool IsNull(int index) => IsNull(_ordinalMap[index]);
/// <summary>
/// Gets the boolean value of the specified property
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public bool GetBoolean(string name)
- {
- return ((BooleanValue)_values[name]).Value;
- }
+ public bool GetBoolean(string name) => ((BooleanValue)_values[name]).Value;
/// <summary>
/// Gets the byte value of the specified property
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public byte GetByte(string name)
- {
- return ((ByteValue)_values[name]).Value;
- }
+ public byte GetByte(string name) => ((ByteValue)_values[name]).Value;
/// <summary>
/// Gets the blob value of the specified property
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public byte[] GetBlob(string name)
- {
- return ((BlobValue)_values[name]).Value;
- }
+ public byte[] GetBlob(string name) => ((BlobValue)_values[name]).Value;
/// <summary>
/// Gets the clob value of the specified property
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public char[] GetClob(string name)
- {
- return ((ClobValue)_values[name]).Value;
- }
+ public char[] GetClob(string name) => ((ClobValue)_values[name]).Value;
/// <summary>
/// Gets the double value of the specified property
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public double GetDouble(string name)
- {
- return ((DoubleValue)_values[name]).Value;
- }
+ public double GetDouble(string name) => ((DoubleValue)_values[name]).Value;
/// <summary>
/// Gets the datetime value of the specified property
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public DateTime GetDateTime(string name)
- {
- return ((DateTimeValue)_values[name]).Value;
- }
+ public DateTime GetDateTime(string name) => ((DateTimeValue)_values[name]).Value;
/// <summary>
/// Gets the feature object.
/// </summary>
/// <param name="name">The name.</param>
/// <returns></returns>
- public IFeatureReader GetFeatureObject(string name)
- {
- return new FeatureArrayReader(((FeatureValue)_values[name]).Value);
- }
+ public IFeatureReader GetFeatureObject(string name) => new FeatureArrayReader(((FeatureValue)_values[name]).Value);
/// <summary>
/// Gets the int16 value of the specified property
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public short GetInt16(string name)
- {
- return ((Int16Value)_values[name]).Value;
- }
+ public short GetInt16(string name) => ((Int16Value)_values[name]).Value;
/// <summary>
/// Gets the int32 value of the specified property
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public int GetInt32(string name)
- {
- return ((Int32Value)_values[name]).Value;
- }
+ public int GetInt32(string name) => ((Int32Value)_values[name]).Value;
/// <summary>
/// Gets the int64 value of the specified property
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public long GetInt64(string name)
- {
- return ((Int64Value)_values[name]).Value;
- }
+ public long GetInt64(string name) => ((Int64Value)_values[name]).Value;
/// <summary>
/// Gets the single value of the specified property
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public float GetSingle(string name)
- {
- return ((SingleValue)_values[name]).Value;
- }
+ public float GetSingle(string name) => ((SingleValue)_values[name]).Value;
/// <summary>
/// Gets the string value of the specified property
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public string GetString(string name)
- {
- return ((StringValue)_values[name]).Value;
- }
+ public string GetString(string name) => ((StringValue)_values[name]).Value;
/// <summary>
/// Gets the geometry value of the specified property
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
- public IGeometry GetGeometry(string name)
- {
- return ((GeometryValue)_values[name]).Value;
- }
+ public IGeometry GetGeometry(string name) => ((GeometryValue)_values[name]).Value;
/// <summary>
/// Gets the boolean value at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public bool GetBoolean(int index)
- {
- return GetBoolean(_ordinalMap[index]);
- }
+ public bool GetBoolean(int index) => GetBoolean(_ordinalMap[index]);
/// <summary>
/// Gets the byte value at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public byte GetByte(int index)
- {
- return GetByte(_ordinalMap[index]);
- }
+ public byte GetByte(int index) => GetByte(_ordinalMap[index]);
/// <summary>
/// Gets the blob value at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public byte[] GetBlob(int index)
- {
- return GetBlob(_ordinalMap[index]);
- }
+ public byte[] GetBlob(int index) => GetBlob(_ordinalMap[index]);
/// <summary>
/// Gets the clob value at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public char[] GetClob(int index)
- {
- return GetClob(_ordinalMap[index]);
- }
+ public char[] GetClob(int index) => GetClob(_ordinalMap[index]);
/// <summary>
/// Gets the double value at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public double GetDouble(int index)
- {
- return GetDouble(_ordinalMap[index]);
- }
+ public double GetDouble(int index) => GetDouble(_ordinalMap[index]);
/// <summary>
/// Gets the datetime value at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public DateTime GetDateTime(int index)
- {
- return GetDateTime(_ordinalMap[index]);
- }
+ DateTime IRecord.GetDateTime(int index) => GetDateTime(_ordinalMap[index]);
/// <summary>
/// Gets the feature object.
/// </summary>
/// <param name="index">The index.</param>
/// <returns></returns>
- public IFeatureReader GetFeatureObject(int index)
- {
- return GetFeatureObject(_ordinalMap[index]);
- }
+ public IFeatureReader GetFeatureObject(int index) => GetFeatureObject(_ordinalMap[index]);
/// <summary>
/// Gets the int16 value at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public short GetInt16(int index)
- {
- return GetInt16(_ordinalMap[index]);
- }
+ public short GetInt16(int index) => GetInt16(_ordinalMap[index]);
/// <summary>
/// Gets the int32 value at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public int GetInt32(int index)
- {
- return GetInt32(_ordinalMap[index]);
- }
+ public int GetInt32(int index) => GetInt32(_ordinalMap[index]);
/// <summary>
/// Gets the int64 value at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public long GetInt64(int index)
- {
- return GetInt64(_ordinalMap[index]);
- }
+ public long GetInt64(int index) => GetInt64(_ordinalMap[index]);
/// <summary>
/// Gets the single value at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public float GetSingle(int index)
- {
- return GetSingle(_ordinalMap[index]);
- }
+ public float GetSingle(int index) => GetSingle(_ordinalMap[index]);
/// <summary>
/// Gets the string value at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public string GetString(int index)
- {
- return GetString(_ordinalMap[index]);
- }
+ public string GetString(int index) => GetString(_ordinalMap[index]);
/// <summary>
/// Gets the geometry value at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public IGeometry GetGeometry(int index)
- {
- return GetGeometry(_ordinalMap[index]);
- }
+ public IGeometry GetGeometry(int index) => GetGeometry(_ordinalMap[index]);
/// <summary>
/// Gets the <see cref="System.Object"/> at the specified index.
/// </summary>
- public object this[int index]
- {
- get { return this[_ordinalMap[index]]; }
- }
+ public object this[int index] => this[_ordinalMap[index]];
/// <summary>
/// Gets the <see cref="System.Object"/> with the specified name.
@@ -431,30 +338,21 @@
/// <summary>
/// Gets the number of fields in this record
/// </summary>
- public int FieldCount
- {
- get { return _values.Count; }
- }
+ public int FieldCount => _values.Count;
/// <summary>
/// Gets the name of the field at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public string GetName(int index)
- {
- return _ordinalMap[index];
- }
+ public string GetName(int index) => _ordinalMap[index];
/// <summary>
/// Gets the CLR type of the field at the specified index
/// </summary>
/// <param name="i"></param>
/// <returns></returns>
- public Type GetFieldType(int i)
- {
- return ClrFdoTypeMap.GetClrType(_values[GetName(i)].Type);
- }
+ public Type GetFieldType(int i) => ClrFdoTypeMap.GetClrType(_values[GetName(i)].Type);
/// <summary>
/// Updates the specified record.
@@ -544,29 +442,20 @@
/// <summary>
/// Gets the property names.
/// </summary>
- public IEnumerable<string> PropertyNames
- {
- get { return _ordinalMap.Values; }
- }
+ public IEnumerable<string> PropertyNames => _ordinalMap.Values;
/// <summary>
/// Gets the type of the property.
/// </summary>
/// <param name="name">The name.</param>
/// <returns></returns>
- public PropertyValueType GetPropertyType(string name)
- {
- return _values[name].Type;
- }
+ public PropertyValueType GetPropertyType(string name) => _values[name].Type;
/// <summary>
/// Gets the type of the property at the specified index.
/// </summary>
/// <param name="index">The index.</param>
/// <returns></returns>
- public PropertyValueType GetPropertyType(int index)
- {
- return GetPropertyType(_ordinalMap[index]);
- }
+ public PropertyValueType GetPropertyType(int index) => GetPropertyType(_ordinalMap[index]);
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/LengthyOperationCallbackArgs.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/LengthyOperationCallbackArgs.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/LengthyOperationCallbackArgs.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -110,10 +110,7 @@
/// <summary>
/// Gets the operation items
/// </summary>
- public LengthyOperationItem[] Items
- {
- get { return m_items; }
- }
+ public LengthyOperationItem[] Items => m_items;
/// <summary>
///
@@ -152,7 +149,7 @@
/// <summary>
/// Gets the item path
/// </summary>
- public string Itempath { get { return m_itempath; } }
+ public string Itempath => m_itempath;
/// <summary>
/// Gets or sets the operation status
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/Collections.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/Collections.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/Collections.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -60,10 +60,7 @@
/// <returns>
/// The index of <paramref name="item"/> if found in the list; otherwise, -1.
/// </returns>
- public int IndexOf(TVal item)
- {
- return _values.IndexOf(item);
- }
+ public int IndexOf(TVal item) => _values.IndexOf(item);
/// <summary>
/// Determines the index of a specific key in the collection
@@ -257,10 +254,7 @@
/// <returns>
/// true if <paramref name="item"/> is found in the <see cref="T:System.Collections.Generic.ICollection`1"/>; otherwise, false.
/// </returns>
- public bool Contains(TVal item)
- {
- return _values.Contains(item);
- }
+ public bool Contains(TVal item) => _values.Contains(item);
/// <summary>
/// Copies the elements of the <see cref="T:System.Collections.Generic.ICollection`1"/> to an <see cref="T:System.Array"/>, starting at a particular <see cref="T:System.Array"/> index.
@@ -284,10 +278,7 @@
/// -or-
/// Type <typeparamref name="TVal"/> cannot be cast automatically to the type of the destination <paramref name="array"/>.
/// </exception>
- public void CopyTo(TVal[] array, int arrayIndex)
- {
- _values.CopyTo(array, arrayIndex);
- }
+ public void CopyTo(TVal[] array, int arrayIndex) => _values.CopyTo(array, arrayIndex);
/// <summary>
/// Gets the number of elements contained in the <see cref="T:System.Collections.Generic.ICollection`1"/>.
@@ -295,20 +286,14 @@
/// <returns>
/// The number of elements contained in the <see cref="T:System.Collections.Generic.ICollection`1"/>.
/// </returns>
- public int Count
- {
- get { return _values.Count; }
- }
+ public int Count => _values.Count;
/// <summary>
/// Gets a value indicating whether the <see cref="T:System.Collections.Generic.ICollection`1"/> is read-only.
/// </summary>
/// <returns>true if the <see cref="T:System.Collections.Generic.ICollection`1"/> is read-only; otherwise, false.
/// </returns>
- public bool IsReadOnly
- {
- get { return false; }
- }
+ public bool IsReadOnly => false;
/// <summary>
/// Removes the first occurrence of a specific object from the <see cref="T:System.Collections.Generic.ICollection`1"/>.
@@ -342,10 +327,7 @@
/// <returns>
/// A <see cref="T:System.Collections.Generic.IEnumerator`1"/> that can be used to iterate through the collection.
/// </returns>
- public IEnumerator<TVal> GetEnumerator()
- {
- return _values.GetEnumerator();
- }
+ public IEnumerator<TVal> GetEnumerator() => _values.GetEnumerator();
/// <summary>
/// Returns an enumerator that iterates through a collection.
@@ -353,10 +335,7 @@
/// <returns>
/// An <see cref="T:System.Collections.IEnumerator"/> object that can be used to iterate through the collection.
/// </returns>
- System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
- {
- return _values.GetEnumerator();
- }
+ IEnumerator IEnumerable.GetEnumerator() => _values.GetEnumerator();
/// <summary>
/// Gets or sets the element at the specified index.
@@ -397,9 +376,7 @@
if (bSuppressCollectionChanged)
return;
- var h = this.CollectionChanged;
- if (h != null)
- h(this, EventArgs.Empty);
+ this.CollectionChanged?.Invoke(this, EventArgs.Empty);
}
/// <summary>
@@ -444,45 +421,21 @@
return this.Count - 1;
}
- void IList.Clear()
- {
- this.Clear();
- }
+ void IList.Clear() => this.Clear();
- bool IList.Contains(object value)
- {
- return this.Contains((TVal)value);
- }
+ bool IList.Contains(object value) => this.Contains((TVal)value);
- int IList.IndexOf(object value)
- {
- return this.IndexOf((TVal)value);
- }
+ int IList.IndexOf(object value) => this.IndexOf((TVal)value);
- void IList.Insert(int index, object value)
- {
- this.Insert(index, (TVal)value);
- }
+ void IList.Insert(int index, object value) => this.Insert(index, (TVal)value);
- bool IList.IsFixedSize
- {
- get { return false; }
- }
+ bool IList.IsFixedSize => false;
- bool IList.IsReadOnly
- {
- get { return false; }
- }
+ bool IList.IsReadOnly => false;
- void IList.Remove(object value)
- {
- this.Remove((TVal)value);
- }
+ void IList.Remove(object value) => this.Remove((TVal)value);
- void IList.RemoveAt(int index)
- {
- this.RemoveAt(index);
- }
+ void IList.RemoveAt(int index) => this.RemoveAt(index);
object IList.this[int index]
{
@@ -496,27 +449,15 @@
}
}
- void ICollection.CopyTo(Array array, int index)
- {
- this.CopyTo((TVal[])array, index);
- }
+ void ICollection.CopyTo(Array array, int index) => this.CopyTo((TVal[])array, index);
- int ICollection.Count
- {
- get { return this.Count; }
- }
+ int ICollection.Count => this.Count;
- bool ICollection.IsSynchronized
- {
- get { return false; }
- }
+ bool ICollection.IsSynchronized => false;
private readonly object _syncRoot = new object();
- object ICollection.SyncRoot
- {
- get { return _syncRoot; }
- }
+ object ICollection.SyncRoot => _syncRoot;
}
/// <summary>
@@ -602,20 +543,14 @@
/// </summary>
/// <param name="value">The value.</param>
/// <returns></returns>
- protected override string SelectKey(RuntimeMapLayer value)
- {
- return value.Name;
- }
+ protected override string SelectKey(RuntimeMapLayer value) => value.Name;
/// <summary>
/// Gets a runtime map layer by its object id.
/// </summary>
/// <param name="id">The object id.</param>
/// <returns></returns>
- public RuntimeMapLayer GetByObjectId(string id)
- {
- return _layerIdMap.ContainsKey(id) ? _layerIdMap[id] : null;
- }
+ public RuntimeMapLayer GetByObjectId(string id) => _layerIdMap.ContainsKey(id) ? _layerIdMap[id] : null;
/// <summary>
/// Gets or sets the element at the specified index.
@@ -696,30 +631,21 @@
/// Called after an item has been added
/// </summary>
/// <param name="item">The item.</param>
- protected override void OnItemAdded(RuntimeMapGroup item)
- {
- _parent.OnGroupAdded(item);
- }
+ protected override void OnItemAdded(RuntimeMapGroup item) => _parent.OnGroupAdded(item);
/// <summary>
/// Called after an item has been removed. Note this is only called if the remove
/// operation removed the item in question
/// </summary>
/// <param name="value">The value.</param>
- protected override void OnItemRemoved(RuntimeMapGroup value)
- {
- _parent.OnGroupRemoved(value);
- }
+ protected override void OnItemRemoved(RuntimeMapGroup value) => _parent.OnGroupRemoved(value);
/// <summary>
/// Selects the key given the value.
/// </summary>
/// <param name="value">The value.</param>
/// <returns></returns>
- protected override string SelectKey(RuntimeMapGroup value)
- {
- return value.Name;
- }
+ protected override string SelectKey(RuntimeMapGroup value) => value.Name;
/// <summary>
/// Removes the specified group by its name.
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/MapSelection.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/MapSelection.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/MapSelection.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -105,16 +105,16 @@
{
_layers.Clear();
- System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
+ XmlDocument doc = new XmlDocument();
if (!string.IsNullOrEmpty(xml))
doc.LoadXml(xml);
//There are two variations
- System.Xml.XmlNodeList lst = doc.SelectNodes("FeatureSet/Layer"); //NOXLATE
+ XmlNodeList lst = doc.SelectNodes("FeatureSet/Layer"); //NOXLATE
if (lst.Count == 0)
lst = doc.SelectNodes("FeatureInformation/FeatureSet/Layer"); //NOXLATE
- foreach (System.Xml.XmlNode n in lst)
+ foreach (XmlNode n in lst)
{
if (n.Attributes["id"] != null) //NOXLATE
{
@@ -122,7 +122,7 @@
var l = _map.Layers.GetByObjectId(guid);
if (l != null)
{
- foreach (System.Xml.XmlNode c in n.SelectNodes("Class")) //NOXLATE
+ foreach (XmlNode c in n.SelectNodes("Class")) //NOXLATE
{
if (c.Attributes["id"] != null) //NOXLATE
if (c.Attributes["id"].Value == l.QualifiedClassName) //NOXLATE
@@ -139,15 +139,15 @@
/// <returns>An xml document that represents the current map selection</returns>
public string ToXml()
{
- System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
- System.Xml.XmlNode root = doc.AppendChild(doc.CreateElement("FeatureSet")); //NOXLATE
+ XmlDocument doc = new XmlDocument();
+ XmlNode root = doc.AppendChild(doc.CreateElement("FeatureSet")); //NOXLATE
foreach (LayerSelection layer in _layers)
{
- System.Xml.XmlNode ln = root.AppendChild(doc.CreateElement("Layer")); //NOXLATE
+ XmlNode ln = root.AppendChild(doc.CreateElement("Layer")); //NOXLATE
ln.Attributes.Append(doc.CreateAttribute("id")).Value = layer.Layer.ObjectId; //NOXLATE
- System.Xml.XmlNode cn = ln.AppendChild(doc.CreateElement("Class")); //NOXLATE
+ XmlNode cn = ln.AppendChild(doc.CreateElement("Class")); //NOXLATE
cn.Attributes.Append(doc.CreateAttribute("id")).Value = layer.Layer.QualifiedClassName; //NOXLATE
for (int i = 0; i < layer.Count; i++)
@@ -168,17 +168,17 @@
/// <summary>
/// Gets the layer that contains the selected objects
/// </summary>
- public RuntimeMapLayer Layer { get { return m_layer; } }
+ public RuntimeMapLayer Layer => m_layer;
/// <summary>
/// Internal helper to construct a LayerSelection
/// </summary>
/// <param name="layer">The layer that the selection belongs to</param>
/// <param name="ids">A list of xml <ID> nodes</param>
- internal LayerSelection(RuntimeMapLayer layer, System.Xml.XmlNodeList ids)
+ internal LayerSelection(RuntimeMapLayer layer, XmlNodeList ids)
: this(layer)
{
- foreach (System.Xml.XmlNode n in ids)
+ foreach (XmlNode n in ids)
Add(ParseIDString(n.InnerXml));
}
@@ -282,10 +282,7 @@
/// </summary>
/// <param name="id">The base64 encoded ID string</param>
/// <returns>The composite value key</returns>
- public object[] ParseIDString(string id)
- {
- return m_layer.ParseSelectionValues(id);
- }
+ public object[] ParseIDString(string id) => m_layer.ParseSelectionValues(id);
/// <summary>
/// Constructs a new LayerSelection with a number of selected featured
@@ -416,10 +413,7 @@
/// Removes the element at the specified location
/// </summary>
/// <param name="index">The index of the item to remove</param>
- public void RemoveAt(int index)
- {
- m_list.RemoveAt(index);
- }
+ public void RemoveAt(int index) => m_list.RemoveAt(index);
/// <summary>
/// Gets or sets the composite key for the specified index
@@ -447,20 +441,14 @@
/// <summary>
/// Removes all composite keys from the collection
/// </summary>
- public void Clear()
- {
- m_list.Clear();
- }
+ public void Clear() => m_list.Clear();
/// <summary>
/// Returns a value indicating if the composite key is contained in the collection
/// </summary>
/// <param name="item">The composite key to look for</param>
/// <returns>True if the collection contains the composite key, false otherwise</returns>
- public bool Contains(object[] item)
- {
- return IndexOf(item) >= 0;
- }
+ public bool Contains(object[] item) => IndexOf(item) >= 0;
/// <summary>
/// Not implemented
@@ -475,18 +463,12 @@
/// <summary>
/// Returns the number of composite keys (and thus selected objects)
/// </summary>
- public int Count
- {
- get { return m_list.Count; }
- }
+ public int Count => m_list.Count;
/// <summary>
/// Gets a value indicating if the collection is read-only
/// </summary>
- public bool IsReadOnly
- {
- get { return false; }
- }
+ public bool IsReadOnly => false;
/// <summary>
/// Removes the given composite key from the collection
@@ -511,10 +493,7 @@
/// Returns an enumerator for the collection
/// </summary>
/// <returns>An enumerator for the collection</returns>
- public IEnumerator<object[]> GetEnumerator()
- {
- return m_list.GetEnumerator();
- }
+ public IEnumerator<object[]> GetEnumerator() => m_list.GetEnumerator();
#endregion IEnumerable<object[]> Members
@@ -524,10 +503,7 @@
/// Returns an enumerator for the collection
/// </summary>
/// <returns>An enumerator for the collection</returns>
- System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
- {
- return ((System.Collections.IEnumerable)m_list).GetEnumerator();
- }
+ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() => ((System.Collections.IEnumerable)m_list).GetEnumerator();
#endregion IEnumerable Members
}
@@ -604,10 +580,7 @@
/// </summary>
/// <param name="item">The layer to look for</param>
/// <returns>The index of the layer, or -1 if the layer is not in the collection</returns>
- public int IndexOf(MapSelection.LayerSelection item)
- {
- return IndexOf(item.Layer);
- }
+ public int IndexOf(LayerSelection item) => IndexOf(item.Layer);
/// <summary>
/// Returns the index of the given layer
@@ -630,36 +603,27 @@
/// </summary>
/// <param name="index">The index to place the item at</param>
/// <param name="item">The item to insert</param>
- public void Insert(int index, MapSelection.LayerSelection item)
- {
- _layers.Insert(index, item);
- }
+ public void Insert(int index, LayerSelection item) => _layers.Insert(index, item);
/// <summary>
/// Inserts a selection layer into the collection
/// </summary>
/// <param name="index">The index to place the item at</param>
/// <param name="layer">The layer.</param>
- public void Insert(int index, RuntimeMapLayer layer)
- {
- _layers.Insert(index, new LayerSelection(layer));
- }
+ public void Insert(int index, RuntimeMapLayer layer) => _layers.Insert(index, new LayerSelection(layer));
/// <summary>
/// Removes the item at the given index
/// </summary>
/// <param name="index">The index to remove the item at</param>
- public void RemoveAt(int index)
- {
- _layers.RemoveAt(index);
- }
+ public void RemoveAt(int index) => _layers.RemoveAt(index);
/// <summary>
/// Gets or sets the selection layer at a given index
/// </summary>
/// <param name="index">The index to get or set the item for</param>
/// <returns>The item at the given index</returns>
- public MapSelection.LayerSelection this[int index]
+ public LayerSelection this[int index]
{
get
{
@@ -678,13 +642,7 @@
/// </summary>
/// <param name="index">The index to get or set the item for</param>
/// <returns>The item at the given index</returns>
- public MapSelection.LayerSelection this[RuntimeMapLayer index]
- {
- get
- {
- return _layers[IndexOf(index)];
- }
- }
+ public LayerSelection this[RuntimeMapLayer index] => _layers[IndexOf(index)];
#endregion IList<MapSelection.LayerSelection> Members
@@ -718,30 +676,21 @@
/// <summary>
/// Clears this selction
/// </summary>
- public void Clear()
- {
- _layers.Clear();
- }
+ public void Clear() => _layers.Clear();
/// <summary>
/// Gets whether this selection contains the specified layer
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
- public bool Contains(RuntimeMapLayer item)
- {
- return IndexOf(item) >= 0;
- }
+ public bool Contains(RuntimeMapLayer item) => IndexOf(item) >= 0;
/// <summary>
/// Gets whether this selection contains the specified layer selection
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
- public bool Contains(MapSelection.LayerSelection item)
- {
- return IndexOf(item) >= 0;
- }
+ public bool Contains(LayerSelection item) => IndexOf(item) >= 0;
/// <summary>
/// Copies the elements of the <see cref="T:System.Collections.Generic.ICollection`1"/> to an <see cref="T:System.Array"/>, starting at a particular <see cref="T:System.Array"/> index.
@@ -763,7 +712,7 @@
/// -or-
/// The number of elements in the source <see cref="T:System.Collections.Generic.ICollection`1"/> is greater than the available space from <paramref name="arrayIndex"/> to the end of the destination <paramref name="array"/>.
/// </exception>
- public void CopyTo(MapSelection.LayerSelection[] array, int arrayIndex)
+ public void CopyTo(LayerSelection[] array, int arrayIndex)
{
throw new NotImplementedException();
}
@@ -771,25 +720,19 @@
/// <summary>
/// Gets the number of layers in this selection
/// </summary>
- public int Count
- {
- get { return _layers.Count; }
- }
+ public int Count => _layers.Count;
/// <summary>
/// Gets whether this is read only
/// </summary>
- public bool IsReadOnly
- {
- get { return false; }
- }
+ public bool IsReadOnly => false;
/// <summary>
/// Removes the specified layer selection
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
- public bool Remove(MapSelection.LayerSelection item)
+ public bool Remove(LayerSelection item)
{
int ix = IndexOf(item);
if (ix < 0)
@@ -807,19 +750,13 @@
/// Gets the layer selection enumerator
/// </summary>
/// <returns></returns>
- public IEnumerator<MapSelection.LayerSelection> GetEnumerator()
- {
- return _layers.GetEnumerator();
- }
+ public IEnumerator<LayerSelection> GetEnumerator() => _layers.GetEnumerator();
#endregion IEnumerable<LayerSelection> Members
#region IEnumerable Members
- System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
- {
- return ((System.Collections.IEnumerable)_layers).GetEnumerator();
- }
+ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() => ((System.Collections.IEnumerable)_layers).GetEnumerator();
#endregion IEnumerable Members
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -21,7 +21,6 @@
#endregion Disclaimer / License
using OSGeo.MapGuide.MaestroAPI.Commands;
-using OSGeo.MapGuide.MaestroAPI.Resource;
using OSGeo.MapGuide.MaestroAPI.Serialization;
using OSGeo.MapGuide.MaestroAPI.Services;
using OSGeo.MapGuide.ObjectModels;
@@ -123,9 +122,9 @@
/// </example>
public class RuntimeMap : MapObservable
{
- internal IFeatureService FeatureService { get { return this.CurrentConnection.FeatureService; } }
+ internal IFeatureService FeatureService => this.CurrentConnection.FeatureService;
- internal IResourceService ResourceService { get { return this.CurrentConnection.ResourceService; } }
+ internal IResourceService ResourceService => this.CurrentConnection.ResourceService;
/// <summary>
/// Gets the <see cref="T:OSGeo.MapGuide.MaestroAPI.IServerConnection"/> that is attached to this instance
@@ -157,22 +156,22 @@
/// <summary>
/// Gets whether extents of this map can be modified at runtime
/// </summary>
- public virtual bool SupportsMutableExtents { get { return true; } }
+ public virtual bool SupportsMutableExtents => true;
/// <summary>
/// Gets whether the coordinate system of this map can be modified at runtime
/// </summary>
- public virtual bool SupportsMutableCoordinateSystem { get { return true; } }
+ public virtual bool SupportsMutableCoordinateSystem => true;
/// <summary>
/// Gets whether the background color of this map can be modified at runtime
/// </summary>
- public virtual bool SupportsMutableBackgroundColor { get { return true; } }
+ public virtual bool SupportsMutableBackgroundColor => true;
/// <summary>
/// Gets whether the meters-per-unit value of this map can be modified at runtime
/// </summary>
- public virtual bool SupportsMutableMetersPerUnit { get { return true; } }
+ public virtual bool SupportsMutableMetersPerUnit => true;
/// <summary>
/// Initializes this instance
@@ -300,7 +299,7 @@
if (layer != null)
layerDefinitionCache.Add(key, layer);
}
- Debug.WriteLine("[RuntimeMap.ctor]: {0} layers pre-cached", layerDefinitionCache.Count); //NOXLATE
+ Debug.WriteLine($"[RuntimeMap.ctor]: {layerDefinitionCache.Count} layers pre-cached"); //NOXLATE
}
//Load map layers
@@ -364,17 +363,14 @@
/// <summary>
/// Gets the number of finite display scales
/// </summary>
- public int FiniteDisplayScaleCount { get { return _finiteDisplayScales.Length; } }
+ public int FiniteDisplayScaleCount => _finiteDisplayScales.Length;
/// <summary>
/// Gets the finite display scale at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public double GetFiniteDisplayScaleAt(int index)
- {
- return _finiteDisplayScales[index];
- }
+ public double GetFiniteDisplayScaleAt(int index) => _finiteDisplayScales[index];
/// <summary>
/// Gets or sets the map extents. Inspect the <see cref="P:OSGeo.MapGuide.MaestroAPI.Mapping.RuntimeMap.SupportsMutableMapExtents"/>
@@ -617,7 +613,7 @@
/// <summary>
/// The background color of the map
/// </summary>
- protected System.Drawing.Color _bgColor;
+ protected Color _bgColor;
/// <summary>
/// Gets or sets the color of the background. Check the <see cref="P:OSGeo.MapGuide.MaestroAPI.Mapping.RuntimeMap.SupportsMutableBackgroundColor"/>
@@ -625,7 +621,7 @@
/// </summary>
/// <exception cref="T:System.NotSupportedException">Thrown if the operation is not supported</exception>
/// <value>The color of the background.</value>
- public virtual System.Drawing.Color BackgroundColor
+ public virtual Color BackgroundColor
{
get
{
@@ -659,10 +655,7 @@
/// Gets the type of the resource.
/// </summary>
/// <value>The type of the resource.</value>
- public ResourceTypes ResourceType
- {
- get { return ResourceTypes.Map; }
- }
+ public ResourceTypes ResourceType => ResourceTypes.Map;
/// <summary>
/// Gets the meters per unit value. Check the <see cref="P:OSGeo.MapGuide.MaestroAPI.Mapping.RuntimeMap.SupportsMutableMetersPerUnit"/>
@@ -1137,10 +1130,7 @@
/// </summary>
/// <param name="id">The id.</param>
/// <returns></returns>
- public RuntimeMapLayer GetLayerByObjectId(string id)
- {
- return this.Layers.GetByObjectId(id);
- }
+ public RuntimeMapLayer GetLayerByObjectId(string id) => this.Layers.GetByObjectId(id);
/// <summary>
/// The collection of layers in this map
@@ -1243,10 +1233,7 @@
/// <summary>
/// Saves this instance. The changes are propagated back to the MapGuide Server
/// </summary>
- public virtual void Save()
- {
- Save(this.ResourceID);
- }
+ public virtual void Save() => Save(this.ResourceID);
/// <summary>
/// A dummy resource, used for the runtime map
@@ -1373,10 +1360,7 @@
/// <summary>
/// Clears all tracked changes
/// </summary>
- protected void ClearChanges()
- {
- m_changeList.Clear();
- }
+ protected void ClearChanges() => m_changeList.Clear();
/// <summary>
/// Called when a group is removed
@@ -1398,41 +1382,18 @@
/// Called when a group is added
/// </summary>
/// <param name="group"></param>
- internal void OnGroupAdded(RuntimeMapGroup group)
- {
- //???
+ internal void OnGroupAdded(RuntimeMapGroup group) => TrackChange(group.ObjectId, false, Change.ChangeType.added, string.Empty);
- TrackChange(group.ObjectId, false, Change.ChangeType.added, string.Empty);
- }
+ internal void OnGroupVisibilityChanged(RuntimeMapGroup group, string visbility) => TrackChange(group.ObjectId, false, Change.ChangeType.visibilityChanged, visbility);
- internal void OnGroupVisibilityChanged(RuntimeMapGroup group, string visbility)
- {
- TrackChange(group.ObjectId, false, Change.ChangeType.visibilityChanged, visbility);
+ internal void OnGroupDisplayInLegendChanged(RuntimeMapGroup group, string displayInLegendState) => TrackChange(group.ObjectId, false, Change.ChangeType.displayInLegendChanged, displayInLegendState);
- //???
- }
+ internal void OnGroupLegendLabelChanged(RuntimeMapGroup group, string legendLabel) => TrackChange(group.ObjectId, false, Change.ChangeType.legendLabelChanged, legendLabel);
- internal void OnGroupDisplayInLegendChanged(RuntimeMapGroup group, string displayInLegendState)
- {
- TrackChange(group.ObjectId, false, Change.ChangeType.displayInLegendChanged, displayInLegendState);
- }
+ internal void OnGroupParentChanged(RuntimeMapGroup group, string parentId) => TrackChange(group.ObjectId, false, Change.ChangeType.parentChanged, parentId);
- internal void OnGroupLegendLabelChanged(RuntimeMapGroup group, string legendLabel)
- {
- TrackChange(group.ObjectId, false, Change.ChangeType.legendLabelChanged, legendLabel);
- }
+ internal void OnLayerRemoved(RuntimeMapLayer layer) => TrackChange(layer.ObjectId, true, Change.ChangeType.removed, string.Empty);
- internal void OnGroupParentChanged(RuntimeMapGroup group, string parentId)
- {
- TrackChange(group.ObjectId, false, Change.ChangeType.parentChanged, parentId);
- }
-
- internal void OnLayerRemoved(RuntimeMapLayer layer)
- {
- //???
- TrackChange(layer.ObjectId, true, Change.ChangeType.removed, string.Empty);
- }
-
/// <summary>
/// Raise when a layer is added to the map
/// </summary>
@@ -1440,9 +1401,7 @@
internal void OnLayerAdded(RuntimeMapLayer layer)
{
- var h = this.LayerAdded;
- if (h != null)
- h(this, layer);
+ this.LayerAdded?.Invoke(this, layer);
//Fix the draw order of this layer that was added
//???
@@ -1450,38 +1409,18 @@
TrackChange(layer.ObjectId, true, Change.ChangeType.added, string.Empty);
}
- internal void OnLayerVisibilityChanged(RuntimeMapLayer layer, string visibility)
- {
- //???
+ internal void OnLayerVisibilityChanged(RuntimeMapLayer layer, string visibility) => TrackChange(layer.ObjectId, true, Change.ChangeType.visibilityChanged, visibility);
- TrackChange(layer.ObjectId, true, Change.ChangeType.visibilityChanged, visibility);
- }
+ internal void OnLayerDisplayInLegendChanged(RuntimeMapLayer layer, string displayInLegendState) => TrackChange(layer.ObjectId, true, Change.ChangeType.displayInLegendChanged, displayInLegendState);
- internal void OnLayerDisplayInLegendChanged(RuntimeMapLayer layer, string displayInLegendState)
- {
- TrackChange(layer.ObjectId, true, Change.ChangeType.displayInLegendChanged, displayInLegendState);
- }
+ internal void OnLayerLegendLabelChanged(RuntimeMapLayer layer, string legendLabel) => TrackChange(layer.ObjectId, true, Change.ChangeType.legendLabelChanged, legendLabel);
- internal void OnLayerLegendLabelChanged(RuntimeMapLayer layer, string legendLabel)
- {
- TrackChange(layer.ObjectId, true, Change.ChangeType.legendLabelChanged, legendLabel);
- }
+ internal void OnLayerParentChanged(RuntimeMapLayer layer, string parentId) => TrackChange(layer.ObjectId, true, Change.ChangeType.parentChanged, parentId);
- internal void OnLayerParentChanged(RuntimeMapLayer layer, string parentId)
- {
- TrackChange(layer.ObjectId, true, Change.ChangeType.parentChanged, parentId);
- }
+ internal void OnLayerSelectabilityChanged(RuntimeMapLayer layer, string selectability) => TrackChange(layer.ObjectId, true, Change.ChangeType.selectabilityChanged, selectability);
- internal void OnLayerSelectabilityChanged(RuntimeMapLayer layer, string selectability)
- {
- TrackChange(layer.ObjectId, true, Change.ChangeType.selectabilityChanged, selectability);
- }
+ internal void OnLayerDefinitionChanged(RuntimeMapLayer layer) => TrackChange(layer.ObjectId, true, Change.ChangeType.definitionChanged, string.Empty);
- internal void OnLayerDefinitionChanged(RuntimeMapLayer layer)
- {
- TrackChange(layer.ObjectId, true, Change.ChangeType.definitionChanged, string.Empty);
- }
-
#endregion change tracking
#region convenience methods
@@ -1514,10 +1453,7 @@
/// <param name="keepSelection"></param>
/// <returns></returns>
[Obsolete("Use the version of RenderDynamicOverlay that is not marked Obsolete")] //NOXLATE
- public System.IO.Stream RenderDynamicOverlay(string format, bool keepSelection)
- {
- return RenderDynamicOverlay(this.Selection, format, keepSelection);
- }
+ public System.IO.Stream RenderDynamicOverlay(string format, bool keepSelection) => RenderDynamicOverlay(this.Selection, format, keepSelection);
/// <summary>
/// Convenience method for rendering a dynamic overlay of the current map
@@ -1568,7 +1504,7 @@
/// <param name="color"></param>
/// <param name="format"></param>
/// <returns></returns>
- public System.IO.Stream RenderMapLegend(int width, int height, System.Drawing.Color color, string format)
+ public System.IO.Stream RenderMapLegend(int width, int height, Color color, string format)
{
if (_mapSvc == null)
throw new NotSupportedException();
@@ -1614,7 +1550,7 @@
/// <param name="geomType"></param>
/// <param name="themeCategory"></param>
/// <returns></returns>
- public System.Drawing.Image GetLegendImage(string layerDefinitionID, double scale, int width, int height, string format, int geomType, int themeCategory)
+ public Image GetLegendImage(string layerDefinitionID, double scale, int width, int height, string format, int geomType, int themeCategory)
{
if (_mapSvc == null)
throw new NotSupportedException();
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapLayer.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapLayer.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMapLayer.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -21,7 +21,6 @@
#endregion Disclaimer / License
using OSGeo.MapGuide.MaestroAPI.Feature;
-using OSGeo.MapGuide.MaestroAPI.Resource;
using OSGeo.MapGuide.MaestroAPI.Schema;
using OSGeo.MapGuide.MaestroAPI.Serialization;
using OSGeo.MapGuide.ObjectModels;
@@ -926,7 +925,7 @@
else if (type == typeof(byte[]))
return Blob;
- throw new Exception("Failed to find type for: " + type.FullName.ToString());
+ throw new Exception($"Failed to find type for: {type.FullName.ToString()}"); //LOCALIZEME
}
private static Type ConvertMgTypeToNetType(short idType)
@@ -989,7 +988,7 @@
//register change items on map
switch (propertyName)
{
- case "Group": //NOXLATE
+ case nameof(this.Group):
var name = this.Group;
if (this.Parent.Groups[name] != null)
this.Parent.OnLayerParentChanged(this, this.Parent.Groups[name].ObjectId);
@@ -997,23 +996,23 @@
this.Parent.OnLayerParentChanged(this, string.Empty);
break;
- case "Visible": //NOXLATE
+ case nameof(this.Visible):
this.Parent.OnLayerVisibilityChanged(this, this.Visible ? "1" : "0"); //NOXLATE
break;
- case "ShowInLegend": //NOXLATE
+ case nameof(this.ShowInLegend):
this.Parent.OnLayerDisplayInLegendChanged(this, this.ShowInLegend ? "1" : "0"); //NOXLATE
break;
- case "LegendLabel": //NOXLATE
+ case nameof(this.LegendLabel):
this.Parent.OnLayerLegendLabelChanged(this, this.LegendLabel);
break;
- case "LayerDefinitionID": //NOXLATE
+ case nameof(this.LayerDefinitionID):
this.Parent.OnLayerDefinitionChanged(this);
break;
- case "Selectable": //NOXLATE
+ case nameof(this.Selectable):
this.Parent.OnLayerSelectabilityChanged(this, this.Selectable ? "1" : "0"); //NOXLATE
break;
}
@@ -1052,6 +1051,6 @@
/// <summary>
/// Gets a display string for this layer for presentation purposes
/// </summary>
- public string DisplayString { get { return this.LegendLabel + " (" + this.Name + ")"; } } //NOXLATE
+ public string DisplayString => $"{this.LegendLabel} ({this.Name})"; //NOXLATE
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/MgServerConnectionBase.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/MgServerConnectionBase.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/MgServerConnectionBase.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -76,7 +76,7 @@
/// <summary>
/// Gets or sets a value indicating if the session should automatically be restarted if it expires
/// </summary>
- virtual public bool AutoRestartSession
+ public virtual bool AutoRestartSession
{
get { return m_autoRestartSession; }
set
@@ -107,15 +107,12 @@
/// </summary>
/// <param name="ex">The exception to evaluate</param>
/// <returns>True if the exception is a session expired exception</returns>
- abstract public bool IsSessionExpiredException(Exception ex);
+ public abstract bool IsSessionExpiredException(Exception ex);
/// <summary>
/// Restarts the server session, and creates a new session ID
/// </summary>
- public void RestartSession()
- {
- RestartSession(true);
- }
+ public void RestartSession() => RestartSession(true);
/// <summary>
/// Raised when the associated session id has changed. This would happen if the connection detected an expired session
@@ -149,9 +146,7 @@
{
if (oldSessionId != newSessionId)
{
- var h = this.SessionIDChanged;
- if (h != null)
- h(this, EventArgs.Empty);
+ this.SessionIDChanged?.Invoke(this, EventArgs.Empty);
}
}
}
@@ -177,23 +172,20 @@
/// Gets a list of all users on the server
/// </summary>
/// <returns>The list of users</returns>
- public virtual ObjCommon.UserList EnumerateUsers()
- {
- return this.EnumerateUsers(null);
- }
+ public virtual ObjCommon.UserList EnumerateUsers() => this.EnumerateUsers(null);
/// <summary>
/// Gets a list of users in a group
/// </summary>
/// <param name="group">The group to retrieve the users from</param>
/// <returns>The list of users</returns>
- abstract public ObjCommon.UserList EnumerateUsers(string group);
+ public abstract ObjCommon.UserList EnumerateUsers(string group);
/// <summary>
/// Gets a list of all groups on the server
/// </summary>
/// <returns>The list of groups</returns>
- abstract public ObjCommon.GroupList EnumerateGroups();
+ public abstract ObjCommon.GroupList EnumerateGroups();
#endregion Site
@@ -219,10 +211,8 @@
/// <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 virtual System.Drawing.Image GetLegendImage(double scale, string layerdefinition, int themeIndex, int type)
- {
- return GetLegendImage(scale, layerdefinition, themeIndex, type, 16, 16, "PNG"); //NOXLATE
- }
+ public virtual Image GetLegendImage(double scale, string layerdefinition, int themeIndex, int type)
+ => GetLegendImage(scale, layerdefinition, themeIndex, type, 16, 16, "PNG");
/// <summary>
/// Gets the legend image.
@@ -235,7 +225,7 @@
/// <param name="height">The height.</param>
/// <param name="format">The format.</param>
/// <returns></returns>
- abstract public System.Drawing.Image GetLegendImage(double scale, string layerdefinition, int themeIndex, int type, int width, int height, string format);
+ public abstract Image GetLegendImage(double scale, string layerdefinition, int themeIndex, int type, int width, int height, string format);
/// <summary>
/// Renders the runtime map.
@@ -249,9 +239,7 @@
/// <param name="dpi">The dpi.</param>
/// <returns></returns>
public virtual System.IO.Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi)
- {
- return this.RenderRuntimeMap(map, x, y, scale, width, height, dpi, "PNG", false); //NOXLATE
- }
+ => this.RenderRuntimeMap(map, x, y, scale, width, height, dpi, "PNG", false);
/// <summary>
/// Renders the runtime map.
@@ -266,9 +254,7 @@
/// <param name="dpi">The dpi.</param>
/// <returns></returns>
public virtual System.IO.Stream RenderRuntimeMap(RuntimeMap map, double x1, double y1, double x2, double y2, int width, int height, int dpi)
- {
- return this.RenderRuntimeMap(map, x1, y1, x2, y2, width, height, dpi, "PNG", false); //NOXLATE
- }
+ => this.RenderRuntimeMap(map, x1, y1, x2, y2, width, height, dpi, "PNG", false);
/// <summary>
/// Renders the runtime map.
@@ -283,9 +269,7 @@
/// <param name="format">The format.</param>
/// <returns></returns>
public virtual System.IO.Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi, string format)
- {
- return this.RenderRuntimeMap(map, x, y, scale, width, height, dpi, format, false);
- }
+ => this.RenderRuntimeMap(map, x, y, scale, width, height, dpi, format, false);
/// <summary>
/// Renders the runtime map.
@@ -301,9 +285,7 @@
/// <param name="format">The format.</param>
/// <returns></returns>
public virtual System.IO.Stream RenderRuntimeMap(RuntimeMap map, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format)
- {
- return this.RenderRuntimeMap(map, x1, y1, x2, y2, width, height, dpi, format, false);
- }
+ => this.RenderRuntimeMap(map, x1, y1, x2, y2, width, height, dpi, format, false);
/// <summary>
/// Renders the runtime map.
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -26,12 +26,10 @@
using OSGeo.MapGuide.MaestroAPI.Exceptions;
using OSGeo.MapGuide.MaestroAPI.Feature;
using OSGeo.MapGuide.MaestroAPI.Mapping;
-using OSGeo.MapGuide.MaestroAPI.Resource;
using OSGeo.MapGuide.MaestroAPI.Schema;
using OSGeo.MapGuide.MaestroAPI.SchemaOverrides;
using OSGeo.MapGuide.MaestroAPI.Serialization;
using OSGeo.MapGuide.ObjectModels;
-using OSGeo.MapGuide.ObjectModels.Capabilities;
using OSGeo.MapGuide.ObjectModels.Common;
using OSGeo.MapGuide.ObjectModels.IO;
using OSGeo.MapGuide.ObjectModels.LayerDefinition;
@@ -86,7 +84,7 @@
m_serializers = new Hashtable();
m_validator = new XmlValidator();
m_cachedSchemas = new Hashtable();
- m_schemasPath = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "Schemas"); //NOXLATE
+ m_schemasPath = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "Schemas"); //NOXLATE
}
#region Serialization plumbing
@@ -97,10 +95,7 @@
/// <typeparam name="T">The expected object type</typeparam>
/// <param name="data">The stream containing the object</param>
/// <returns>The deserialized object</returns>
- virtual public T DeserializeObject<T>(System.IO.Stream data)
- {
- return (T)DeserializeObject(typeof(T), data);
- }
+ public virtual T DeserializeObject<T>(Stream data) => (T)DeserializeObject(typeof(T), data);
/// <summary>
/// Deserializes an object from a stream.
@@ -108,11 +103,11 @@
/// <param name="type">The expected object type</param>
/// <param name="data">The stream containing the object</param>
/// <returns>The deserialized object</returns>
- virtual public object DeserializeObject(Type type, System.IO.Stream data)
+ public virtual object DeserializeObject(Type type, Stream data)
{
//HACK: MGOS 2.2 outputs different capabilities xml (because it's actually the correct one!), so
//without breaking support against 2.1 and older servers, we transform the xml to its pre-2.2 form
- if (type == typeof(OSGeo.MapGuide.ObjectModels.Capabilities.v1_0_0.FdoProviderCapabilities) && this.SiteVersion < new Version(2, 2))
+ if (type == typeof(ObjectModels.Capabilities.v1_0_0.FdoProviderCapabilities) && this.SiteVersion < new Version(2, 2))
{
StringBuilder sb = null;
using (StreamReader reader = new StreamReader(data))
@@ -172,9 +167,9 @@
/// </summary>
/// <param name="o">The object to serialize</param>
/// <returns>A memorystream with the serialized object</returns>
- virtual public System.IO.MemoryStream SerializeObject(object o)
+ public virtual System.IO.MemoryStream SerializeObject(object o)
{
- System.IO.MemoryStream ms = new System.IO.MemoryStream();
+ MemoryStream ms = new MemoryStream();
GetSerializer(o.GetType()).Serialize(new Utf8XmlWriter(ms), o);
return Utility.RemoveUTF8BOM(ms);
}
@@ -184,7 +179,7 @@
/// </summary>
/// <param name="o">The object to serialize</param>
/// <param name="stream">The stream to serialize into</param>
- virtual public void SerializeObject(object o, System.IO.Stream stream)
+ public virtual void SerializeObject(object o, Stream stream)
{
//The Utf8 writer makes sure the Utf8 tag is in place + sets encoding to Utf8
//This is needed because the server fails when rendering maps using non utf8 xml documents
@@ -225,16 +220,13 @@
/// Validates the current server version against the highest tested version.
/// </summary>
/// <param name="version">The version to validate</param>
- virtual protected void ValidateVersion(ObjCommon.SiteVersion version)
- {
- ValidateVersion(new Version(version.Version));
- }
+ protected virtual void ValidateVersion(SiteVersion version) => ValidateVersion(new Version(version.Version));
/// <summary>
/// Validates the current server version against the highest tested version.
/// </summary>
/// <param name="version">The version to validate</param>
- virtual protected void ValidateVersion(Version version)
+ protected virtual void ValidateVersion(Version version)
{
if (version > this.MaxTestedVersion)
throw new Exception("Untested with MapGuide Build > " + this.MaxTestedVersion.ToString()); //NOXLATE
@@ -246,7 +238,7 @@
/// Gets the preview URL generator.
/// </summary>
/// <returns>The preview URL generator. Returns null if this connection does not support browser-based resource previews</returns>
- public virtual OSGeo.MapGuide.MaestroAPI.Resource.Preview.IResourcePreviewUrlGenerator GetPreviewUrlGenerator()
+ public virtual Resource.Preview.IResourcePreviewUrlGenerator GetPreviewUrlGenerator()
{
return null;
}
@@ -266,7 +258,7 @@
/// <summary>
/// Gets the current SessionID.
/// </summary>
- abstract public string SessionID { get; }
+ public abstract string SessionID { get; }
/// <summary>
/// Gets the interface of this connection
@@ -279,10 +271,7 @@
/// </summary>
/// <param name="providername">The name of the provider, with or without version numbers</param>
/// <returns>The provider name without version numbers</returns>
- virtual public string RemoveVersionFromProviderName(string providername)
- {
- return Utility.StripVersionFromProviderName(providername);
- }
+ public virtual string RemoveVersionFromProviderName(string providername) => Utility.StripVersionFromProviderName(providername);
/// <summary>
/// Gets the Xsd schema for a given type.
@@ -328,39 +317,24 @@
/// Raises the <see cref="ResourceAdded"/> event
/// </summary>
/// <param name="resId"></param>
- protected void OnResourceAdded(string resId)
- {
- var handler = this.ResourceAdded;
- if (handler != null)
- handler(this, new ResourceEventArgs(resId));
- }
+ protected void OnResourceAdded(string resId) => this.ResourceAdded?.Invoke(this, new ResourceEventArgs(resId));
/// <summary>
/// Raises the <see cref="ResourceDeleted"/> event
/// </summary>
/// <param name="resId"></param>
- protected void OnResourceDeleted(string resId)
- {
- var handler = this.ResourceDeleted;
- if (handler != null)
- handler(this, new ResourceEventArgs(resId));
- }
+ protected void OnResourceDeleted(string resId) => this.ResourceDeleted?.Invoke(this, new ResourceEventArgs(resId));
/// <summary>
/// Raises the <see cref="ResourceUpdated"/> event
/// </summary>
/// <param name="resId"></param>
- protected void OnResourceUpdated(string resId)
- {
- var handler = this.ResourceUpdated;
- if (handler != null)
- handler(this, new ResourceEventArgs(resId));
- }
+ protected void OnResourceUpdated(string resId) => this.ResourceUpdated?.Invoke(this, new ResourceEventArgs(resId));
/// <summary>
/// Gets or sets the collection of cached schemas. Use the object type for key, and an XmlSchema instance for value.
/// </summary>
- virtual public Hashtable CachedSchemas
+ public virtual Hashtable CachedSchemas
{
get { return m_cachedSchemas; }
set { m_cachedSchemas = value; }
@@ -369,7 +343,7 @@
/// <summary>
/// Releases unmanaged and - optionally - managed resources
/// </summary>
- abstract public void Dispose();
+ public abstract void Dispose();
/// <summary>
/// Clones this instance.
@@ -408,7 +382,7 @@
/// </summary>
/// <param name="resourceID">The full resourceID of the item to retrieve.</param>
/// <returns>A deserialized object.</returns>
- virtual public IResource GetResource(string resourceID)
+ public virtual IResource GetResource(string resourceID)
{
var stream = GetResourceXmlData(resourceID);
var rt = ResourceIdentifier.GetResourceTypeAsString(resourceID);
@@ -430,7 +404,7 @@
/// </summary>
/// <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)
+ public virtual void WriteResource(string resourceID, object resource)
{
System.IO.MemoryStream ms = SerializeObject(resource);
ms.Position = 0;
@@ -554,11 +528,11 @@
else
sourcefolder = resourceID.Substring(0, resourceID.LastIndexOf("/") + 1); //NOXLATE
- ObjCommon.ResourceList lst = GetRepositoryResources(sourcefolder, 1);
+ 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(ResourceListResourceFolder) && ((ResourceListResourceFolder)o).ResourceId == resourceID)
return true;
- else if (o.GetType() == typeof(ObjCommon.ResourceListResourceDocument) && ((ObjCommon.ResourceListResourceDocument)o).ResourceId == resourceID)
+ else if (o.GetType() == typeof(ResourceListResourceDocument) && ((ResourceListResourceDocument)o).ResourceId == resourceID)
return true;
return false;
@@ -773,7 +747,7 @@
Hashtable paths = new Hashtable();
//The old path does not exist, but luckily the call works anyway
- ObjCommon.ResourceReferenceList rlf = EnumerateResourceReferences(oldpath);
+ ResourceReferenceList rlf = EnumerateResourceReferences(oldpath);
foreach (string s in rlf.ResourceId)
if (!paths.ContainsKey(s))
@@ -882,18 +856,18 @@
if (la.Cancel)
return false;
- ObjCommon.ResourceList lst = GetRepositoryResources(newpath);
+ ResourceList lst = GetRepositoryResources(newpath);
Hashtable items = new Hashtable();
foreach (object o in lst.Items)
{
- if (o.GetType() == typeof(ObjCommon.ResourceListResourceDocument))
+ if (o.GetType() == typeof(ResourceListResourceDocument))
{
//The old path does not exist, but we need to enumerate references at the old location
- string resource_oldpath = ((ObjCommon.ResourceListResourceDocument)o).ResourceId;
+ string resource_oldpath = ((ResourceListResourceDocument)o).ResourceId;
resource_oldpath = oldpath + resource_oldpath.Substring(newpath.Length);
- ObjCommon.ResourceReferenceList rlf = EnumerateResourceReferences(resource_oldpath);
+ ResourceReferenceList rlf = EnumerateResourceReferences(resource_oldpath);
foreach (string s in rlf.ResourceId)
if (!items.Contains(s))
items.Add(s, new LengthyOperationCallbackArgs.LengthyOperationItem(s));
@@ -989,7 +963,7 @@
{
oldpath = FixAndValidateFolderPath(oldpath);
newpath = FixAndValidateFolderPath(newpath);
- ObjCommon.ResourceList lst = GetRepositoryResources(oldpath);
+ ResourceList lst = GetRepositoryResources(oldpath);
LengthyOperationProgressArgs la = new LengthyOperationProgressArgs(Strings.ProgressCopyingFolder, -1);
if (progress != null)
@@ -1014,9 +988,9 @@
Hashtable paths = new Hashtable();
foreach (object o in lst.Items)
{
- if (o.GetType() == typeof(ObjCommon.ResourceListResourceDocument))
+ if (o.GetType() == typeof(ResourceListResourceDocument))
{
- ObjCommon.ResourceReferenceList rlf = EnumerateResourceReferences(((ObjCommon.ResourceListResourceDocument)o).ResourceId);
+ ResourceReferenceList rlf = EnumerateResourceReferences(((ResourceListResourceDocument)o).ResourceId);
foreach (string s in rlf.ResourceId)
if (s.StartsWith(oldpath))
{
@@ -1122,10 +1096,10 @@
/// Creates a folder on the server
/// </summary>
/// <param name="resourceID">The path of the folder to create</param>
- virtual public void CreateFolder(string resourceID)
+ public virtual void CreateFolder(string resourceID)
{
resourceID = FixAndValidateFolderPath(resourceID);
- SetResourceXmlData(resourceID, new System.IO.MemoryStream());
+ SetResourceXmlData(resourceID, new MemoryStream());
}
/// <summary>
@@ -1133,13 +1107,13 @@
/// </summary>
/// <param name="folderpath">The path of the folder</param>
/// <returns>True if the folder exists, false otherwise. Also returns false on error.</returns>
- virtual public bool HasFolder(string folderpath)
+ public virtual bool HasFolder(string folderpath)
{
folderpath = FixAndValidateFolderPath(folderpath);
try
{
- ObjCommon.ResourceList l = this.GetRepositoryResources(folderpath, 1);
+ ResourceList l = this.GetRepositoryResources(folderpath, 1);
return true;
}
catch
@@ -1153,7 +1127,7 @@
/// </summary>
/// <param name="resourceid">The resource to enumerate references for</param>
/// <returns>A list of resources that reference the given resourceID</returns>
- abstract public ObjCommon.ResourceReferenceList EnumerateResourceReferences(string resourceid);
+ public abstract ResourceReferenceList EnumerateResourceReferences(string resourceid);
/// <summary>
/// Copies a resource from one location to another. This does not update any references.
@@ -1161,7 +1135,7 @@
/// <param name="oldpath">The current resource path, the one copying from</param>
/// <param name="newpath">The new resource path, the one copying to</param>
/// <param name="overwrite">True if the copy can overwrite an existing resource, false otherwise</param>
- abstract public void CopyResource(string oldpath, string newpath, bool overwrite);
+ public abstract void CopyResource(string oldpath, string newpath, bool overwrite);
/// <summary>
/// Copies a folder and all its content. This does not update any references.
@@ -1169,7 +1143,7 @@
/// <param name="oldpath">The current folder path, the one copying from</param>
/// <param name="newpath">The new folder path, the one copying to</param>
/// <param name="overwrite">True if the copy can overwrite an existing folder, false otherwise</param>
- abstract public void CopyFolder(string oldpath, string newpath, bool overwrite);
+ public abstract void CopyFolder(string oldpath, string newpath, bool overwrite);
/// <summary>
/// Moves a resource from one location to another. This does not update any references.
@@ -1177,7 +1151,7 @@
/// <param name="oldpath">The current resource path, the one moving from</param>
/// <param name="newpath">The new resource path, the one moving to</param>
/// <param name="overwrite">True if the move can overwrite an existing resource, false otherwise</param>
- abstract public void MoveResource(string oldpath, string newpath, bool overwrite);
+ public abstract void MoveResource(string oldpath, string newpath, bool overwrite);
/// <summary>
/// Moves a folder and its content from one location to another. This does not update any references.
@@ -1185,7 +1159,7 @@
/// <param name="oldpath">The current folder path, the one moving from</param>
/// <param name="newpath">The new folder path, the one moving to</param>
/// <param name="overwrite">True if the move can overwrite an existing folder, false otherwise</param>
- abstract public void MoveFolder(string oldpath, string newpath, bool overwrite);
+ public abstract void MoveFolder(string oldpath, string newpath, bool overwrite);
/// <summary>
/// Returns data from a resource as a memorystream
@@ -1193,7 +1167,7 @@
/// <param name="resourceID">The id of the resource to fetch data from</param>
/// <param name="dataname">The name of the associated data item</param>
/// <returns>A stream containing the references resource data</returns>
- abstract public System.IO.Stream GetResourceData(string resourceID, string dataname);
+ public abstract Stream GetResourceData(string resourceID, string dataname);
/// <summary>
/// Uploads data to a resource
@@ -1202,10 +1176,7 @@
/// <param name="dataname">The name of the data to update or create</param>
/// <param name="datatype">The type of data</param>
/// <param name="stream">A stream containing the new content of the resource data</param>
- virtual public void SetResourceData(string resourceid, string dataname, ObjCommon.ResourceDataType datatype, System.IO.Stream stream)
- {
- SetResourceData(resourceid, dataname, datatype, stream, null);
- }
+ public virtual void SetResourceData(string resourceid, string dataname, ResourceDataType datatype, Stream stream) => SetResourceData(resourceid, dataname, datatype, stream, null);
/// <summary>
/// Uploads data to a resource
@@ -1215,7 +1186,7 @@
/// <param name="datatype">The type of data</param>
/// <param name="stream">A stream containing the new content of the resource data</param>
/// <param name="callback">The callback.</param>
- abstract public void SetResourceData(string resourceid, string dataname, ObjCommon.ResourceDataType datatype, System.IO.Stream stream, Utility.StreamCopyProgressDelegate callback);
+ public abstract void SetResourceData(string resourceid, string dataname, ResourceDataType datatype, Stream stream, Utility.StreamCopyProgressDelegate callback);
/// <summary>
/// Removes all cached items associated with the given feature source
@@ -1298,21 +1269,21 @@
/// </summary>
/// <param name="filename">Name of the file to upload</param>
/// <param name="callback">A callback argument used to display progress. May be null.</param>
- abstract public void UploadPackage(string filename, Utility.StreamCopyProgressDelegate callback);
+ public abstract void UploadPackage(string filename, Utility.StreamCopyProgressDelegate callback);
/// <summary>
/// Updates the repository.
/// </summary>
/// <param name="resourceId">The resource id.</param>
/// <param name="header">The header.</param>
- abstract public void UpdateRepository(string resourceId, ObjCommon.ResourceFolderHeaderType header);
+ public abstract void UpdateRepository(string resourceId, ResourceFolderHeaderType header);
/// <summary>
/// Gets the folder or resource header.
/// </summary>
/// <param name="resourceId">The resource id.</param>
/// <returns></returns>
- abstract public object GetFolderOrResourceHeader(string resourceId);
+ public abstract object GetFolderOrResourceHeader(string resourceId);
/// <summary>
/// Sets the resource XML data.
@@ -1320,33 +1291,30 @@
/// <param name="resourceId">The resource id.</param>
/// <param name="content">The content.</param>
/// <param name="header">The header.</param>
- abstract public void SetResourceXmlData(string resourceId, System.IO.Stream content, System.IO.Stream header);
+ public abstract void SetResourceXmlData(string resourceId, System.IO.Stream content, System.IO.Stream header);
/// <summary>
/// Gets the resource header.
/// </summary>
/// <param name="resourceID">The resource ID.</param>
/// <returns></returns>
- public virtual ObjCommon.ResourceDocumentHeaderType GetResourceHeader(string resourceID)
- {
- return (ObjCommon.ResourceDocumentHeaderType)this.GetFolderOrResourceHeader(resourceID);
- }
+ public virtual ResourceDocumentHeaderType GetResourceHeader(string resourceID) => (ResourceDocumentHeaderType)this.GetFolderOrResourceHeader(resourceID);
/// <summary>
/// Gets the folder header.
/// </summary>
/// <param name="resourceID">The resource ID.</param>
/// <returns></returns>
- public virtual ObjCommon.ResourceFolderHeaderType GetFolderHeader(string resourceID)
+ public virtual ResourceFolderHeaderType GetFolderHeader(string resourceID)
{
if (resourceID.EndsWith("//"))
{
- ObjCommon.ResourceList lst = this.GetRepositoryResources(resourceID, 0);
- ObjCommon.ResourceListResourceFolder fld = lst.Items[0] as ObjCommon.ResourceListResourceFolder;
+ ResourceList lst = this.GetRepositoryResources(resourceID, 0);
+ ResourceListResourceFolder fld = lst.Items[0] as ResourceListResourceFolder;
return fld.ResourceFolderHeader;
}
else
- return (ObjCommon.ResourceFolderHeaderType)this.GetFolderOrResourceHeader(resourceID);
+ return (ResourceFolderHeaderType)this.GetFolderOrResourceHeader(resourceID);
}
/// <summary>
@@ -1354,20 +1322,14 @@
/// </summary>
/// <param name="resourceID">The resource ID.</param>
/// <param name="header">The header.</param>
- public virtual void SetFolderHeader(string resourceID, ObjCommon.ResourceFolderHeaderType header)
- {
- SetFolderOrResourceHeader(resourceID, header);
- }
+ public virtual void SetFolderHeader(string resourceID, ResourceFolderHeaderType header) => SetFolderOrResourceHeader(resourceID, header);
/// <summary>
/// Sets the resource header.
/// </summary>
/// <param name="resourceID">The resource ID.</param>
/// <param name="header">The header.</param>
- public virtual void SetResourceHeader(string resourceID, ObjCommon.ResourceDocumentHeaderType header)
- {
- SetFolderOrResourceHeader(resourceID, header);
- }
+ public virtual void SetResourceHeader(string resourceID, ResourceDocumentHeaderType header) => SetFolderOrResourceHeader(resourceID, header);
/// <summary>
/// Sets the folder or resource header.
@@ -1379,11 +1341,11 @@
if (header == null)
throw new ArgumentNullException(nameof(header)); //NOXLATE
- ObjCommon.ResourceSecurityType sec;
- if (header as ObjCommon.ResourceFolderHeaderType != null)
- sec = (header as ObjCommon.ResourceFolderHeaderType).Security;
- else if (header as ObjCommon.ResourceDocumentHeaderType != null)
- sec = (header as ObjCommon.ResourceDocumentHeaderType).Security;
+ ResourceSecurityType sec;
+ if (header as ResourceFolderHeaderType != null)
+ sec = (header as ResourceFolderHeaderType).Security;
+ else if (header as ResourceDocumentHeaderType != null)
+ sec = (header as ResourceDocumentHeaderType).Security;
else
throw new ArgumentException(Strings.ErrorInvalidResourceHeaderRootElement, nameof(header)); //NOXLATE
@@ -1395,9 +1357,9 @@
if (resourceID.EndsWith("//")) //NOXLATE
{
- if (header as ObjCommon.ResourceFolderHeaderType == null)
+ if (header as ResourceFolderHeaderType == null)
throw new Exception(string.Format(Strings.ErrorResourceMustBeUpdatedWithFolderHeader, resourceID));
- UpdateRepository(resourceID, header as ObjCommon.ResourceFolderHeaderType);
+ UpdateRepository(resourceID, header as ResourceFolderHeaderType);
}
else
this.SetResourceXmlData(resourceID, null, this.SerializeObject(header));
@@ -1411,7 +1373,7 @@
/// <param name="recursive">True if the list should contains recursive results</param>
/// <param name="startpath">The path to retrieve the data from</param>
/// <returns>A list of unmanaged data</returns>
- abstract public ObjCommon.UnmanagedDataList EnumerateUnmanagedData(string startpath, string filter, bool recursive, UnmanagedDataTypes type);
+ public abstract UnmanagedDataList EnumerateUnmanagedData(string startpath, string filter, bool recursive, UnmanagedDataTypes type);
#endregion Resource Service
@@ -1422,10 +1384,10 @@
/// </summary>
/// <param name="providername">The name of the provider</param>
/// <returns>The first matching provider or null</returns>
- virtual public ObjCommon.FeatureProviderRegistryFeatureProvider GetFeatureProvider(string providername)
+ public virtual FeatureProviderRegistryFeatureProvider GetFeatureProvider(string providername)
{
string pname = RemoveVersionFromProviderName(providername).ToLower();
- foreach (ObjCommon.FeatureProviderRegistryFeatureProvider p in this.FeatureProviders)
+ foreach (FeatureProviderRegistryFeatureProvider p in this.FeatureProviders)
if (RemoveVersionFromProviderName(p.Name).ToLower().Equals(pname.ToLower()))
return p;
@@ -1442,7 +1404,7 @@
/// <summary>
/// Gets a list of installed feature providers
/// </summary>
- abstract public ObjCommon.FeatureProviderRegistryFeatureProvider[] FeatureProviders { get; }
+ public abstract FeatureProviderRegistryFeatureProvider[] FeatureProviders { get; }
/// <summary>
/// Returns the spatial info for a given featuresource
@@ -1450,7 +1412,7 @@
/// <param name="resourceID">The ID of the resource to query</param>
/// <param name="activeOnly">Query only active items</param>
/// <returns>A list of spatial contexts</returns>
- abstract public ObjCommon.FdoSpatialContextList GetSpatialContextInfo(string resourceID, bool activeOnly);
+ public abstract FdoSpatialContextList GetSpatialContextInfo(string resourceID, bool activeOnly);
/// <summary>
/// Gets the names of the identity properties from a feature
@@ -1458,7 +1420,7 @@
/// <param name="resourceID">The resourceID for the FeatureSource</param>
/// <param name="classname">The classname of the feature, including schema</param>
/// <returns>A string array with the found identities</returns>
- abstract public string[] GetIdentityProperties(string resourceID, string classname);
+ public abstract string[] GetIdentityProperties(string resourceID, string classname);
/// <summary>
/// Describes the feature source.
@@ -1466,7 +1428,7 @@
/// <param name="resourceID">The resource ID.</param>
/// <param name="schema">The schema.</param>
/// <returns></returns>
- abstract public FeatureSchema DescribeFeatureSource(string resourceID, string schema);
+ public abstract FeatureSchema DescribeFeatureSource(string resourceID, string schema);
/// <summary>
/// Describes the specified feature source restricted to only the specified schema and the specified class names
@@ -1527,7 +1489,7 @@
}
#if DEBUG
if (bFromCache)
- System.Diagnostics.Trace.TraceInformation("Returning cached description for {0}", resourceID); //NOXLATE
+ System.Diagnostics.Trace.TraceInformation($"Returning cached description for {resourceID}"); //NOXLATE
#endif
//Return a clone to ensure immutability of cached one
return FeatureSourceDescription.Clone(m_featureSchemaCache[resourceID]);
@@ -1589,7 +1551,7 @@
#if DEBUG
if (bFromCache)
- System.Diagnostics.Trace.TraceInformation("Returning cached class ({0}) for {1}", className, resourceID); //NOXLATE
+ System.Diagnostics.Trace.TraceInformation($"Returning cached class ({className}) for {resourceID}"); //NOXLATE
#endif
if (cls != null)
@@ -1608,9 +1570,9 @@
return null;
}
- internal int CachedFeatureSources { get { return m_featureSchemaCache.Count; } }
+ internal int CachedFeatureSources => m_featureSchemaCache.Count;
- internal int CachedClassDefinitions { get { return m_classDefinitionCache.Count; } }
+ internal int CachedClassDefinitions => m_classDefinitionCache.Count;
/// <summary>
/// Resets the feature source schema cache.
@@ -1628,10 +1590,7 @@
/// <param name="schema">The schema name</param>
/// <param name="filter">The filter to apply to the </param>
/// <returns>A FeatureSetReader with the aggregated values</returns>
- public virtual IReader AggregateQueryFeatureSource(string resourceID, string schema, string filter)
- {
- return AggregateQueryFeatureSource(resourceID, schema, filter, (string[])null);
- }
+ public virtual IReader AggregateQueryFeatureSource(string resourceID, string schema, string filter) => AggregateQueryFeatureSource(resourceID, schema, filter, (string[])null);
/// <summary>
/// Performs an aggregate query on columns in the datasource
@@ -1660,10 +1619,7 @@
/// <param name="schema">The schema.</param>
/// <param name="geometry">The geometry.</param>
/// <returns></returns>
- public virtual OSGeo.MapGuide.ObjectModels.Common.IEnvelope GetSpatialExtent(string resourceID, string schema, string geometry)
- {
- return GetSpatialExtent(resourceID, schema, geometry, null, false);
- }
+ public virtual ObjCommon.IEnvelope GetSpatialExtent(string resourceID, string schema, string geometry) => GetSpatialExtent(resourceID, schema, geometry, null, false);
/// <summary>
/// Gets the spatial extent.
@@ -1673,10 +1629,7 @@
/// <param name="geometry">The geometry.</param>
/// <param name="filter">The filter.</param>
/// <returns></returns>
- public virtual OSGeo.MapGuide.ObjectModels.Common.IEnvelope GetSpatialExtent(string resourceID, string schema, string geometry, string filter)
- {
- return GetSpatialExtent(resourceID, schema, geometry, filter, false);
- }
+ public virtual ObjCommon.IEnvelope GetSpatialExtent(string resourceID, string schema, string geometry, string filter) => GetSpatialExtent(resourceID, schema, geometry, filter, false);
/// <summary>
/// Gets the spatial extent.
@@ -1686,10 +1639,7 @@
/// <param name="geometry">The geometry.</param>
/// <param name="allowFallbackToContextInformation">if set to <c>true</c> [allow fallback to context information].</param>
/// <returns></returns>
- public virtual OSGeo.MapGuide.ObjectModels.Common.IEnvelope GetSpatialExtent(string resourceID, string schema, string geometry, bool allowFallbackToContextInformation)
- {
- return GetSpatialExtent(resourceID, schema, geometry, null, allowFallbackToContextInformation);
- }
+ public virtual ObjCommon.IEnvelope GetSpatialExtent(string resourceID, string schema, string geometry, bool allowFallbackToContextInformation) => GetSpatialExtent(resourceID, schema, geometry, null, allowFallbackToContextInformation);
/// <summary>
/// Gets the spatial extent.
@@ -1701,14 +1651,14 @@
/// <param name="allowFallbackToContextInformation">if set to <c>true</c> [allow fallback to context information].</param>
/// <exception cref="T:OSGeo.MapGuide.MaestroAPI.Exceptions.NullExtentException">Thrown if the geometric extent is null</exception>
/// <returns></returns>
- protected virtual OSGeo.MapGuide.ObjectModels.Common.IEnvelope GetSpatialExtent(string resourceID, string schema, string geometry, string filter, bool allowFallbackToContextInformation)
+ protected virtual ObjCommon.IEnvelope GetSpatialExtent(string resourceID, string schema, string geometry, string filter, bool allowFallbackToContextInformation)
{
Check.ArgumentNotEmpty(schema, nameof(schema));
Check.ArgumentNotEmpty(geometry, nameof(geometry));
try
{
- System.Collections.Specialized.NameValueCollection fun = new System.Collections.Specialized.NameValueCollection();
- fun.Add("EXTENT", "SpatialExtents(\"" + geometry + "\")"); //NOXLATE
+ var fun = new NameValueCollection();
+ fun.Add("EXTENT", $"SpatialExtents(\"{geometry}\")"); //NOXLATE
using (IReader fsr = AggregateQueryFeatureSource(resourceID, schema, filter, fun))
{
try
@@ -1726,7 +1676,7 @@
else
{
var env = geom.EnvelopeInternal;
- return OSGeo.MapGuide.ObjectModels.ObjectFactory.CreateEnvelope(
+ return ObjectFactory.CreateEnvelope(
env.MinX,
env.MinY,
env.MaxX,
@@ -1747,10 +1697,10 @@
if (allowFallbackToContextInformation)
try
{
- ObjCommon.FdoSpatialContextList lst = this.GetSpatialContextInfo(resourceID, false);
+ FdoSpatialContextList lst = this.GetSpatialContextInfo(resourceID, false);
if (lst.SpatialContext != null && lst.SpatialContext.Count >= 1)
{
- return OSGeo.MapGuide.ObjectModels.ObjectFactory.CreateEnvelope(
+ return ObjectFactory.CreateEnvelope(
double.Parse(lst.SpatialContext[0].Extent.LowerLeftCoordinate.X, System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture),
double.Parse(lst.SpatialContext[0].Extent.LowerLeftCoordinate.Y, System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture),
double.Parse(lst.SpatialContext[0].Extent.UpperRightCoordinate.X, System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture),
@@ -1772,7 +1722,7 @@
/// <param name="providerName">Name of the provider.</param>
/// <param name="partialConnString">The partial conn string.</param>
/// <returns></returns>
- public abstract OSGeo.MapGuide.ObjectModels.Common.DataStoreList EnumerateDataStores(string providerName, string partialConnString);
+ public abstract DataStoreList EnumerateDataStores(string providerName, string partialConnString);
/// <summary>
/// Gets the schemas.
@@ -1813,10 +1763,7 @@
/// <param name="className">The feature class name</param>
/// <param name="filter">The FDO filter string that determines what features will be returned</param>
/// <returns>A <see cref="T:OSGeo.MapGuide.MaestroAPI.Feature.IFeatureReader"/> containing the results of the query</returns>
- public IFeatureReader QueryFeatureSource(string resourceID, string className, string filter)
- {
- return QueryFeatureSource(resourceID, className, filter, null);
- }
+ public IFeatureReader QueryFeatureSource(string resourceID, string className, string filter) => QueryFeatureSource(resourceID, className, filter, null);
/// <summary>
/// Executes a feature query on the specified feature source
@@ -1824,10 +1771,7 @@
/// <param name="resourceID">The Feature Source ID</param>
/// <param name="className">The feature class name</param>
/// <returns>A <see cref="T:OSGeo.MapGuide.MaestroAPI.Feature.IFeatureReader"/> containing the results of the query</returns>
- public IFeatureReader QueryFeatureSource(string resourceID, string className)
- {
- return QueryFeatureSource(resourceID, className, null, null);
- }
+ public IFeatureReader QueryFeatureSource(string resourceID, string className) => QueryFeatureSource(resourceID, className, null, null);
/// <summary>
/// Executes a feature query on the specified feature source
@@ -1837,10 +1781,7 @@
/// <param name="filter">The FDO filter string that determines what features will be returned</param>
/// <param name="propertyNames">A list of properties that are to be returned in the query result</param>
/// <returns>A <see cref="T:OSGeo.MapGuide.MaestroAPI.Feature.IFeatureReader"/> containing the results of the query</returns>
- public IFeatureReader QueryFeatureSource(string resourceID, string className, string filter, string[] propertyNames)
- {
- return QueryFeatureSource(resourceID, className, filter, propertyNames, null);
- }
+ public IFeatureReader QueryFeatureSource(string resourceID, string className, string filter, string[] propertyNames) => QueryFeatureSource(resourceID, className, filter, propertyNames, null);
/// <summary>
/// Executes a feature query on the specified feature source
@@ -1879,16 +1820,13 @@
/// <summary>
/// Gets the highest version the API is currently tested againts
/// </summary>
- virtual public Version MaxTestedVersion
- {
- get { return SiteVersions.GetVersion(KnownSiteVersions.MapGuideOS2_1); }
- }
+ public virtual Version MaxTestedVersion => SiteVersions.GetVersion(KnownSiteVersions.MapGuideOS2_1);
/// <summary>
/// Gets the site version.
/// </summary>
/// <value>The site version.</value>
- abstract public Version SiteVersion { get; }
+ public abstract Version SiteVersion { get; }
/// <summary>
/// Gets the custom property names.
@@ -1971,10 +1909,7 @@
/// Gets the MPU calculator
/// </summary>
/// <returns></returns>
- public virtual IMpuCalculator GetCalculator()
- {
- return new DefaultCalculator(this);
- }
+ public virtual IMpuCalculator GetCalculator() => new DefaultCalculator(this);
/// <summary>
/// Creates the map group.
@@ -1982,11 +1917,7 @@
/// <param name="parent">The parent runtime map. The runtime map must have been created or opened from this same service instance</param>
/// <param name="name">The name.</param>
/// <returns></returns>
- public virtual RuntimeMapGroup CreateMapGroup(RuntimeMap parent, string name)
- {
- //TODO: Review when we split implementations
- return new RuntimeMapGroup(parent, name);
- }
+ public virtual RuntimeMapGroup CreateMapGroup(RuntimeMap parent, string name) => new RuntimeMapGroup(parent, name); //TODO: Review when we decide to split the implementations
/// <summary>
/// Creates a new runtime map group
@@ -1994,11 +1925,7 @@
/// <param name="parent">The map.</param>
/// <param name="group">The group.</param>
/// <returns></returns>
- public virtual RuntimeMapGroup CreateMapGroup(RuntimeMap parent, IBaseMapGroup group)
- {
- //TODO: Review when we split implementations
- return new RuntimeMapGroup(parent, group);
- }
+ public virtual RuntimeMapGroup CreateMapGroup(RuntimeMap parent, IBaseMapGroup group) => new RuntimeMapGroup(parent, group); //TODO: Review when we decide to split the implementations
/// <summary>
/// Creates a new runtime map group
@@ -2006,11 +1933,7 @@
/// <param name="parent">The parent runtime map. The runtime map must have been created or opened from this same service instance</param>
/// <param name="group">The group.</param>
/// <returns></returns>
- public virtual RuntimeMapGroup CreateMapGroup(RuntimeMap parent, IMapLayerGroup group)
- {
- //TODO: Review when we split implementations
- return new RuntimeMapGroup(parent, group);
- }
+ public virtual RuntimeMapGroup CreateMapGroup(RuntimeMap parent, IMapLayerGroup group) => new RuntimeMapGroup(parent, group); //TODO: Review when we decide to split the implementations
/// <summary>
/// Creates a new runtime map layer from the specified Layer Definition
@@ -2018,11 +1941,7 @@
/// <param name="parent">The parent runtime map. The runtime map must have been created or opened from this same service instance</param>
/// <param name="ldf">The layer definition</param>
/// <returns></returns>
- public virtual RuntimeMapLayer CreateMapLayer(RuntimeMap parent, ILayerDefinition ldf)
- {
- //TODO: Review when we decide to split the implementations
- return CreateMapLayer(parent, ldf, true);
- }
+ public virtual RuntimeMapLayer CreateMapLayer(RuntimeMap parent, ILayerDefinition ldf) => CreateMapLayer(parent, ldf, true); //TODO: Review when we decide to split the implementations
/// <summary>
/// Creates a new runtime map layer from the specified Layer Definition
@@ -2031,11 +1950,7 @@
/// <param name="ldf">The layer definition</param>
/// <param name="suppressErrors"></param>
/// <returns></returns>
- public virtual RuntimeMapLayer CreateMapLayer(RuntimeMap parent, ILayerDefinition ldf, bool suppressErrors)
- {
- //TODO: Review when we decide to split the implementations
- return new RuntimeMapLayer(parent, ldf, suppressErrors);
- }
+ public virtual RuntimeMapLayer CreateMapLayer(RuntimeMap parent, ILayerDefinition ldf, bool suppressErrors) => new RuntimeMapLayer(parent, ldf, suppressErrors); //TODO: Review when we decide to split the implementations
/// <summary>
/// Creates a new runtime map layer from the specified <see cref="T:OSGeo.MapGuide.ObjectModels.MapDefinition.IBaseMapLayer"/> instance
@@ -2043,10 +1958,7 @@
/// <param name="parent">The parent runtime map. The runtime map must have been created or opened from this same service instance</param>
/// <param name="source">The map definition layer</param>
/// <returns></returns>
- public RuntimeMapLayer CreateMapLayer(RuntimeMap parent, IBaseMapLayer source)
- {
- return CreateMapLayer(parent, source, true);
- }
+ public RuntimeMapLayer CreateMapLayer(RuntimeMap parent, IBaseMapLayer source) => CreateMapLayer(parent, source, true);
/// <summary>
/// Creates a new runtime map layer from the specified <see cref="T:OSGeo.MapGuide.ObjectModels.MapDefinition.IBaseMapLayer"/> instance
@@ -2078,10 +1990,7 @@
/// <param name="parent">The parent runtime map. The runtime map must have been created or opened from this same service instance</param>
/// <param name="source">The map definition layer</param>
/// <returns></returns>
- public RuntimeMapLayer CreateMapLayer(RuntimeMap parent, IMapLayer source)
- {
- return CreateMapLayer(parent, source);
- }
+ public RuntimeMapLayer CreateMapLayer(RuntimeMap parent, IMapLayer source) => CreateMapLayer(parent, source);
/// <summary>
/// Creates a new runtime map layer from the specified <see cref="T:OSGeo.MapGuide.ObjectModels.MapDefinition.IBaseMapLayer"/> instance
@@ -2121,10 +2030,7 @@
/// <param name="runtimeMapResourceId"></param>
/// <param name="baseMapDefinitionId"></param>
/// <returns></returns>
- public RuntimeMap CreateMap(string runtimeMapResourceId, string baseMapDefinitionId)
- {
- return CreateMap(runtimeMapResourceId, baseMapDefinitionId, true);
- }
+ public RuntimeMap CreateMap(string runtimeMapResourceId, string baseMapDefinitionId) => CreateMap(runtimeMapResourceId, baseMapDefinitionId, true);
/// <summary>
/// Creates a new runtime map instance from an existing map definition. Meters per unit
@@ -2156,10 +2062,7 @@
/// <param name="baseMapDefinitionId"></param>
/// <param name="metersPerUnit"></param>
/// <returns></returns>
- public virtual RuntimeMap CreateMap(string runtimeMapResourceId, string baseMapDefinitionId, double metersPerUnit)
- {
- return CreateMap(runtimeMapResourceId, baseMapDefinitionId, metersPerUnit, true);
- }
+ public virtual RuntimeMap CreateMap(string runtimeMapResourceId, string baseMapDefinitionId, double metersPerUnit) => CreateMap(runtimeMapResourceId, baseMapDefinitionId, metersPerUnit, true);
/// <summary>
/// Creates a new runtime map instance from an existing map definition
@@ -2181,10 +2084,7 @@
/// </summary>
/// <param name="mdf"></param>
/// <returns></returns>
- public RuntimeMap CreateMap(IMapDefinition mdf)
- {
- return CreateMap(mdf, true);
- }
+ public RuntimeMap CreateMap(IMapDefinition mdf) => CreateMap(mdf, true);
/// <summary>
/// Creates a new runtime map instance from an existing map definition. The runtime map resource id is calculated from the
@@ -2206,10 +2106,7 @@
/// <param name="mdf">The map definition.</param>
/// <param name="metersPerUnit">The meters per unit.</param>
/// <returns></returns>
- public RuntimeMap CreateMap(IMapDefinition mdf, double metersPerUnit)
- {
- return CreateMap(mdf, metersPerUnit, true);
- }
+ public RuntimeMap CreateMap(IMapDefinition mdf, double metersPerUnit) => CreateMap(mdf, metersPerUnit, true);
/// <summary>
/// Creates a new runtime map instance from an existing map definition. The runtime map resource id is calculated from the
@@ -2239,10 +2136,7 @@
/// <param name="runtimeMapResourceId"></param>
/// <param name="mdf"></param>
/// <returns></returns>
- public RuntimeMap CreateMap(string runtimeMapResourceId, IMapDefinition mdf)
- {
- return CreateMap(runtimeMapResourceId, mdf, true);
- }
+ public RuntimeMap CreateMap(string runtimeMapResourceId, IMapDefinition mdf) => CreateMap(runtimeMapResourceId, mdf, true);
/// <summary>
/// Creates a new runtime map instance from an existing map definition. Meters per unit
@@ -2273,10 +2167,7 @@
/// <param name="mdf"></param>
/// <param name="metersPerUnit"></param>
/// <returns></returns>
- public virtual RuntimeMap CreateMap(string runtimeMapResourceId, IMapDefinition mdf, double metersPerUnit)
- {
- return CreateMap(runtimeMapResourceId, mdf, metersPerUnit, true);
- }
+ public virtual RuntimeMap CreateMap(string runtimeMapResourceId, IMapDefinition mdf, double metersPerUnit) => CreateMap(runtimeMapResourceId, mdf, metersPerUnit, true);
/// <summary>
/// Creates a new runtime map instance from an existing map definition
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Comparison/DiffEngine.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Comparison/DiffEngine.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Comparison/DiffEngine.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -61,9 +61,9 @@
private int _startIndex;
private int _length;
- public int StartIndex { get { return _startIndex; } }
+ public int StartIndex => _startIndex;
- public int EndIndex { get { return ((_startIndex + _length) - 1); } }
+ public int EndIndex => ((_startIndex + _length) - 1);
public int Length
{
@@ -226,22 +226,22 @@
/// <summary>
/// The destination index
/// </summary>
- public int DestIndex { get { return _destIndex; } }
+ public int DestIndex => _destIndex;
/// <summary>
/// The source index
/// </summary>
- public int SourceIndex { get { return _sourceIndex; } }
+ public int SourceIndex => _sourceIndex;
/// <summary>
/// Gets the length of this span
/// </summary>
- public int Length { get { return _length; } }
+ public int Length => _length;
/// <summary>
/// Gets the status of this span
/// </summary>
- public DiffResultSpanStatus Status { get { return _status; } }
+ public DiffResultSpanStatus Status => _status;
/// <summary>
/// Initializes this instance
@@ -291,14 +291,7 @@
/// Returns a string that represents the current object
/// </summary>
/// <returns></returns>
- public override string ToString()
- {
- return string.Format("{0} (Dest: {1},Source: {2}) {3}", //NOXLATE
- _status.ToString(),
- _destIndex.ToString(),
- _sourceIndex.ToString(),
- _length.ToString());
- }
+ public override string ToString() => $"{_status} (Dest: {_destIndex},Source: {_sourceIndex}) {_length}";
#region IComparable Members
@@ -307,10 +300,7 @@
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
- public int CompareTo(object obj)
- {
- return _destIndex.CompareTo(((DiffResultSpan)obj)._destIndex);
- }
+ public int CompareTo(object obj) => _destIndex.CompareTo(((DiffResultSpan)obj)._destIndex);
#endregion IComparable Members
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Conversion/IResourceConverter.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Conversion/IResourceConverter.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Conversion/IResourceConverter.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -76,7 +76,7 @@
//wayside in the process, and any new bits flubbed with default values as part of deserialization
var resVer = resource.GetResourceTypeDescriptor().Version;
- var dstVer = string.Format("{0}.{1}.{2}", targetVersion.Major, targetVersion.Minor, targetVersion.Build); //NOXLATE
+ var dstVer = $"{targetVersion.Major}.{targetVersion.Minor}.{targetVersion.Build}"; //NOXLATE
var dstXsd = resource.ValidatingSchema.Replace(resVer, dstVer);
using (var sr = ObjectFactory.Serialize(resource))
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ApplicationDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ApplicationDefinitionValidator.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ApplicationDefinitionValidator.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -202,9 +202,6 @@
/// Gets the resource type and version this validator supports
/// </summary>
/// <value></value>
- public ResourceTypeDescriptor SupportedResourceAndVersion
- {
- get { return new ResourceTypeDescriptor(ResourceTypes.ApplicationDefinition.ToString(), "1.0.0"); }
- }
+ public ResourceTypeDescriptor SupportedResourceAndVersion => new ResourceTypeDescriptor(ResourceTypes.ApplicationDefinition.ToString(), "1.0.0");
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/DrawingSourceValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/DrawingSourceValidator.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/DrawingSourceValidator.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -79,9 +79,6 @@
/// Gets the resource type and version this validator supports
/// </summary>
/// <value></value>
- public ResourceTypeDescriptor SupportedResourceAndVersion
- {
- get { return new ResourceTypeDescriptor(ResourceTypes.DrawingSource.ToString(), _version); } //NOXLATE
- }
+ public ResourceTypeDescriptor SupportedResourceAndVersion => new ResourceTypeDescriptor(ResourceTypes.DrawingSource.ToString(), _version);
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/FeatureSourceValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/FeatureSourceValidator.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/FeatureSourceValidator.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -228,9 +228,6 @@
/// Gets the resource type and version this validator supports
/// </summary>
/// <value></value>
- public ResourceTypeDescriptor SupportedResourceAndVersion
- {
- get { return new ResourceTypeDescriptor(ResourceTypes.FeatureSource.ToString(), _version); } //NOXLATE
- }
+ public ResourceTypeDescriptor SupportedResourceAndVersion => new ResourceTypeDescriptor(ResourceTypes.FeatureSource.ToString(), _version);
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/LayerDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/LayerDefinitionValidator.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/LayerDefinitionValidator.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -40,9 +40,6 @@
/// Gets the supported resource and version.
/// </summary>
/// <value>The supported resource and version.</value>
- public override ResourceTypeDescriptor SupportedResourceAndVersion
- {
- get { return new ResourceTypeDescriptor(ResourceTypes.LayerDefinition.ToString(), _version); }
- }
+ public override ResourceTypeDescriptor SupportedResourceAndVersion => new ResourceTypeDescriptor(ResourceTypes.LayerDefinition.ToString(), _version);
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/LoadProcedureValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/LoadProcedureValidator.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/LoadProcedureValidator.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -40,9 +40,6 @@
/// Gets the resource type and version this validator supports
/// </summary>
/// <value></value>
- public override ResourceTypeDescriptor SupportedResourceAndVersion
- {
- get { return new ResourceTypeDescriptor(ResourceTypes.LoadProcedure.ToString(), _version); }
- }
+ public override ResourceTypeDescriptor SupportedResourceAndVersion => new ResourceTypeDescriptor(ResourceTypes.LoadProcedure.ToString(), _version);
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/MapDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/MapDefinitionValidator.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/MapDefinitionValidator.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -40,9 +40,6 @@
/// Gets the resource type and version this validator supports
/// </summary>
/// <value></value>
- public override ResourceTypeDescriptor SupportedResourceAndVersion
- {
- get { return new ResourceTypeDescriptor(ResourceTypes.MapDefinition.ToString(), _version); }
- }
+ public override ResourceTypeDescriptor SupportedResourceAndVersion => new ResourceTypeDescriptor(ResourceTypes.MapDefinition.ToString(), _version);
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/PrintLayoutValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/PrintLayoutValidator.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/PrintLayoutValidator.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -38,10 +38,7 @@
/// Gets the resource type and version this validator supports
/// </summary>
/// <value></value>
- public ResourceTypeDescriptor SupportedResourceAndVersion
- {
- get { return ResourceTypeDescriptor.PrintLayout; }
- }
+ public ResourceTypeDescriptor SupportedResourceAndVersion => ResourceTypeDescriptor.PrintLayout;
/// <summary>
/// Validats the specified resources for common issues associated with this
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ResourceValidationContext.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ResourceValidationContext.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ResourceValidationContext.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -67,10 +67,7 @@
_spatialContexts = new Dictionary<string, FdoSpatialContextList>();
}
- internal IServerConnection Connection
- {
- get { return _conn; }
- }
+ internal IServerConnection Connection => _conn;
/// <summary>
/// Clears all cached items and validated resources
@@ -161,13 +158,8 @@
/// Marks the specified resource id as being validated.
/// </summary>
/// <param name="resourceId">The resource id.</param>
- public void MarkValidated(string resourceId)
- {
- _validated[resourceId] = resourceId;
+ public void MarkValidated(string resourceId) => _validated[resourceId] = resourceId;
- //Trace.TraceInformation("Validated: " + resourceId); //NOXLATE
- }
-
/// <summary>
/// Gets whether the specified resource exists
/// </summary>
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/SymbolDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/SymbolDefinitionValidator.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/SymbolDefinitionValidator.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -40,9 +40,6 @@
/// Gets the resource type and version this validator supports
/// </summary>
/// <value></value>
- public override ResourceTypeDescriptor SupportedResourceAndVersion
- {
- get { return new ResourceTypeDescriptor(ResourceTypes.SymbolDefinition.ToString(), _version); } //NOXLATE
- }
+ public override ResourceTypeDescriptor SupportedResourceAndVersion => new ResourceTypeDescriptor(ResourceTypes.SymbolDefinition.ToString(), _version);
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/SymbolLibraryValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/SymbolLibraryValidator.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/SymbolLibraryValidator.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -38,10 +38,7 @@
/// Gets the resource type and version this validator supports
/// </summary>
/// <value></value>
- public ResourceTypeDescriptor SupportedResourceAndVersion
- {
- get { return ResourceTypeDescriptor.SymbolLibrary; }
- }
+ public ResourceTypeDescriptor SupportedResourceAndVersion => ResourceTypeDescriptor.SymbolLibrary;
/// <summary>
/// Validats the specified resources for common issues associated with this
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ValidationResultSet.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ValidationResultSet.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ValidationResultSet.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -22,6 +22,7 @@
using OSGeo.MapGuide.ObjectModels;
using System;
+using System.Linq;
using System.Collections.Generic;
namespace OSGeo.MapGuide.MaestroAPI.Resource.Validation
@@ -73,10 +74,7 @@
/// Gets the resource IDs
/// </summary>
/// <value>The resource IDs.</value>
- public string[] ResourceIDs
- {
- get { return new List<string>(_issues.Keys).ToArray(); }
- }
+ public string[] ResourceIDs => _issues.Keys.ToArray();
/// <summary>
/// Gets the issues for resource.
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/WebLayoutValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/WebLayoutValidator.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/WebLayoutValidator.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -40,9 +40,6 @@
/// Gets the resource type and version this validator supports
/// </summary>
/// <value></value>
- public override ResourceTypeDescriptor SupportedResourceAndVersion
- {
- get { return new ResourceTypeDescriptor(ResourceTypes.WebLayout.ToString(), _version); } //NOXLATE
- }
+ public override ResourceTypeDescriptor SupportedResourceAndVersion => new ResourceTypeDescriptor(ResourceTypes.WebLayout.ToString(), _version);
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/ClassDefinition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/ClassDefinition.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/ClassDefinition.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -74,10 +74,7 @@
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public PropertyDefinition this[int index]
- {
- get { return _properties[index]; }
- }
+ public PropertyDefinition this[int index] => _properties[index];
/// <summary>
/// Gets the ordinal of the specified property name
@@ -120,26 +117,17 @@
/// <summary>
/// Gets the identity properties
/// </summary>
- public ReadOnlyCollection<DataPropertyDefinition> IdentityProperties
- {
- get { return _identity.AsReadOnly(); }
- }
+ public ReadOnlyCollection<DataPropertyDefinition> IdentityProperties => _identity.AsReadOnly();
/// <summary>
/// Removes the assigned identity properties
/// </summary>
- public void ClearIdentityProperties()
- {
- _identity.Clear();
- }
+ public void ClearIdentityProperties() => _identity.Clear();
/// <summary>
/// Gets the properties
/// </summary>
- public ReadOnlyCollection<PropertyDefinition> Properties
- {
- get { return _properties.AsReadOnly(); }
- }
+ public ReadOnlyCollection<PropertyDefinition> Properties => _properties.AsReadOnly();
/// <summary>
/// Adds the specified data property, with an option to include it as an identity property
@@ -173,10 +161,7 @@
/// </summary>
/// <param name="prop"></param>
/// <returns></returns>
- public int IndexOfProperty(PropertyDefinition prop)
- {
- return _properties.IndexOf(prop);
- }
+ public int IndexOfProperty(PropertyDefinition prop) => _properties.IndexOf(prop);
/// <summary>
/// Removes the property definition of the specified name. If it is a data property
@@ -259,7 +244,7 @@
/// <summary>
/// Gets the qualified name of this class. The qualified name takes the form [Schema Name]:[Class Name]
/// </summary>
- public string QualifiedName { get { return this.Parent != null ? this.Parent.Name + ":" + this.Name : this.Name; } } //NOXLATE
+ public string QualifiedName => this.Parent != null ? this.Parent.Name + ":" + this.Name : this.Name;
/// <summary>
/// Writes the current element's content
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/DataPropertyDefinition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/DataPropertyDefinition.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/DataPropertyDefinition.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -94,10 +94,7 @@
/// <summary>
/// Gets the type of Property Definition
/// </summary>
- public override PropertyDefinitionType Type
- {
- get { return PropertyDefinitionType.Data; }
- }
+ public override PropertyDefinitionType Type => PropertyDefinitionType.Data;
private static string GetXmlType(DataPropertyType dataPropertyType)
{
@@ -316,9 +313,6 @@
/// <summary>
/// Gets the expression data type
/// </summary>
- public override ExpressionDataType ExpressionType
- {
- get { return GetExpressionType(this.DataType); }
- }
+ public override ExpressionDataType ExpressionType => GetExpressionType(this.DataType);
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/FeatureSchema.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/FeatureSchema.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/FeatureSchema.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -57,10 +57,7 @@
/// <summary>
/// Gets the class definitions
/// </summary>
- public ReadOnlyCollection<ClassDefinition> Classes
- {
- get { return _classes.AsReadOnly(); }
- }
+ public ReadOnlyCollection<ClassDefinition> Classes => _classes.AsReadOnly();
/// <summary>
/// Adds the specified class definition
@@ -107,30 +104,21 @@
/// </summary>
/// <param name="cls"></param>
/// <returns></returns>
- public int IndexOf(ClassDefinition cls)
- {
- return _classes.IndexOf(cls);
- }
+ public int IndexOf(ClassDefinition cls) => _classes.IndexOf(cls);
/// <summary>
/// Gets the class definition at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public ClassDefinition this[int index]
- {
- get { return GetItem(index); }
- }
+ public ClassDefinition this[int index] => GetItem(index);
/// <summary>
/// Gets the class definition at the specified index
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
- public ClassDefinition GetItem(int index)
- {
- return _classes[index];
- }
+ public ClassDefinition GetItem(int index) => _classes[index];
/// <summary>
/// Writes the current element's content
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/GeometricPropertyDefinition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/GeometricPropertyDefinition.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/GeometricPropertyDefinition.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -278,10 +278,7 @@
/// <summary>
/// Gets the type of property definition
/// </summary>
- public override PropertyDefinitionType Type
- {
- get { return PropertyDefinitionType.Geometry; }
- }
+ public override PropertyDefinitionType Type => PropertyDefinitionType.Geometry;
/// <summary>
/// Writes the current element's content
@@ -498,9 +495,6 @@
/// <summary>
/// Gets the expression data type
/// </summary>
- public override OSGeo.MapGuide.ObjectModels.Common.ExpressionDataType ExpressionType
- {
- get { return OSGeo.MapGuide.ObjectModels.Common.ExpressionDataType.Geometry; }
- }
+ public override ObjectModels.Common.ExpressionDataType ExpressionType => ObjectModels.Common.ExpressionDataType.Geometry;
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/RasterPropertyDefinition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/RasterPropertyDefinition.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/RasterPropertyDefinition.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -70,10 +70,7 @@
/// <summary>
/// Gets the type of property definition
/// </summary>
- public override PropertyDefinitionType Type
- {
- get { return PropertyDefinitionType.Raster; }
- }
+ public override PropertyDefinitionType Type => PropertyDefinitionType.Raster;
/// <summary>
/// Writes the current element's content
@@ -128,9 +125,6 @@
/// <summary>
/// Gets the expression data type
/// </summary>
- public override OSGeo.MapGuide.ObjectModels.Common.ExpressionDataType ExpressionType
- {
- get { return OSGeo.MapGuide.ObjectModels.Common.ExpressionDataType.Raster; }
- }
+ public override ObjectModels.Common.ExpressionDataType ExpressionType => ObjectModels.Common.ExpressionDataType.Raster;
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/ConfigurationDocument.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/ConfigurationDocument.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/ConfigurationDocument.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -56,30 +56,24 @@
/// <summary>
/// Gets the array of spatial contexts.
/// </summary>
- public IFdoSpatialContext[] SpatialContexts { get { return _spatialContexts.ToArray(); } }
+ public IFdoSpatialContext[] SpatialContexts => _spatialContexts.ToArray();
/// <summary>
/// Gets the array of logical schemas.
/// </summary>
- public FeatureSchema[] Schemas { get { return _schemas.ToArray(); } }
+ public FeatureSchema[] Schemas => _schemas.ToArray();
/// <summary>
/// Adds the spatial context.
/// </summary>
/// <param name="context">The context.</param>
- public void AddSpatialContext(IFdoSpatialContext context)
- {
- _spatialContexts.Add(context);
- }
+ public void AddSpatialContext(IFdoSpatialContext context) => _spatialContexts.Add(context);
/// <summary>
/// Removes the spatial context.
/// </summary>
/// <param name="context">The context.</param>
- public void RemoveSpatialContext(IFdoSpatialContext context)
- {
- _spatialContexts.Remove(context);
- }
+ public void RemoveSpatialContext(IFdoSpatialContext context) => _spatialContexts.Remove(context);
/// <summary>
/// Gets the spatial context by name
@@ -102,13 +96,11 @@
/// <returns></returns>
public string[] GetSpatialContextNames()
{
- List<string> names = new List<string>();
-
+ var names = new List<string>();
foreach (var ctx in _spatialContexts)
{
names.Add(ctx.Name);
}
-
return names.ToArray();
}
@@ -116,19 +108,13 @@
/// Adds the logical schema.
/// </summary>
/// <param name="schema">The schema.</param>
- public void AddSchema(FeatureSchema schema)
- {
- _schemas.Add(schema);
- }
+ public void AddSchema(FeatureSchema schema) => _schemas.Add(schema);
/// <summary>
/// Removes the logical schema.
/// </summary>
/// <param name="schema">The schema.</param>
- public void RemoveSchema(FeatureSchema schema)
- {
- _schemas.Remove(schema);
- }
+ public void RemoveSchema(FeatureSchema schema) => _schemas.Remove(schema);
/// <summary>
/// Gets the schema by name.
@@ -162,7 +148,7 @@
/// </summary>
/// <param name="doc"></param>
/// <param name="currentNode"></param>
- public virtual void WriteXml(System.Xml.XmlDocument doc, System.Xml.XmlNode currentNode)
+ public virtual void WriteXml(XmlDocument doc, XmlNode currentNode)
{
var dstore = doc.CreateElement("fdo", "DataStore", XmlNamespaces.FDO); //NOXLATE
dstore.SetAttribute("xmlns:xs", XmlNamespaces.XS); //NOXLATE
@@ -189,21 +175,21 @@
/// </summary>
/// <param name="doc"></param>
/// <param name="currentNode"></param>
- protected abstract void WriteSchemaMappings(System.Xml.XmlDocument doc, System.Xml.XmlNode currentNode);
+ protected abstract void WriteSchemaMappings(XmlDocument doc, XmlNode currentNode);
/// <summary>
/// Write this document's schema mappings from the given XML document
/// </summary>
/// <param name="node">The node.</param>
/// <param name="mgr">The namespace manager.</param>
- protected abstract void ReadSchemaMappings(System.Xml.XmlNode node, System.Xml.XmlNamespaceManager mgr);
+ protected abstract void ReadSchemaMappings(XmlNode node, XmlNamespaceManager mgr);
/// <summary>
/// Set the current element's content from the current XML node
/// </summary>
/// <param name="node"></param>
/// <param name="mgr"></param>
- public void ReadXml(System.Xml.XmlNode node, System.Xml.XmlNamespaceManager mgr)
+ public void ReadXml(XmlNode node, XmlNamespaceManager mgr)
{
if (!node.Name.Equals("fdo:DataStore")) //NOXLATE
throw new Exception(string.Format(Strings.ErrorBadDocumentExpectedElement, "fdo:DataStore")); //NOXLATE
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/GdalConfigurationDocument.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/GdalConfigurationDocument.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/GdalConfigurationDocument.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -54,10 +54,7 @@
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
- public bool RemoveLocation(GdalRasterLocationItem item)
- {
- return _items.Remove(item.Location);
- }
+ public bool RemoveLocation(GdalRasterLocationItem item) => _items.Remove(item.Location);
/// <summary>
/// Calculates the combined extent that encompasses all the raster images in this document.
@@ -92,14 +89,14 @@
/// <summary>
/// Gets an array of all the raster locations for this document
/// </summary>
- public GdalRasterLocationItem[] RasterLocations { get { return new List<GdalRasterLocationItem>(_items.Values).ToArray(); } }
+ public GdalRasterLocationItem[] RasterLocations => new List<GdalRasterLocationItem>(_items.Values).ToArray();
/// <summary>
/// Write this document's schema mappings to the given XML document
/// </summary>
/// <param name="doc"></param>
/// <param name="currentNode"></param>
- protected override void WriteSchemaMappings(System.Xml.XmlDocument doc, System.Xml.XmlNode currentNode)
+ protected override void WriteSchemaMappings(XmlDocument doc, XmlNode currentNode)
{
foreach (var schema in base._schemas)
{
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/GdalRasterItem.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/GdalRasterItem.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/GdalRasterItem.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -75,15 +75,12 @@
/// Removes the specified raster image reference
/// </summary>
/// <param name="item"></param>
- public void RemoveItem(GdalRasterItem item)
- {
- _items.Remove(item.FileName);
- }
+ public void RemoveItem(GdalRasterItem item) => _items.Remove(item.FileName);
/// <summary>
/// Gets all the raster image references in this location
/// </summary>
- public GdalRasterItem[] Items { get { return new List<GdalRasterItem>(_items.Values).ToArray(); } }
+ public GdalRasterItem[] Items => new List<GdalRasterItem>(_items.Values).ToArray();
/// <summary>
/// Writes the current element's content
@@ -131,10 +128,7 @@
/// Removes the specified raster image
/// </summary>
/// <param name="fileName"></param>
- public void RemoveItem(string fileName)
- {
- _items.Remove(fileName);
- }
+ public void RemoveItem(string fileName) => _items.Remove(fileName);
}
/// <summary>
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/RasterWmsItem.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/RasterWmsItem.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/RasterWmsItem.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -119,7 +119,7 @@
/// <summary>
/// Gets the array of WMS layer configuration elements
/// </summary>
- public WmsLayerDefinition[] Layers { get { return _layers.ToArray(); } }
+ public WmsLayerDefinition[] Layers => _layers.ToArray();
/// <summary>
/// Adds a WMS layer configuration element.
@@ -184,7 +184,7 @@
/// </summary>
/// <param name="doc"></param>
/// <param name="currentNode"></param>
- public void WriteXml(System.Xml.XmlDocument doc, System.Xml.XmlNode currentNode)
+ public void WriteXml(XmlDocument doc, XmlNode currentNode)
{
var rasterDef = doc.CreateElement("RasterDefinition"); //NOXLATE
var n = doc.CreateAttribute("name"); //NOXLATE
@@ -248,7 +248,7 @@
{
layer.WriteXml(doc, rasterDef);
}
- };
+ }
currentNode.AppendChild(rasterDef);
}
@@ -258,7 +258,7 @@
/// </summary>
/// <param name="node"></param>
/// <param name="mgr"></param>
- public void ReadXml(System.Xml.XmlNode node, System.Xml.XmlNamespaceManager mgr)
+ public void ReadXml(XmlNode node, XmlNamespaceManager mgr)
{
if (node.Name != "RasterDefinition") //NOXLATE
throw new Exception(string.Format(Strings.ErrorBadDocumentExpectedElement, "RasterDefinition"));
@@ -320,9 +320,6 @@
/// <summary>
/// Removes all WMS layer configuration elements
/// </summary>
- public void RemoveAllLayers()
- {
- _layers.Clear();
- }
+ public void RemoveAllLayers() =>_layers.Clear();
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/WmsConfigurationDocument.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/WmsConfigurationDocument.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/WmsConfigurationDocument.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -39,32 +39,26 @@
/// <summary>
/// Gets an array of the added override items
/// </summary>
- public RasterWmsItem[] RasterOverrides { get { return _rasterItems.ToArray(); } }
+ public RasterWmsItem[] RasterOverrides => _rasterItems.ToArray();
/// <summary>
/// Adds the specified override item
/// </summary>
/// <param name="item"></param>
- public void AddRasterItem(RasterWmsItem item)
- {
- _rasterItems.Add(item);
- }
+ public void AddRasterItem(RasterWmsItem item) => _rasterItems.Add(item);
/// <summary>
/// Removes the specified override item
/// </summary>
/// <param name="item"></param>
- public void RemoveRasterItem(RasterWmsItem item)
- {
- _rasterItems.Remove(item);
- }
+ public void RemoveRasterItem(RasterWmsItem item) => _rasterItems.Remove(item);
/// <summary>
/// Write this document's schema mappings to the given XML document
/// </summary>
/// <param name="doc"></param>
/// <param name="currentNode"></param>
- protected override void WriteSchemaMappings(System.Xml.XmlDocument doc, System.Xml.XmlNode currentNode)
+ protected override void WriteSchemaMappings(XmlDocument doc, XmlNode currentNode)
{
var map = doc.CreateElement("SchemaMapping"); //NOXLATE
map.SetAttribute("provider", "OSGeo.WMS.3.2"); //NOXLATE
@@ -278,7 +272,7 @@
//Try to find this raster property
foreach (var prop in cls.Properties)
{
- if (prop.Type == OSGeo.MapGuide.MaestroAPI.Schema.PropertyDefinitionType.Raster)
+ if (prop.Type == PropertyDefinitionType.Raster)
{
bFoundRaster = true;
break;
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Serialization/MgBinaryDeserializer.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Serialization/MgBinaryDeserializer.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Serialization/MgBinaryDeserializer.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -38,7 +38,7 @@
/// Gets the site version.
/// </summary>
/// <value>The site version.</value>
- public Version SiteVersion { get { return m_siteVersion; } }
+ public Version SiteVersion => m_siteVersion;
/// <summary>
/// Initializes a new instance of the <see cref="MgBinaryDeserializer"/> class.
@@ -199,10 +199,7 @@
/// Reads the bool.
/// </summary>
/// <returns></returns>
- public bool ReadBool()
- {
- return ReadByte() != 0;
- }
+ public bool ReadBool() => ReadByte() != 0;
/// <summary>
/// Reads the byte.
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Serialization/MgBinarySerializer.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Serialization/MgBinarySerializer.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Serialization/MgBinarySerializer.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -67,7 +67,7 @@
/// Gets the site version.
/// </summary>
/// <value>The site version.</value>
- public Version SiteVersion { get { return m_siteVersion; } }
+ public Version SiteVersion => m_siteVersion;
/// <summary>
/// Initializes a new instance of the <see cref="MgBinarySerializer"/> class.
@@ -372,9 +372,6 @@
/// Writes the raw.
/// </summary>
/// <param name="buf">The buf.</param>
- public void WriteRaw(byte[] buf)
- {
- m_stream.Write(buf, 0, buf.Length);
- }
+ public void WriteRaw(byte[] buf) => m_stream.Write(buf, 0, buf.Length);
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Tile/BatchSettings.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Tile/BatchSettings.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Tile/BatchSettings.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -383,22 +383,22 @@
/// <summary>
/// The connection to the server
/// </summary>
- public IServerConnection Connection { get { return m_connection; } }
+ public IServerConnection Connection => m_connection;
/// <summary>
/// The list of map configurations to proccess
/// </summary>
- public List<MapTilingConfiguration> Maps { get { return m_maps; } }
+ public List<MapTilingConfiguration> Maps => m_maps;
/// <summary>
/// The tile settings
/// </summary>
- public TileRunParameters Config { get { return m_tileSettings; } }
+ public TileRunParameters Config => m_tileSettings;
/// <summary>
/// Gets a flag indicating if the rendering process is cancelled
/// </summary>
- public bool Cancel { get { return m_cancel; } }
+ public bool Cancel => m_cancel;
}
/// <summary>
@@ -459,12 +459,12 @@
/// <summary>
/// Gets the list of groups
/// </summary>
- public string[] Groups { get { return m_groups; } }
+ public string[] Groups => m_groups;
/// <summary>
/// The map's scales may have been modified, this array is a map of the new values
/// </summary>
- public int[] ScaleIndexMap { get { return m_scaleindexmap; } }
+ public int[] ScaleIndexMap => m_scaleindexmap;
/// <summary>
/// Constructs a new map to be processed
@@ -770,17 +770,17 @@
/// <summary>
/// Gets the resourceId for the map
/// </summary>
- public string ResourceId { get { return m_tileSetResourceID; } }
+ public string ResourceId => m_tileSetResourceID;
/// <summary>
/// Gets the MapDefintion
/// </summary>
- public ITileSetAbstract TileSet { get { return m_tileset; } }
+ public ITileSetAbstract TileSet => m_tileset;
/// <summary>
/// Gets a reference to the parent tiling run collection
/// </summary>
- public TilingRunCollection Parent { get { return m_parent; } }
+ public TilingRunCollection Parent => m_parent;
}
/// <summary>
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Utility.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Utility.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Utility.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -25,11 +25,10 @@
using OSGeo.MapGuide.MaestroAPI.Schema;
using OSGeo.MapGuide.MaestroAPI.Services;
using OSGeo.MapGuide.ObjectModels;
-using OSGeo.MapGuide.ObjectModels.IO;
using OSGeo.MapGuide.ObjectModels.ApplicationDefinition;
using OSGeo.MapGuide.ObjectModels.Capabilities;
using OSGeo.MapGuide.ObjectModels.Capabilities.v1_0_0;
-using OSGeo.MapGuide.ObjectModels.DrawingSource;
+using OSGeo.MapGuide.ObjectModels.IO;
using OSGeo.MapGuide.ObjectModels.LayerDefinition;
using OSGeo.MapGuide.ObjectModels.MapDefinition;
using OSGeo.MapGuide.ObjectModels.SymbolDefinition;
@@ -53,15 +52,19 @@
/// </summary>
public static class Utility
{
- public static bool IsZero(this float val)
- {
- return Math.Abs(val) < float.Epsilon;
- }
+ /// <summary>
+ /// Returns true if this value is zero for all intents and purposes
+ /// </summary>
+ /// <param name="val"></param>
+ /// <returns></returns>
+ public static bool IsZero(this float val) => Math.Abs(val) < float.Epsilon;
- public static bool IsZero(this double val)
- {
- return Math.Abs(val) < double.Epsilon;
- }
+ /// <summary>
+ /// Returns true if this value is zero for all intents and purposes
+ /// </summary>
+ /// <param name="val"></param>
+ /// <returns></returns>
+ public static bool IsZero(this double val) => Math.Abs(val) < double.Epsilon;
/// <summary>
/// Creates the polygon WKT for the given bounding box
@@ -104,7 +107,7 @@
public static bool HasOriginalXml(Exception ex) => ex.Data[XML_EXCEPTION_KEY] != null;
//Americans NEVER obey nationalization when outputting decimal values, so the rest of the world always have to work around their bugs :(
- private static System.Globalization.CultureInfo m_enCI = new System.Globalization.CultureInfo("en-US"); //NOXLATE
+ private static CultureInfo m_enCI = new CultureInfo("en-US"); //NOXLATE
/// <summary>
/// Converts the specified name value collection into a connection string
@@ -163,18 +166,18 @@
{
if (color.Length == 8)
{
- int a = int.Parse(color.Substring(0, 2), System.Globalization.NumberStyles.HexNumber);
- int r = int.Parse(color.Substring(2, 2), System.Globalization.NumberStyles.HexNumber);
- int g = int.Parse(color.Substring(4, 2), System.Globalization.NumberStyles.HexNumber);
- int b = int.Parse(color.Substring(6, 2), System.Globalization.NumberStyles.HexNumber);
+ int a = int.Parse(color.Substring(0, 2), NumberStyles.HexNumber);
+ int r = int.Parse(color.Substring(2, 2), NumberStyles.HexNumber);
+ int g = int.Parse(color.Substring(4, 2), NumberStyles.HexNumber);
+ int b = int.Parse(color.Substring(6, 2), NumberStyles.HexNumber);
return Color.FromArgb(a, r, g, b);
}
else if (color.Length == 6)
{
- int r = int.Parse(color.Substring(0, 2), System.Globalization.NumberStyles.HexNumber);
- int g = int.Parse(color.Substring(2, 2), System.Globalization.NumberStyles.HexNumber);
- int b = int.Parse(color.Substring(4, 2), System.Globalization.NumberStyles.HexNumber);
+ int r = int.Parse(color.Substring(0, 2), NumberStyles.HexNumber);
+ int g = int.Parse(color.Substring(2, 2), NumberStyles.HexNumber);
+ int b = int.Parse(color.Substring(4, 2), NumberStyles.HexNumber);
return Color.FromArgb(r, g, b);
}
@@ -191,18 +194,18 @@
{
if (color.Length == 8)
{
- int r = int.Parse(color.Substring(0, 2), System.Globalization.NumberStyles.HexNumber);
- int g = int.Parse(color.Substring(2, 2), System.Globalization.NumberStyles.HexNumber);
- int b = int.Parse(color.Substring(4, 2), System.Globalization.NumberStyles.HexNumber);
- int a = int.Parse(color.Substring(6, 2), System.Globalization.NumberStyles.HexNumber);
+ int r = int.Parse(color.Substring(0, 2), NumberStyles.HexNumber);
+ int g = int.Parse(color.Substring(2, 2), NumberStyles.HexNumber);
+ int b = int.Parse(color.Substring(4, 2), NumberStyles.HexNumber);
+ int a = int.Parse(color.Substring(6, 2), NumberStyles.HexNumber);
return Color.FromArgb(a, r, g, b);
}
else if (color.Length == 6)
{
- int r = int.Parse(color.Substring(0, 2), System.Globalization.NumberStyles.HexNumber);
- int g = int.Parse(color.Substring(2, 2), System.Globalization.NumberStyles.HexNumber);
- int b = int.Parse(color.Substring(4, 2), System.Globalization.NumberStyles.HexNumber);
+ int r = int.Parse(color.Substring(0, 2), NumberStyles.HexNumber);
+ int g = int.Parse(color.Substring(2, 2), NumberStyles.HexNumber);
+ int b = int.Parse(color.Substring(4, 2), NumberStyles.HexNumber);
return Color.FromArgb(r, g, b);
}
@@ -219,18 +222,18 @@
{
if (color.Length == 8)
{
- int a = int.Parse(color.Substring(0, 2), System.Globalization.NumberStyles.HexNumber);
- int r = int.Parse(color.Substring(2, 2), System.Globalization.NumberStyles.HexNumber);
- int g = int.Parse(color.Substring(4, 2), System.Globalization.NumberStyles.HexNumber);
- int b = int.Parse(color.Substring(6, 2), System.Globalization.NumberStyles.HexNumber);
+ int a = int.Parse(color.Substring(0, 2), NumberStyles.HexNumber);
+ int r = int.Parse(color.Substring(2, 2), NumberStyles.HexNumber);
+ int g = int.Parse(color.Substring(4, 2), NumberStyles.HexNumber);
+ int b = int.Parse(color.Substring(6, 2), NumberStyles.HexNumber);
return Color.FromArgb(a, r, g, b);
}
else if (color.Length == 6)
{
- int r = int.Parse(color.Substring(0, 2), System.Globalization.NumberStyles.HexNumber);
- int g = int.Parse(color.Substring(2, 2), System.Globalization.NumberStyles.HexNumber);
- int b = int.Parse(color.Substring(4, 2), System.Globalization.NumberStyles.HexNumber);
+ int r = int.Parse(color.Substring(0, 2), NumberStyles.HexNumber);
+ int g = int.Parse(color.Substring(2, 2), NumberStyles.HexNumber);
+ int b = int.Parse(color.Substring(4, 2), NumberStyles.HexNumber);
return Color.FromArgb(r, g, b);
}
@@ -316,7 +319,7 @@
/// </summary>
/// <param name="source">The source stream</param>
/// <param name="target">The target stream</param>
- public static void CopyStream(System.IO.Stream source, System.IO.Stream target) => CopyStream(source, target, true);
+ public static void CopyStream(Stream source, Stream target) => CopyStream(source, target, true);
/// <summary>
/// Copies the content of a stream into another stream.
@@ -324,7 +327,7 @@
/// <param name="source">The source stream</param>
/// <param name="target">The target stream</param>
/// <param name="rewind">True if the source stream should be rewound before being copied</param>
- public static void CopyStream(System.IO.Stream source, System.IO.Stream target, bool rewind)
+ public static void CopyStream(Stream source, Stream target, bool rewind)
{
//int r;
byte[] buf = new byte[1024];
@@ -380,7 +383,7 @@
/// <param name="target">The target stream</param>
/// <param name="callback">An optional callback delegate, may be null.</param>
/// <param name="updateFrequence">The number of bytes to copy before calling the callback delegate, set to 0 to get every update</param>
- public static void CopyStream(System.IO.Stream source, System.IO.Stream target, StreamCopyProgressDelegate callback, long updateFrequence)
+ public static void CopyStream(Stream source, Stream target, StreamCopyProgressDelegate callback, long updateFrequence)
{
long length = -1;
if (source.CanSeek)
@@ -425,8 +428,8 @@
if (source == null)
return null;
- System.Xml.Serialization.XmlSerializer ser = new System.Xml.Serialization.XmlSerializer(source.GetType());
- System.IO.MemoryStream ms = new System.IO.MemoryStream();
+ var ser = new XmlSerializer(source.GetType());
+ var ms = new MemoryStream();
ser.Serialize(ms, source);
ms.Position = 0;
return ser.Deserialize(ms);
@@ -460,8 +463,8 @@
}
else if (pi.GetValue(source, null).GetType().IsArray)
{
- System.Array sourceArr = (System.Array)pi.GetValue(source, null);
- System.Array targetArr = (System.Array)Activator.CreateInstance(sourceArr.GetType(), new object[] { sourceArr.Length });
+ Array sourceArr = (Array)pi.GetValue(source, null);
+ Array targetArr = (Array)Activator.CreateInstance(sourceArr.GetType(), new object[] { sourceArr.Length });
for (int i = 0; i < targetArr.Length; i++)
targetArr.SetValue(DeepCopy(sourceArr.GetValue(i)), i);
pi.SetValue(target, targetArr, null);
@@ -508,8 +511,8 @@
}
else if (pi.GetValue(source, null).GetType().IsArray)
{
- System.Array sourceArr = (System.Array)pi.GetValue(source, null);
- System.Array targetArr = (System.Array)Activator.CreateInstance(sourceArr.GetType(), new object[] { sourceArr.Length });
+ Array sourceArr = (Array)pi.GetValue(source, null);
+ Array targetArr = (Array)Activator.CreateInstance(sourceArr.GetType(), new object[] { sourceArr.Length });
for (int i = 0; i < targetArr.Length; i++)
targetArr.SetValue(DeepCopy(sourceArr.GetValue(i)), i);
pi.SetValue(target, targetArr, null);
@@ -527,14 +530,15 @@
/// </summary>
/// <param name="s">The stream to exhaust</param>
/// <returns>The streams content as an array</returns>
- public static byte[] StreamAsArray(System.IO.Stream s)
+ public static byte[] StreamAsArray(Stream s)
{
- if (s as System.IO.MemoryStream != null)
- return ((System.IO.MemoryStream)s).ToArray();
+ var mes = s as MemoryStream;
+ if (mes != null)
+ return mes.ToArray();
if (!s.CanSeek)
{
- System.IO.MemoryStream ms = new System.IO.MemoryStream();
+ var ms = new MemoryStream();
byte[] buf = new byte[1024];
int c;
while ((c = s.Read(buf, 0, buf.Length)) > 0)
@@ -579,7 +583,7 @@
/// </summary>
/// <param name="ms">The stream to fix</param>
/// <returns>A stream with no Utf8 BOM</returns>
- public static System.IO.MemoryStream RemoveUTF8BOM(System.IO.MemoryStream ms)
+ public static MemoryStream RemoveUTF8BOM(MemoryStream ms)
{
//Skip UTF file header, since the MapGuide XmlParser is broken
ms.Position = 0;
@@ -588,8 +592,8 @@
if (utfheader[0] == 0xEF && utfheader[1] == 0xBB && utfheader[2] == 0xBF)
{
ms.Position = 3;
- System.IO.MemoryStream mxs = new System.IO.MemoryStream();
- Utility.CopyStream(ms, mxs, false);
+ var mxs = new MemoryStream();
+ CopyStream(ms, mxs, false);
mxs.Position = 0;
return mxs;
}
@@ -606,7 +610,7 @@
/// <summary>
/// Returns a type used to define a raster column in a feature reader
/// </summary>
- public static Type RasterType => typeof(System.Drawing.Bitmap);
+ public static Type RasterType => typeof(Bitmap);
/// <summary>
/// Returns the type used to define a geometry column in a feature reader
@@ -662,18 +666,18 @@
if (string.IsNullOrEmpty(input))
return input;
- System.Xml.XmlDocument doc1 = new System.Xml.XmlDocument();
+ var doc1 = new XmlDocument();
doc1.LoadXml(input);
- System.Xml.XmlDocument doc2 = new System.Xml.XmlDocument();
+ var doc2 = new XmlDocument();
- System.Xml.XmlNode root1 = doc1["FeatureInformation"]; //NOXLATE
+ XmlNode root1 = doc1["FeatureInformation"]; //NOXLATE
if (root1 == null)
root1 = doc1;
if (root1["FeatureSet"] != null) //NOXLATE
{
- System.Xml.XmlNode root2 = doc2.AppendChild(doc2.CreateElement("FeatureSet")); //NOXLATE
+ XmlNode root2 = doc2.AppendChild(doc2.CreateElement("FeatureSet")); //NOXLATE
root2.InnerXml = root1["FeatureSet"].InnerXml; //NOXLATE
}
@@ -777,7 +781,7 @@
outName = outName.Remove(0, 1);
//Check if the first character requires a meta-escape character replacement
- string prefix = c + "";
+ string prefix = c + string.Empty;
switch (c)
{
case ' ':
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/XmlValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/XmlValidator.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/XmlValidator.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -20,19 +20,18 @@
#endregion Disclaimer / License
+using OSGeo.MapGuide.MaestroAPI.Exceptions;
+using OSGeo.MapGuide.ObjectModels;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.IO;
+using System.Text;
+using System.Xml;
+using System.Xml.Schema;
+
namespace OSGeo.MapGuide.MaestroAPI
{
- using OSGeo.MapGuide.MaestroAPI.Exceptions;
- using OSGeo.MapGuide.MaestroAPI.Resource;
- using OSGeo.MapGuide.ObjectModels;
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.IO;
- using System.Text;
- using System.Xml;
- using System.Xml.Schema;
-
///<summary>
/// Class that makes XSD validation
///</summary>
@@ -44,25 +43,19 @@
/// <summary>
/// Gets the validation warnings.
/// </summary>
- public ReadOnlyCollection<string> ValidationWarnings
- {
- get { return this.warnings.AsReadOnly(); }
- }
+ public ReadOnlyCollection<string> ValidationWarnings => this.warnings.AsReadOnly();
/// <summary>
/// Gets the validation errors.
/// </summary>
- public ReadOnlyCollection<string> ValidationErrors
- {
- get { return this.errors.AsReadOnly(); }
- }
+ public ReadOnlyCollection<string> ValidationErrors => this.errors.AsReadOnly();
/// <summary>
/// Validates the specified XML.
/// </summary>
/// <param name="xml">The XML.</param>
/// <param name="xsds">The array of <see cref="T:System.Xml.Schema.XmlSchema"/> objects to validate against.</param>
- public void Validate(System.IO.Stream xml, XmlSchema[] xsds)
+ public void Validate(Stream xml, XmlSchema[] xsds)
{
this.warnings.Clear();
this.errors.Clear();
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpCreateRuntimeMap.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpCreateRuntimeMap.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpCreateRuntimeMap.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -83,10 +83,7 @@
set;
}
- public IServerConnection Parent
- {
- get { return _conn; }
- }
+ public IServerConnection Parent => _conn;
public IRuntimeMapInfo Execute()
{
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpDescribeRuntimeMap.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpDescribeRuntimeMap.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpDescribeRuntimeMap.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -76,10 +76,7 @@
set;
}
- public IServerConnection Parent
- {
- get { return _conn; }
- }
+ public IServerConnection Parent => _conn;
public IRuntimeMapInfo Execute()
{
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpGetFdoCacheInfo.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpGetFdoCacheInfo.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpGetFdoCacheInfo.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -33,11 +33,8 @@
_conn = conn;
}
- public IServerConnection Parent { get { return _conn; } }
+ public IServerConnection Parent => _conn;
- public FdoCacheInfo Execute()
- {
- return _conn.GetFdoCacheInfo();
- }
+ public FdoCacheInfo Execute() => _conn.GetFdoCacheInfo();
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpGetTileProviders.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpGetTileProviders.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpGetTileProviders.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -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 OSGeo.MapGuide.MaestroAPI.Commands;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace OSGeo.MapGuide.MaestroAPI.Http.Commands
{
@@ -38,14 +33,8 @@
}
- public ObjectModels.Common.TileProviderList Execute()
- {
- return _conn.GetTileProviders();
- }
+ public ObjectModels.Common.TileProviderList Execute() => _conn.GetTileProviders();
- public IServerConnection Parent
- {
- get { return _conn; }
- }
+ public IServerConnection Parent => _conn;
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpCapabilities.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpCapabilities.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpCapabilities.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -62,14 +62,8 @@
}
}
- public override bool SupportsResourcePreviews
- {
- get { return true; }
- }
+ public override bool SupportsResourcePreviews => true;
- public override bool IsMultithreaded
- {
- get { return false; }
- }
+ public override bool IsMultithreaded => false;
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpCoordinateSystemCatalog.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpCoordinateSystemCatalog.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpCoordinateSystemCatalog.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -38,9 +38,9 @@
m_req = req;
}
- internal HttpServerConnection Connection { get { return m_con; } }
+ internal HttpServerConnection Connection => m_con;
- internal RequestBuilder RequestBuilder { get { return m_req; } }
+ internal RequestBuilder RequestBuilder => m_req;
public override CoordinateSystemCategory[] Categories
{
@@ -51,7 +51,7 @@
string req = m_req.EnumerateCategories();
XmlDocument doc = new XmlDocument();
doc.Load(m_con.OpenRead(req));
- XmlNodeList lst = doc.SelectNodes("StringCollection/Item");
+ XmlNodeList lst = doc.SelectNodes("StringCollection/Item"); //NOXLATE
CoordinateSystemCategory[] data = new CoordinateSystemCategory[lst.Count];
for (int i = 0; i < lst.Count; i++)
data[i] = new HttpCoordinateSystemCategory(this, lst[i].InnerText);
@@ -105,9 +105,9 @@
return System.Text.Encoding.UTF8.GetString(m_con.DownloadData(req)).Trim('\0');
}
- public override bool IsLoaded { get { return m_categories != null; } }
+ public override bool IsLoaded => m_categories != null;
- public override CoordinateSystem.CoordinateSystemDefinitionBase[] EnumerateCoordinateSystems(string category)
+ public override CoordinateSystemDefinitionBase[] EnumerateCoordinateSystems(string category)
{
CoordinateSystemCategory cat = null;
foreach (CoordinateSystemCategory csc in this.Categories)
@@ -133,9 +133,6 @@
return data;
}
- public override CoordinateSystem.CoordinateSystemDefinitionBase CreateEmptyCoordinateSystem()
- {
- return new HttpCoordinateSystemDefinition();
- }
+ public override CoordinateSystemDefinitionBase CreateEmptyCoordinateSystem() => new HttpCoordinateSystemDefinition();
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -27,7 +27,6 @@
using OSGeo.MapGuide.MaestroAPI.Http;
using OSGeo.MapGuide.MaestroAPI.Http.Commands;
using OSGeo.MapGuide.MaestroAPI.Mapping;
-using OSGeo.MapGuide.MaestroAPI.Resource;
using OSGeo.MapGuide.MaestroAPI.Schema;
using OSGeo.MapGuide.MaestroAPI.SchemaOverrides;
using OSGeo.MapGuide.MaestroAPI.Services;
@@ -96,10 +95,7 @@
}
}
- public override string ProviderName
- {
- get { return "Maestro.Http"; }
- }
+ public override string ProviderName => "Maestro.Http"; //NOXLATE
/// <summary>
/// Gets whether this connection was initialised with an Anonymous login. If it was, it will return true.
@@ -116,12 +112,12 @@
}
}
- public const string PARAM_URL = "Url";
- public const string PARAM_SESSION = "SessionId";
- public const string PARAM_LOCALE = "Locale";
- public const string PARAM_UNTESTED = "AllowUntestedVersion";
- public const string PARAM_USERNAME = "Username";
- public const string PARAM_PASSWORD = "Password";
+ public const string PARAM_URL = "Url"; //NOXLATE
+ public const string PARAM_SESSION = "SessionId"; //NOXLATE
+ public const string PARAM_LOCALE = "Locale"; //NOXLATE
+ public const string PARAM_UNTESTED = "AllowUntestedVersion"; //NOXLATE
+ public const string PARAM_USERNAME = "Username"; //NOXLATE
+ public const string PARAM_PASSWORD = "Password"; //NOXLATE
private ICredentials _cred;
@@ -239,10 +235,7 @@
InitConnection(hosturl, username, password, locale, allowUntestedVersion);
}
- public override string SessionID
- {
- get { return m_reqBuilder.SessionID; }
- }
+ public override string SessionID => m_reqBuilder.SessionID;
public override ResourceList GetRepositoryResources(string startingpoint, string type, int depth, bool computeChildren)
{
@@ -305,10 +298,10 @@
{
try
{
- using (System.IO.MemoryStream ms = new System.IO.MemoryStream())
+ using (MemoryStream ms = new MemoryStream())
{
Utility.CopyStream(wex.Response.GetResponseStream(), ms);
- result = System.Text.Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length);
+ result = Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length);
}
if (result.ToLower().IndexOf("<body>") > 0)
@@ -360,10 +353,10 @@
try
{
string result = "";
- using (System.IO.MemoryStream ms = new System.IO.MemoryStream())
+ using (MemoryStream ms = new MemoryStream())
{
Utility.CopyStream(wex.Response.GetResponseStream(), ms);
- result = System.Text.Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length);
+ result = Encoding.UTF8.GetString(ms.ToArray(), 0, (int)ms.Length);
}
if (result.ToLower().IndexOf("<body>") > 0)
@@ -392,7 +385,7 @@
return string.Empty;
}
- public override System.IO.Stream GetResourceData(string resourceID, string dataname)
+ public override Stream GetResourceData(string resourceID, string dataname)
{
string req = m_reqBuilder.GetResourceData(resourceID, dataname);
return this.OpenRead(req);
@@ -686,8 +679,8 @@
{
//The request may execeed the url limit of the server, especially when using GeomFromText('...')
ResourceIdentifier.Validate(resourceID, ResourceTypes.FeatureSource);
- System.IO.MemoryStream ms = new System.IO.MemoryStream();
- System.Net.WebRequest req = m_reqBuilder.SelectFeatures(aggregate, resourceID, schema, query, columns, computedProperties, ms);
+ MemoryStream ms = new MemoryStream();
+ WebRequest req = m_reqBuilder.SelectFeatures(aggregate, resourceID, schema, query, columns, computedProperties, ms);
req.Timeout = 200 * 1000;
ms.Position = 0;
#if DEBUG
@@ -921,7 +914,7 @@
/*if (m_wc.Credentials as NetworkCredential != null)
s += " [" + (m_wc.Credentials as NetworkCredential).UserName + "]"; */
- return s + " (v" + this.SiteVersion.ToString() + ")";
+ return $"{s} (v{this.SiteVersion.ToString() })";
}
}
@@ -1082,7 +1075,7 @@
#endif
}
- public override System.IO.Stream RenderRuntimeMap(Mapping.RuntimeMap map, 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 = map.ResourceID;
ResourceIdentifier.Validate(resourceId, ResourceTypes.Map);
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/RequestBuilder.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/RequestBuilder.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/RequestBuilder.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -228,16 +228,13 @@
return sb.ToString(0, sb.Length - 1);
}
- private string EncodeParameters(NameValueCollection param)
- {
- return EncodeParameters(param, true);
- }
+ private string EncodeParameters(NameValueCollection param) => EncodeParameters(param, true);
static string UrlEncode(string name)
{
if (name == null)
return string.Empty;
- return System.Uri.EscapeDataString(name);
+ return Uri.EscapeDataString(name);
}
private string EncodeParameter(string name, string value)
@@ -1131,7 +1128,7 @@
return m_hosturi + "?" + EncodeParameters(param);
}
- public string HostURI { get { return m_hosturi; } }
+ public string HostURI => m_hosturi;
public string GetIdentityProperties(string resourceID, string schema, string classname)
{
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/XmlDataReader.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/XmlDataReader.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/XmlDataReader.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -38,59 +38,26 @@
{
}
- public override ReaderType ReaderType
- {
- get { return ReaderType.Data; }
- }
+ public override ReaderType ReaderType => ReaderType.Data;
- protected override string DefinitionRootElement
- {
- get { return "PropertyDefinitions"; }
- }
+ protected override string DefinitionRootElement => "PropertyDefinitions"; //NOXLATE
- protected override string DefinitionChildElement
- {
- get { return "PropertyDefinition"; }
- }
+ protected override string DefinitionChildElement => "PropertyDefinition"; //NOXLATE
- protected override string DefinitionChildNameElement
- {
- get { return "Name"; }
- }
+ protected override string DefinitionChildNameElement => "Name"; //NOXLATE
- protected override string DefinitionChildTypeElement
- {
- get { return "Type"; }
- }
+ protected override string DefinitionChildTypeElement => "Type"; //NOXLATE
- protected override string ValuesRootElement
- {
- get { return "Properties"; }
- }
+ protected override string ValuesRootElement => "Properties"; //NOXLATE
- protected override string ValuesRowElement
- {
- get { return "PropertyCollection"; }
- }
+ protected override string ValuesRowElement => "PropertyCollection"; //NOXLATE
- protected override string ValuesRowPropertyElement
- {
- get { return "Property"; }
- }
+ protected override string ValuesRowPropertyElement => "Property"; //NOXLATE
- protected override string ValuesRowPropertyNameElement
- {
- get { return "Name"; }
- }
+ protected override string ValuesRowPropertyNameElement => "Name"; //NOXLATE
- protected override string ValuesRowPropertyValueElement
- {
- get { return "Value"; }
- }
+ protected override string ValuesRowPropertyValueElement => "Value"; //NOXLATE
- protected override string ResponseRootElement
- {
- get { return "PropertySet"; }
- }
+ protected override string ResponseRootElement => "PropertySet"; //NOXLATE
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/XmlFeatureReader.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/XmlFeatureReader.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/XmlFeatureReader.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -42,26 +42,17 @@
: base(resp)
{ }
- public IFeatureReader GetFeatureObject(string name)
- {
- return ((IFeature)this.Current).GetFeatureObject(name);
- }
+ public IFeatureReader GetFeatureObject(string name) => ((IFeature)this.Current).GetFeatureObject(name);
- public IFeatureReader GetFeatureObject(int index)
- {
- return ((IFeature)this.Current).GetFeatureObject(index);
- }
+ public IFeatureReader GetFeatureObject(int index) => ((IFeature)this.Current).GetFeatureObject(index);
- public override ReaderType ReaderType
- {
- get { return ReaderType.Feature; }
- }
+ public override ReaderType ReaderType => ReaderType.Feature;
protected override void InitProperties()
{
//SelectAggregate responses start with PropertySet
_reader.Read();
- if (_reader.Name != "xml")
+ if (_reader.Name != "xml") //NOXLATE
throw new Exception("Bad document. Expected xml prolog"); //LOCALIZEME
_reader.Read();
if (_reader.Name != this.ResponseRootElement)
@@ -186,15 +177,9 @@
}
}
- protected override string ResponseRootElement
- {
- get { return "FeatureSet"; }
- }
+ protected override string ResponseRootElement => "FeatureSet"; //NOXLATE
- protected override string DefinitionRootElement
- {
- get { return "xs:schema"; }
- }
+ protected override string DefinitionRootElement => "xs:schema"; //NOXLATE
protected override string DefinitionChildElement
{
@@ -211,32 +196,17 @@
get { throw new NotImplementedException(); }
}
- protected override string ValuesRootElement
- {
- get { return "Features"; }
- }
+ protected override string ValuesRootElement => "Features"; //NOXLATE
- protected override string ValuesRowElement
- {
- get { return "Feature"; }
- }
+ protected override string ValuesRowElement => "Feature"; //NOXLATE
- protected override string ValuesRowPropertyElement
- {
- get { return "Property"; }
- }
+ protected override string ValuesRowPropertyElement => "Property"; //NOXLATE
- protected override string ValuesRowPropertyNameElement
- {
- get { return "Name"; }
- }
+ protected override string ValuesRowPropertyNameElement => "Name"; //NOXLATE
- protected override string ValuesRowPropertyValueElement
- {
- get { return "Value"; }
- }
+ protected override string ValuesRowPropertyValueElement => "Value"; //NOXLATE
- public OSGeo.MapGuide.MaestroAPI.Schema.ClassDefinition ClassDefinition
+ public ClassDefinition ClassDefinition
{
get;
private set;
@@ -272,24 +242,15 @@
_reader = reader;
}
- public IFeature Current
- {
- get { return (IFeature)_reader.Current; }
- }
+ public IFeature Current => (IFeature)_reader.Current;
public void Dispose()
{
}
- object System.Collections.IEnumerator.Current
- {
- get { return this.Current; }
- }
+ object System.Collections.IEnumerator.Current => this.Current;
- public bool MoveNext()
- {
- return _reader.ReadNext();
- }
+ public bool MoveNext() => _reader.ReadNext();
public void Reset()
{
@@ -297,14 +258,8 @@
}
}
- public IEnumerator<IFeature> GetEnumerator()
- {
- return new Enumerator(this);
- }
+ public IEnumerator<IFeature> GetEnumerator() => new Enumerator(this);
- System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
- {
- return new Enumerator(this);
- }
+ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() => new Enumerator(this);
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalCapabilities.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalCapabilities.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalCapabilities.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -56,60 +56,22 @@
}
}
- public override bool IsSupportedResourceType(string resourceType)
- {
- return resourceType != ResourceTypes.ApplicationDefinition.ToString() &&
- resourceType != ResourceTypes.WebLayout.ToString();
- }
+ public override bool IsSupportedResourceType(string resourceType)
+ => resourceType != ResourceTypes.ApplicationDefinition.ToString() &&
+ resourceType != ResourceTypes.WebLayout.ToString();
- public override bool SupportsResourcePreviews
- {
- get { return true; }
- }
+ public override bool SupportsResourcePreviews => true;
- public override bool IsMultithreaded
- {
- get { return false; }
- }
+ public override bool IsMultithreaded => false;
- public override bool SupportsResourceReferences
- {
- get
- {
- return false;
- }
- }
+ public override bool SupportsResourceReferences => false;
- public override bool SupportsResourceSecurity
- {
- get
- {
- return false;
- }
- }
+ public override bool SupportsResourceSecurity => false;
- public override bool SupportsWfsPublishing
- {
- get
- {
- return false;
- }
- }
+ public override bool SupportsWfsPublishing => false;
- public override bool SupportsWmsPublishing
- {
- get
- {
- return false;
- }
- }
+ public override bool SupportsWmsPublishing => false;
- public override bool SupportsResourceHeaders
- {
- get
- {
- return false;
- }
- }
+ public override bool SupportsResourceHeaders => false;
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -56,10 +56,7 @@
{
public event EventHandler SessionIDChanged; //Not used
- public static LocalConnection Create(NameValueCollection initParams)
- {
- return new LocalConnection(initParams);
- }
+ public static LocalConnection Create(NameValueCollection initParams) => new LocalConnection(initParams);
private MgdServiceFactory _fact;
@@ -74,7 +71,7 @@
sw.Start();
MgdPlatform.Initialize(_configFile);
sw.Stop();
- Trace.TraceInformation("MapGuide Platform initialized in {0}ms", sw.ElapsedMilliseconds);
+ Trace.TraceInformation($"MapGuide Platform initialized in {sw.ElapsedMilliseconds}ms");
}
public override ICommand CreateCommand(int cmdType)
@@ -100,12 +97,9 @@
return base.CreateCommand(cmdType);
}
- public const string PROVIDER_NAME = "Maestro.Local";
+ public const string PROVIDER_NAME = "Maestro.Local"; //NOXLATE
- public override string ProviderName
- {
- get { return PROVIDER_NAME; }
- }
+ public override string ProviderName => PROVIDER_NAME;
public override NameValueCollection CloneParameters
{
@@ -125,7 +119,7 @@
protected override IServerConnection GetInterface() => this;
private string _configFile;
- private const string PARAM_CONFIG = "ConfigFile";
+ private const string PARAM_CONFIG = "ConfigFile"; //NOXLATE
private MgdResourceService _resSvc;
private MgdFeatureService _featSvc;
@@ -215,10 +209,7 @@
return _tileSvc;
}
- public override IServerConnection Clone()
- {
- return LocalConnection.Create(this.CloneParameters);
- }
+ public override IServerConnection Clone() => LocalConnection.Create(this.CloneParameters);
private void LogMethodCall(string method, bool success, params string[] values)
{
@@ -561,23 +552,16 @@
var fes = GetFeatureService();
if (schema != null && schema.IndexOf(":") > 0)
schema = schema.Split(':')[0];
- System.IO.MemoryStream ms = new System.IO.MemoryStream(System.Text.Encoding.UTF8.GetBytes(fes.DescribeSchemaAsXml(new MgResourceIdentifier(resourceID), schema)));
+ MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(fes.DescribeSchemaAsXml(new MgResourceIdentifier(resourceID), schema)));
LogMethodCall("MgFeatureService::DescribeSchemaAsXml", true, resourceID, schema);
return new FeatureSourceDescription(ms).Schemas[0];
}
- public override IReader AggregateQueryFeatureSource(string resourceID, string schema, string filter, string[] columns)
- {
- return AggregateQueryFeatureSourceCore(resourceID, schema, filter, columns, null);
- }
+ public override IReader AggregateQueryFeatureSource(string resourceID, string schema, string filter, string[] columns) => AggregateQueryFeatureSourceCore(resourceID, schema, filter, columns, null);
+ public override IReader AggregateQueryFeatureSource(string resourceID, string schema, string filter, System.Collections.Specialized.NameValueCollection aggregateFunctions) => AggregateQueryFeatureSourceCore(resourceID, schema, filter, null, aggregateFunctions);
- public override IReader AggregateQueryFeatureSource(string resourceID, string schema, string filter, System.Collections.Specialized.NameValueCollection aggregateFunctions)
- {
- return AggregateQueryFeatureSourceCore(resourceID, schema, filter, null, aggregateFunctions);
- }
-
private IReader AggregateQueryFeatureSourceCore(string resourceID, string schema, string query, string[] columns, System.Collections.Specialized.NameValueCollection computedProperties)
{
var fes = GetFeatureService();
@@ -646,15 +630,9 @@
return klass;
}
- public override Version SiteVersion
- {
- get { return typeof(MgdMap).Assembly.GetName().Version; }
- }
+ public override Version SiteVersion => typeof(MgdMap).Assembly.GetName().Version;
- public override string[] GetCustomPropertyNames()
- {
- return new string[0];
- }
+ public override string[] GetCustomPropertyNames() => new string[0];
public override Type GetCustomPropertyType(string name)
{
@@ -759,7 +737,7 @@
return base.DeserializeObject<ResourceDataList>(new MgReadOnlyStream(fetch));
}
- public System.IO.Stream GetTile(string mapdefinition, string baselayergroup, int col, int row, int scaleindex, string format)
+ public Stream GetTile(string mapdefinition, string baselayergroup, int col, int row, int scaleindex, string format)
{
var ts = GetTileService();
GetByteReaderMethod fetch = () =>
@@ -771,7 +749,7 @@
return new MgReadOnlyStream(fetch);
}
- public System.IO.Stream DescribeDrawing(string resourceID)
+ public Stream DescribeDrawing(string resourceID)
{
var dwSvc = GetDrawingService();
GetByteReaderMethod fetch = () =>
@@ -828,7 +806,7 @@
return res;
}
- public System.IO.Stream GetDrawing(string resourceID)
+ public Stream GetDrawing(string resourceID)
{
var dwSvc = GetDrawingService();
GetByteReaderMethod fetch = () =>
@@ -840,7 +818,7 @@
return new MgReadOnlyStream(fetch);
}
- public System.IO.Stream GetLayer(string resourceID, string sectionName, string layerName)
+ public Stream GetLayer(string resourceID, string sectionName, string layerName)
{
var dwSvc = GetDrawingService();
GetByteReaderMethod fetch = () =>
@@ -852,7 +830,7 @@
return new MgReadOnlyStream(fetch);
}
- public System.IO.Stream GetSection(string resourceID, string sectionName)
+ public Stream GetSection(string resourceID, string sectionName)
{
var dwSvc = GetDrawingService();
GetByteReaderMethod fetch = () =>
@@ -864,7 +842,7 @@
return new MgReadOnlyStream(fetch);
}
- public System.IO.Stream GetSectionResource(string resourceID, string resourceName)
+ public Stream GetSectionResource(string resourceID, string resourceName)
{
var dwSvc = GetDrawingService();
GetByteReaderMethod fetch = () =>
@@ -876,15 +854,9 @@
return new MgReadOnlyStream(fetch);
}
- public IFeatureService FeatureService
- {
- get { return this; }
- }
+ public IFeatureService FeatureService => this;
- public IResourceService ResourceService
- {
- get { return this; }
- }
+ public IResourceService ResourceService => this;
private IConnectionCapabilities _caps;
@@ -932,7 +904,7 @@
private ICoordinateSystemCatalog m_coordsys = null;
- public OSGeo.MapGuide.MaestroAPI.CoordinateSystem.ICoordinateSystemCatalog CoordinateSystemCatalog
+ public ICoordinateSystemCatalog CoordinateSystemCatalog
{
get
{
@@ -942,19 +914,13 @@
}
}
- public string DisplayName
- {
- get { return "Local MgDesktop (" + _configFile + ")"; }
- }
+ public string DisplayName => $"Local MgDesktop ({_configFile})"; //NOXLATE
public void RestartSession()
{
}
- public bool RestartSession(bool throwException)
- {
- return true;
- }
+ public bool RestartSession(bool throwException) => true;
internal void InsertFeatures(MgResourceIdentifier fsId, string className, MgPropertyCollection props)
{
@@ -1050,12 +1016,12 @@
}
}
- public override Mapping.RuntimeMap OpenMap(string runtimeMapResourceId)
+ public override RuntimeMap OpenMap(string runtimeMapResourceId)
{
throw new NotSupportedException();
}
- public override Mapping.RuntimeMap CreateMap(string runtimeMapResourceId, IMapDefinition mdf, double metersPerUnit, bool suppressErrors)
+ public override RuntimeMap CreateMap(string runtimeMapResourceId, IMapDefinition mdf, double metersPerUnit, bool suppressErrors)
{
var mdfId = new MgResourceIdentifier(mdf.ResourceID);
var implMap = new MgdMap(mdfId);
@@ -1065,7 +1031,7 @@
return map;
}
- public override Mapping.RuntimeMapGroup CreateMapGroup(Mapping.RuntimeMap parent, IBaseMapGroup group)
+ public override RuntimeMapGroup CreateMapGroup(RuntimeMap parent, IBaseMapGroup group)
{
var impl = parent as LocalRuntimeMap;
if (impl == null)
@@ -1081,7 +1047,7 @@
return new LocalRuntimeMapGroup(impl, rtGroup);
}
- public override Mapping.RuntimeMapGroup CreateMapGroup(Mapping.RuntimeMap parent, IMapLayerGroup group)
+ public override RuntimeMapGroup CreateMapGroup(RuntimeMap parent, IMapLayerGroup group)
{
var impl = parent as LocalRuntimeMap;
if (impl == null)
@@ -1108,7 +1074,7 @@
return new LocalRuntimeMapGroup(impl, rtGroup);
}
- public override Mapping.RuntimeMapGroup CreateMapGroup(Mapping.RuntimeMap parent, string name)
+ public override RuntimeMapGroup CreateMapGroup(RuntimeMap parent, string name)
{
var impl = parent as LocalRuntimeMap;
if (impl == null)
@@ -1118,7 +1084,7 @@
return new LocalRuntimeMapGroup(impl, group);
}
- public override Mapping.RuntimeMapLayer CreateMapLayer(Mapping.RuntimeMap parent, ILayerDefinition ldf, bool suppressErrors)
+ public override RuntimeMapLayer CreateMapLayer(RuntimeMap parent, ILayerDefinition ldf, bool suppressErrors)
{
var impl = parent as LocalRuntimeMap;
if (impl == null)
@@ -1129,12 +1095,9 @@
return new LocalRuntimeMapLayer(impl, layer, this, suppressErrors);
}
- public Stream RenderDynamicOverlay(Mapping.RuntimeMap map, Mapping.MapSelection selection, string format)
- {
- return RenderDynamicOverlay(map, selection, format, true);
- }
+ public Stream RenderDynamicOverlay(RuntimeMap map, MapSelection selection, string format) => RenderDynamicOverlay(map, selection, format, true);
- private static MgdSelection Convert(MgdMap map, Mapping.MapSelection sel)
+ private static MgdSelection Convert(MgdMap map, MapSelection sel)
{
if (sel == null)
return null;
@@ -1177,26 +1140,11 @@
return new MgReadOnlyStream(fetch);
}
- public Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi)
- {
- return this.RenderRuntimeMap(map, x, y, scale, width, height, dpi, "PNG", false);
- }
+ public Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi) => this.RenderRuntimeMap(map, x, y, scale, width, height, dpi, "PNG", false);
+ public Stream RenderRuntimeMap(RuntimeMap map, double x1, double y1, double x2, double y2, int width, int height, int dpi) => this.RenderRuntimeMap(map, x1, y1, x2, y2, width, height, dpi, "PNG", false);
+ public Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi, string format) => this.RenderRuntimeMap(map, x, y, scale, width, height, dpi, format, false);
+ public Stream RenderRuntimeMap(RuntimeMap map, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format) => this.RenderRuntimeMap(map, x1, y1, x2, y2, width, height, dpi, format, false);
- public Stream RenderRuntimeMap(RuntimeMap map, double x1, double y1, double x2, double y2, int width, int height, int dpi)
- {
- return this.RenderRuntimeMap(map, x1, y1, x2, y2, width, height, dpi, "PNG", false);
- }
-
- public Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi, string format)
- {
- return this.RenderRuntimeMap(map, x, y, scale, width, height, dpi, format, false);
- }
-
- public Stream RenderRuntimeMap(RuntimeMap map, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format)
- {
- return this.RenderRuntimeMap(map, x1, y1, x2, y2, width, height, dpi, format, false);
- }
-
public Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi, string format, bool clip)
{
var impl = map as LocalRuntimeMap;
@@ -1266,10 +1214,7 @@
return new MgReadOnlyStream(fetch);
}
- public System.Drawing.Image GetLegendImage(double scale, string layerdefinition, int themeIndex, int type)
- {
- return GetLegendImage(scale, layerdefinition, themeIndex, type, 16, 16, "PNG");
- }
+ public System.Drawing.Image GetLegendImage(double scale, string layerdefinition, int themeIndex, int type) => GetLegendImage(scale, layerdefinition, themeIndex, type, 16, 16, "PNG");
public System.Drawing.Image GetLegendImage(double scale, string layerdefinition, int themeIndex, int type, int width, int height, string format)
{
@@ -1312,7 +1257,7 @@
op = MgFeatureSpatialOperations.EnvelopeIntersects;
break;
default:
- throw new ArgumentException("Unknown or unsupported selection variant: " + selectionVariant);
+ throw new ArgumentException($"Unknown or unsupported selection variant: {selectionVariant}"); //FIXME
}
if (extraOptions != null)
@@ -1403,9 +1348,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/LocalNativeConnection.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -53,7 +53,7 @@
IDrawingService,
ISiteService
{
- private OSGeo.MapGuide.MgSiteConnection m_con;
+ private MgSiteConnection m_con;
private string m_locale;
private string m_sessionId;
@@ -62,11 +62,11 @@
/// </summary>
protected string m_webconfig;
- public const string PARAM_SESSION = "SessionId";
- public const string PARAM_CONFIG = "ConfigFile";
- public const string PARAM_USERNAME = "Username";
- public const string PARAM_PASSWORD = "Password";
- public const string PARAM_LOCALE = "Locale";
+ public const string PARAM_SESSION = "SessionId"; //NOXLATE
+ public const string PARAM_CONFIG = "ConfigFile"; //NOXLATE
+ public const string PARAM_USERNAME = "Username"; //NOXLATE
+ public const string PARAM_PASSWORD = "Password"; //NOXLATE
+ public const string PARAM_LOCALE = "Locale"; //NOXLATE
private LocalNativeConnection()
: base()
@@ -87,11 +87,11 @@
else
{
if (initParams[PARAM_CONFIG] == null)
- throw new ArgumentException("Missing connection parameter: " + PARAM_CONFIG);
+ throw new ArgumentException("Missing connection parameter: " + PARAM_CONFIG); //LOCALIZEME
if (initParams[PARAM_PASSWORD] == null)
- throw new ArgumentException("Missing connection parameter: " + PARAM_PASSWORD);
+ throw new ArgumentException("Missing connection parameter: " + PARAM_PASSWORD); //LOCALIZEME
if (initParams[PARAM_USERNAME] == null)
- throw new ArgumentException("Missing connection parameter: " + PARAM_USERNAME);
+ throw new ArgumentException("Missing connection parameter: " + PARAM_USERNAME); //LOCALIZEME
string configFile = initParams[PARAM_CONFIG];
string password = initParams[PARAM_PASSWORD];
@@ -104,10 +104,7 @@
}
}
- public override string ProviderName
- {
- get { return "Maestro.LocalNative"; }
- }
+ public override string ProviderName => "Maestro.LocalNative"; //NOXLATE
public override NameValueCollection CloneParameters
{
@@ -137,7 +134,7 @@
m_password = password;
m_locale = locale;
- OSGeo.MapGuide.MapGuideApi.MgInitializeWebTier(configFile);
+ MapGuideApi.MgInitializeWebTier(configFile);
//Throws an exception if it fails
RestartSession();
}
@@ -156,13 +153,7 @@
}
}
- public override string SessionID
- {
- get
- {
- return m_sessionId;
- }
- }
+ public override string SessionID => m_sessionId;
private void LogMethodCall(string method, bool success, params object[] values)
{
@@ -362,7 +353,7 @@
MgFeatureService fes = this.Connection.CreateService(MgServiceType.FeatureService) as MgFeatureService;
if (schema != null && schema.IndexOf(":") > 0)
schema = schema.Split(':')[0];
- System.IO.MemoryStream ms = new System.IO.MemoryStream(System.Text.Encoding.UTF8.GetBytes(fes.DescribeSchemaAsXml(new MgResourceIdentifier(resourceID), schema)));
+ MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(fes.DescribeSchemaAsXml(new MgResourceIdentifier(resourceID), schema)));
LogMethodCall("MgFeatureService::DescribeSchemaAsXml", true, resourceID, schema);
@@ -467,7 +458,7 @@
{
get
{
- if (this.SiteVersion < OSGeo.MapGuide.MaestroAPI.SiteVersions.GetVersion(OSGeo.MapGuide.MaestroAPI.KnownSiteVersions.MapGuideOS1_2))
+ if (this.SiteVersion < SiteVersions.GetVersion(KnownSiteVersions.MapGuideOS1_2))
return null;
else
{
@@ -478,13 +469,7 @@
}
}
- public string DisplayName
- {
- get
- {
- return this.Connection.GetSite().GetCurrentSiteAddress();
- }
- }
+ public string DisplayName => this.Connection.GetSite().GetCurrentSiteAddress();
public override ResourceReferenceList EnumerateResourceReferences(string resourceid)
{
@@ -676,10 +661,7 @@
return new MgReadOnlyStream(fetch);
}
- public override bool IsSessionExpiredException(Exception ex)
- {
- return ex != null && ex.GetType() == typeof(OSGeo.MapGuide.MgSessionExpiredException) || ex.GetType() == typeof(OSGeo.MapGuide.MgSessionNotFoundException);
- }
+ public override bool IsSessionExpiredException(Exception ex) => ex != null && ex.GetType() == typeof(MgSessionExpiredException) || ex.GetType() == typeof(MgSessionNotFoundException);
/// <summary>
/// Returns the spatial info for a given featuresource
@@ -900,10 +882,7 @@
return values;
}
- public bool SupportsResourcePreviews
- {
- get { return false; }
- }
+ public bool SupportsResourcePreviews => false;
public override void Dispose()
{
@@ -927,7 +906,7 @@
/// <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)
{
MgMappingService ms = this.Connection.CreateService(MgServiceType.MappingService) as MgMappingService;
GetByteReaderMethod fetch = () =>
@@ -939,17 +918,11 @@
return new Bitmap(new MgReadOnlyStream(fetch));
}
- public OSGeo.MapGuide.MaestroAPI.Services.IFeatureService FeatureService
- {
- get { return this; }
- }
+ public IFeatureService FeatureService => this;
- public OSGeo.MapGuide.MaestroAPI.Services.IResourceService ResourceService
- {
- get { return this; }
- }
+ public IResourceService ResourceService => this;
- public override OSGeo.MapGuide.MaestroAPI.Commands.ICommand CreateCommand(int cmdType)
+ public override ICommand CreateCommand(int cmdType)
{
CommandType ct = (CommandType)cmdType;
switch (ct)
@@ -989,7 +962,7 @@
}
}
- public OSGeo.MapGuide.MaestroAPI.Services.IService GetService(int serviceType)
+ public IService GetService(int serviceType)
{
ServiceType st = (ServiceType)serviceType;
switch (st)
@@ -1010,10 +983,7 @@
throw new UnsupportedServiceTypeException(st);
}
- protected override IServerConnection GetInterface()
- {
- return this;
- }
+ protected override IServerConnection GetInterface() => this;
private const int MAX_INPUT_STREAM_SIZE_MB = 30;
@@ -1079,10 +1049,7 @@
callback(fi.Length, 0, fi.Length);
}
- public override string[] GetCustomPropertyNames()
- {
- return new string[] { };
- }
+ public override string[] GetCustomPropertyNames() => new string[] { };
public override Type GetCustomPropertyType(string name)
{
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeCoordinateSystemCatalog.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeCoordinateSystemCatalog.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeCoordinateSystemCatalog.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -29,7 +29,7 @@
{
private CoordinateSystemCategory[] m_categories;
private string m_coordLib = null;
- internal OSGeo.MapGuide.MgCoordinateSystemFactory m_cf;
+ internal MgCoordinateSystemFactory m_cf;
public LocalNativeCoordinateSystemCatalog()
{
@@ -54,31 +54,12 @@
}
}
- public override string ConvertCoordinateSystemCodeToWkt(string coordcode)
- {
- return m_cf.ConvertCoordinateSystemCodeToWkt(coordcode);
- }
+ public override string ConvertCoordinateSystemCodeToWkt(string coordcode) => m_cf.ConvertCoordinateSystemCodeToWkt(coordcode);
+ public override string ConvertEpsgCodeToWkt(string epsg) => m_cf.ConvertEpsgCodeToWkt(int.Parse(epsg));
+ public override string ConvertWktToCoordinateSystemCode(string wkt) => m_cf.ConvertWktToCoordinateSystemCode(wkt);
+ public override string ConvertWktToEpsgCode(string wkt) => m_cf.ConvertWktToEpsgCode(wkt).ToString();
+ public override bool IsValid(string wkt) => m_cf.IsValid(wkt);
- public override string ConvertEpsgCodeToWkt(string epsg)
- {
- return m_cf.ConvertEpsgCodeToWkt(int.Parse(epsg));
- }
-
- public override string ConvertWktToCoordinateSystemCode(string wkt)
- {
- return m_cf.ConvertWktToCoordinateSystemCode(wkt);
- }
-
- public override string ConvertWktToEpsgCode(string wkt)
- {
- return m_cf.ConvertWktToEpsgCode(wkt).ToString();
- }
-
- public override bool IsValid(string wkt)
- {
- return m_cf.IsValid(wkt);
- }
-
public override string LibraryName
{
get
@@ -89,7 +70,7 @@
}
}
- public override bool IsLoaded { get { return m_categories != null; } }
+ public override bool IsLoaded => m_categories != null;
public override CoordinateSystemDefinitionBase[] EnumerateCoordinateSystems(string category)
{
@@ -114,14 +95,8 @@
return lst.ToArray();
}
- public override CoordinateSystemDefinitionBase CreateEmptyCoordinateSystem()
- {
- return new LocalNativeCoordinateSystemDefinition();
- }
+ public override CoordinateSystemDefinitionBase CreateEmptyCoordinateSystem() => new LocalNativeCoordinateSystemDefinition();
- public override ISimpleTransform CreateTransform(string sourceWkt, string targetWkt)
- {
- return new LocalNativeSimpleTransform(sourceWkt, targetWkt);
- }
+ public override ISimpleTransform CreateTransform(string sourceWkt, string targetWkt) => new LocalNativeSimpleTransform(sourceWkt, targetWkt);
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeDataReader.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeDataReader.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeDataReader.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -97,25 +97,13 @@
base.Dispose();
}
- public override ReaderType ReaderType
- {
- get { return ReaderType.Data; }
- }
+ public override ReaderType ReaderType => ReaderType.Data;
- public override PropertyValueType GetPropertyType(int index)
- {
- return (PropertyValueType)_reader.GetPropertyType(index); //We can do this because the enum values map directly to MgPropertyType
- }
+ public override PropertyValueType GetPropertyType(int index) => (PropertyValueType)_reader.GetPropertyType(index);
- public override PropertyValueType GetPropertyType(string name)
- {
- return (PropertyValueType)_reader.GetPropertyType(name); //We can do this because the enum values map directly to MgPropertyType
- }
+ public override PropertyValueType GetPropertyType(string name) => (PropertyValueType)_reader.GetPropertyType(name);
- public override string GetName(int index)
- {
- return _reader.GetPropertyName(index);
- }
+ public override string GetName(int index) => _reader.GetPropertyName(index);
public override Type GetFieldType(int i)
{
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeSqlReader.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeSqlReader.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeSqlReader.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -42,10 +42,7 @@
_wktRw = new MgWktReaderWriter();
}
- public override ReaderType ReaderType
- {
- get { return ReaderType.Sql; }
- }
+ public override ReaderType ReaderType => ReaderType.Sql;
public override void Dispose()
{
@@ -85,15 +82,9 @@
return null;
}
- public override PropertyValueType GetPropertyType(int index)
- {
- return (PropertyValueType)_reader.GetPropertyType(index); //We can do this because the enum values map directly to MgPropertyType
- }
+ public override PropertyValueType GetPropertyType(int index) => (PropertyValueType)_reader.GetPropertyType(index);
- public override PropertyValueType GetPropertyType(string name)
- {
- return (PropertyValueType)_reader.GetPropertyType(name); //We can do this because the enum values map directly to MgPropertyType
- }
+ public override PropertyValueType GetPropertyType(string name) => (PropertyValueType)_reader.GetPropertyType(name);
public override void Close()
{
@@ -107,10 +98,7 @@
}
}
- public override string GetName(int index)
- {
- return _reader.GetPropertyName(index);
- }
+ public override string GetName(int index) => _reader.GetPropertyName(index);
public override Type GetFieldType(int i)
{
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/MgReadOnlyStream.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/MgReadOnlyStream.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/MgReadOnlyStream.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -66,17 +66,11 @@
{
}
- public override long Length
- {
- //NOTE: MgByteReader only returns remaining length! Should we
- //be keeping track of position and adding on this value?
- get { return _reader.GetLength(); }
- }
+ //NOTE: MgByteReader only returns remaining length! Should we
+ //be keeping track of position and adding on this value?
+ public override long Length => _reader.GetLength();
- public override bool CanRewind
- {
- get { return _reader.IsRewindable(); }
- }
+ public override bool CanRewind => _reader.IsRewindable();
public override void Rewind()
{
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Utility.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Utility.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Utility.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -61,18 +61,12 @@
/// <summary>
/// Returns a type used to define a raster column in a feature reader
/// </summary>
- public static Type RasterType
- {
- get { return typeof(System.Drawing.Bitmap); }
- }
+ public static Type RasterType => typeof(Bitmap);
/// <summary>
/// Returns the type used to define a geometry column in a feature reader
/// </summary>
- public static Type GeometryType
- {
- get { return typeof(IGeometry); }
- }
+ public static Type GeometryType => typeof(IGeometry);
/// <summary>
/// Gets the type of an item, given the MapGuide type id
@@ -83,47 +77,47 @@
{
switch (MgType)
{
- case OSGeo.MapGuide.MgPropertyType.Byte:
+ case MgPropertyType.Byte:
return typeof(byte);
- case OSGeo.MapGuide.MgPropertyType.Int16:
+ case MgPropertyType.Int16:
return typeof(short);
- case OSGeo.MapGuide.MgPropertyType.Int32:
+ case MgPropertyType.Int32:
return typeof(int);
- case OSGeo.MapGuide.MgPropertyType.Int64:
+ case MgPropertyType.Int64:
return typeof(long);
- case OSGeo.MapGuide.MgPropertyType.Single:
+ case MgPropertyType.Single:
return typeof(float);
- case OSGeo.MapGuide.MgPropertyType.Double:
+ case MgPropertyType.Double:
return typeof(double);
- case OSGeo.MapGuide.MgPropertyType.Boolean:
+ case MgPropertyType.Boolean:
return typeof(bool);
- case OSGeo.MapGuide.MgPropertyType.Geometry:
+ case MgPropertyType.Geometry:
return Utility.GeometryType;
- case OSGeo.MapGuide.MgPropertyType.String:
+ case MgPropertyType.String:
return typeof(string);
- case OSGeo.MapGuide.MgPropertyType.DateTime:
+ case MgPropertyType.DateTime:
return typeof(DateTime);
- case OSGeo.MapGuide.MgPropertyType.Raster:
+ case MgPropertyType.Raster:
return Utility.RasterType;
- case OSGeo.MapGuide.MgPropertyType.Blob:
+ case MgPropertyType.Blob:
return typeof(byte[]);
- case OSGeo.MapGuide.MgPropertyType.Clob:
+ case MgPropertyType.Clob:
return typeof(byte[]);
default:
- throw new Exception("Failed to find type for: " + MgType.ToString());
+ throw new Exception($"Failed to find type for: {MgType.ToString()}"); //LOCALIZEME
}
}
@@ -158,10 +152,7 @@
/// <summary>
/// Returns a type used to define an unknown column type in a feature reader
/// </summary>
- public static Type UnmappedType
- {
- get { return typeof(UnmappedDataType); }
- }
+ public static Type UnmappedType => typeof(UnmappedDataType);
/// <summary>
/// Gets the MapGuide id for a given type
@@ -171,31 +162,31 @@
public static int ConvertNetTypeToMgType(Type type)
{
if (type == typeof(short))
- return OSGeo.MapGuide.MgPropertyType.Int16;
+ return MgPropertyType.Int16;
else if (type == typeof(byte))
- return OSGeo.MapGuide.MgPropertyType.Byte;
+ return MgPropertyType.Byte;
else if (type == typeof(bool))
- return OSGeo.MapGuide.MgPropertyType.Boolean;
+ return MgPropertyType.Boolean;
else if (type == typeof(int))
- return OSGeo.MapGuide.MgPropertyType.Int32;
+ return MgPropertyType.Int32;
else if (type == typeof(long))
- return OSGeo.MapGuide.MgPropertyType.Int64;
+ return MgPropertyType.Int64;
else if (type == typeof(float))
- return OSGeo.MapGuide.MgPropertyType.Single;
+ return MgPropertyType.Single;
else if (type == typeof(double))
- return OSGeo.MapGuide.MgPropertyType.Double;
+ return MgPropertyType.Double;
else if (type == Utility.GeometryType)
- return OSGeo.MapGuide.MgPropertyType.Geometry;
+ return MgPropertyType.Geometry;
else if (type == typeof(string))
- return OSGeo.MapGuide.MgPropertyType.String;
+ return MgPropertyType.String;
else if (type == typeof(DateTime))
- return OSGeo.MapGuide.MgPropertyType.DateTime;
+ return MgPropertyType.DateTime;
else if (type == Utility.RasterType)
- return OSGeo.MapGuide.MgPropertyType.Raster;
+ return MgPropertyType.Raster;
else if (type == typeof(byte[]))
- return OSGeo.MapGuide.MgPropertyType.Blob;
+ return MgPropertyType.Blob;
- throw new Exception("Failed to find type for: " + type.FullName.ToString());
+ throw new Exception($"Failed to find type for: {type.FullName.ToString()}"); //LOCALIZEME
}
public static ClassDefinition ConvertClassDefinition(MgClassDefinition mgClass)
@@ -285,9 +276,6 @@
return dp;
}
- internal static DateTime ConvertMgDateTime(MgDateTime dt)
- {
- return new DateTime(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, dt.Second, dt.Microsecond * 1000);
- }
+ internal static DateTime ConvertMgDateTime(MgDateTime dt) => new DateTime(dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, dt.Second, dt.Microsecond * 1000);
}
}
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WebLayout/WebLayoutInterfaces.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WebLayout/WebLayoutInterfaces.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.ObjectModels/WebLayout/WebLayoutInterfaces.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -334,16 +334,13 @@
/// <summary>
/// Gets whether the name was changed when importing
/// </summary>
- public bool NameChanged { get { return !this.ImportedName.Equals(this.OriginalName); } }
-
+ public bool NameChanged => !this.ImportedName.Equals(this.OriginalName);
+
/// <summary>
/// Gets the string representation
/// </summary>
/// <returns></returns>
- public override string ToString()
- {
- return string.Format("{0} => {1}", this.OriginalName, this.ImportedName); //NOXLATE
- }
+ public override string ToString() => $"{this.OriginalName} => {this.ImportedName}";
}
/// <summary>
Modified: trunk/Tools/Maestro/Properties/CodeAnalysisRules.cs
===================================================================
--- trunk/Tools/Maestro/Properties/CodeAnalysisRules.cs 2015-08-11 17:09:38 UTC (rev 8740)
+++ trunk/Tools/Maestro/Properties/CodeAnalysisRules.cs 2015-08-12 17:10:40 UTC (rev 8741)
@@ -40,9 +40,13 @@
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Potential Code Quality Issues", "RECS0022", Justification = "If I'm swallowing up an exception, it is intentional")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Language Usage Opportunities", "RECS0011", Justification = "It's if/else because it's more readable that a single long ternary expression")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Common Practices and Code Improvements", "RECS0030", Justification = "<Pending>")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Potential Code Quality Issues", "RECS0025", Justification = "<Pending>")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Potential Code Quality Issues", "CS0108", Justification = "Shadowing is the result of constraints imposed by interfaces we're implementing")]
//TODO: Review these ones as we get further clarity about what string comparisons should be culture-sensitive and which ones shouldn't be
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Common Practices and Code Improvements", "RECS0060", Justification = "To be reviewed at a later time")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Common Practices and Code Improvements", "RECS0061", Justification = "To be reviewed at a later time")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Common Practices and Code Improvements", "RECS0062", Justification = "To be reviewed at a later time")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Common Practices and Code Improvements", "RECS0063", Justification = "To be reviewed at a later time")]
\ No newline at end of file
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Common Practices and Code Improvements", "RECS0063", Justification = "To be reviewed at a later time")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Common Practices and Code Improvements", "RECS0064", Justification = "To be reviewed at a later time")]
+[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Common Practices and Code Improvements", "RECS0119", Justification = "To be reviewed at a later time")]
\ No newline at end of file
More information about the mapguide-commits
mailing list