diff --git a/.gitignore b/.gitignore index aff3d3be..2ebae767 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ *.suo *.user *.sln.docstates +.vs/ # Build results diff --git a/install/MapWindow5.iss b/install/MapWindow5.iss index 3d8ccb94..7f355cdf 100644 --- a/install/MapWindow5.iss +++ b/install/MapWindow5.iss @@ -93,7 +93,7 @@ Source: "{#ExeBinPath}\Projections\*"; DestDir: "{app}\Projections"; Flags: igno ;; Manuals sub folder Source: "{#ExeBinPath}\Manuals\*"; DestDir: "{app}\Manuals"; Flags: ignoreversion recursesubdirs createallsubdirs {#SystemFlag}; Components: MapWindow ;; Plugins subfolder -Source: "{#ExeBinPath}\Plugins\*.dll"; DestDir: "{app}\Plugins"; Flags: ignoreversion {#SystemFlag}; Components: MapWindow; Excludes: "Interop.MapWinGIS.dll,MW5.TemplatePlugin.dll,Syncfusion.*" +Source: "{#ExeBinPath}\Plugins\*"; DestDir: "{app}\Plugins"; Flags: ignoreversion recursesubdirs createallsubdirs {#SystemFlag}; Components: MapWindow; Excludes: "Interop.MapWinGIS.dll,MW5.TemplatePlugin.dll,Syncfusion.*" ;; Styles subfolder Source: "{#ExeBinPath}\Styles\*"; DestDir: "{app}\Styles"; Flags: ignoreversion recursesubdirs createallsubdirs {#SystemFlag}; Components: MapWindow ;; SQLite interop: @@ -105,7 +105,7 @@ Source: "{#ExeBinPath}\x86\*"; DestDir: "{app}\x86"; Flags: ignoreversion {#Syst ;; Config files: Source: "{#ExeBinPath}\MapWindow.exe.config"; DestDir: "{app}"; Flags: ignoreversion {#SystemFlag}; Components: MapWindow; Permissions: users-modify ;; Licenses -Source: "D:\dev\MapwinGIS\GitHub\support\GDAL_SDK\licenses\*.rtf"; DestDir: "{app}\Licenses"; Flags: ignoreversion; Components: MapWindow +Source: "{#ExeBinPath}\..\..\..\..\MapWinGIS\support\GDAL_SDK\licenses\*.rtf"; DestDir: "{app}\Licenses"; Flags: ignoreversion; Components: MapWindow Source: "{#ExeBinPath}\..\..\..\licenses\*"; DestDir: "{app}\Licenses"; Flags: ignoreversion {#SystemFlag}; Components: MapWindow ;; Sample data @@ -154,6 +154,7 @@ Root: "HKCR"; Subkey: ".mwproj"; ValueType: string; ValueData: "MW5Project"; Fla Root: "HKCR"; Subkey: "MW5Project"; ValueType: string; ValueData: "MW5 Project"; Flags: uninsdeletekey Root: "HKCR"; Subkey: "MW5Project\DefaultIcon"; ValueType: string; ValueData: "{app}\MAPWINDOW.EXE,0" Root: "HKCR"; Subkey: "MW5Project\shell\open\command"; ValueType: string; ValueData: """{app}\MAPWINDOW.EXE"" ""%1""" +Root: "HKCR"; Subkey: "MW5Project\"; ValueName: "InstallDir"; ValueType: string; ValueData: "{app}" [InstallDelete] Type: files; Name: "{app}\Plugins\MW5.TemplatePlugin.dll"; Components: MapWindow diff --git a/src/MW5.Api/Concrete/Feature.cs b/src/MW5.Api/Concrete/Feature.cs index 7e3dce46..7481a6dd 100644 --- a/src/MW5.Api/Concrete/Feature.cs +++ b/src/MW5.Api/Concrete/Feature.cs @@ -67,6 +67,11 @@ public int Index get { return _shapeIndex; } } + public bool IsPartOfSet(IFeatureSet set) + { + return set?.InternalObject == InternalShapefile; + } + public IGeometry Geometry { get diff --git a/src/MW5.Api/Concrete/FeatureSet.cs b/src/MW5.Api/Concrete/FeatureSet.cs index 36897d5c..562f7b9c 100644 --- a/src/MW5.Api/Concrete/FeatureSet.cs +++ b/src/MW5.Api/Concrete/FeatureSet.cs @@ -213,6 +213,8 @@ public static void DeleteShapefile(string filename) public GeometryType GeometryType => GeometryHelper.ShapeType2GeometryType(_shapefile.ShapefileType); + public bool Selectable { get => _shapefile.Selectable; set => _shapefile.Selectable = value; } + public ZValueType ZValueType => GeometryHelper.ShapeType2ZValueType(_shapefile.ShapefileType); public FeatureSourceType SourceType => (FeatureSourceType)_shapefile.SourceType; diff --git a/src/MW5.Api/Concrete/GeometryEditor.cs b/src/MW5.Api/Concrete/GeometryEditor.cs index dfcbab97..0a056cbe 100644 --- a/src/MW5.Api/Concrete/GeometryEditor.cs +++ b/src/MW5.Api/Concrete/GeometryEditor.cs @@ -47,7 +47,13 @@ public LayerSelectionMode HighlightVertices get { return (LayerSelectionMode)_editor.HighlightVertices; } set { _editor.HighlightVertices = (tkLayerSelection)value; } } - + + public SnapMode SnapMode + { + get { return (SnapMode)_editor.SnapMode; } + set { _editor.SnapMode = (tkSnapMode) value; } + } + public bool IsDigitizing { get { return _editor.IsDigitizing; } diff --git a/src/MW5.Api/Concrete/Layer.cs b/src/MW5.Api/Concrete/Layer.cs index d4fc4245..8c88d49f 100644 --- a/src/MW5.Api/Concrete/Layer.cs +++ b/src/MW5.Api/Concrete/Layer.cs @@ -264,6 +264,11 @@ public bool Deserialize(string state) return Map.DeserializeLayer(LayerHandle, state); } + public void ReloadOgrLayerFromSource() + { + Map.ReloadOgrLayerFromSource(LayerHandle); + } + /// /// Changes selection of the shapefile adding new shapes using the specified mode /// diff --git a/src/MW5.Api/Concrete/VectorLayer.cs b/src/MW5.Api/Concrete/VectorLayer.cs index 55d9886d..396ab071 100644 --- a/src/MW5.Api/Concrete/VectorLayer.cs +++ b/src/MW5.Api/Concrete/VectorLayer.cs @@ -55,9 +55,18 @@ public VectorLayer(string filename, bool forUpdate = false) } } - public void ReloadFromSource() + public void ReloadFromSource(bool preserveStyleAndLabels = true) { + var lbls = Data.Labels.Style.Serialize(); + var cats = Data.Categories.Serialize(); _layer.ReloadFromSource(); + Data.Labels.Deserialize(lbls); + Data.Categories.Deserialize(cats); + } + + public void ReloadFromSource() + { + this.ReloadFromSource(true); } public bool Open(string filename, bool forUpdate = false) diff --git a/src/MW5.Api/Enums/Enums.cs b/src/MW5.Api/Enums/Enums.cs index fb9ddfc8..d24af5fd 100644 --- a/src/MW5.Api/Enums/Enums.cs +++ b/src/MW5.Api/Enums/Enums.cs @@ -902,6 +902,13 @@ public enum LayerSelectionMode ActiveLayer = 2, } + public enum SnapMode + { + Vertices = 0, + VerticesAndLines = 1, + Lines = 2 + } + public enum LengthDisplay { Metric = 0, diff --git a/src/MW5.Api/Events/AfterShapeEditEventArgs.cs b/src/MW5.Api/Events/AfterShapeEditEventArgs.cs index 5e5da166..4af31313 100644 --- a/src/MW5.Api/Events/AfterShapeEditEventArgs.cs +++ b/src/MW5.Api/Events/AfterShapeEditEventArgs.cs @@ -1,5 +1,6 @@ using System; using AxMapWinGIS; +using MapWinGIS; using MW5.Api.Enums; namespace MW5.Api.Events @@ -8,6 +9,11 @@ public class AfterShapeEditEventArgs: EventArgs { private readonly _DMapEvents_AfterShapeEditEvent _args; + public AfterShapeEditEventArgs(UndoOperation operation, int layerHandle, int shapeIndex) + : this(new _DMapEvents_AfterShapeEditEvent((tkUndoOperation)operation, layerHandle, shapeIndex)) + { + } + internal AfterShapeEditEventArgs(_DMapEvents_AfterShapeEditEvent args) { _args = args; diff --git a/src/MW5.Api/Events/BeforeDeleteShapeEventArgs.cs b/src/MW5.Api/Events/BeforeDeleteShapeEventArgs.cs index 04bd9ced..ee3b2b3a 100644 --- a/src/MW5.Api/Events/BeforeDeleteShapeEventArgs.cs +++ b/src/MW5.Api/Events/BeforeDeleteShapeEventArgs.cs @@ -2,13 +2,22 @@ using AxMapWinGIS; using MapWinGIS; using MW5.Api.Enums; +using MW5.Api.Interfaces; namespace MW5.Api.Events { - public class BeforeDeleteShapeEventArgs : EventArgs + public class BeforeDeleteShapeEventArgs : EventArgs, ICancellableEvent { private readonly _DMapEvents_BeforeDeleteShapeEvent _args; + public BeforeDeleteShapeEventArgs(DeleteTarget target, bool cancel) + { + _args = new _DMapEvents_BeforeDeleteShapeEvent( + (tkDeleteTarget) target, + cancel ? tkMwBoolean.blnTrue : tkMwBoolean.blnFalse + ); + } + internal BeforeDeleteShapeEventArgs(_DMapEvents_BeforeDeleteShapeEvent args) { _args = args; diff --git a/src/MW5.Api/Events/BeforeShapeEditEventArgs.cs b/src/MW5.Api/Events/BeforeShapeEditEventArgs.cs index 67f019fe..c3a31512 100644 --- a/src/MW5.Api/Events/BeforeShapeEditEventArgs.cs +++ b/src/MW5.Api/Events/BeforeShapeEditEventArgs.cs @@ -1,10 +1,11 @@ using System; using AxMapWinGIS; using MapWinGIS; +using MW5.Api.Interfaces; namespace MW5.Api.Events { - public class BeforeShapeEditEventArgs : EventArgs + public class BeforeShapeEditEventArgs : EventArgs, ICancellableEvent { private readonly _DMapEvents_BeforeShapeEditEvent _args; @@ -17,6 +18,13 @@ internal BeforeShapeEditEventArgs(_DMapEvents_BeforeShapeEditEvent args) } } + public BeforeShapeEditEventArgs(int layerHandle, int shapeIndex, bool cancel) : this(new _DMapEvents_BeforeShapeEditEvent( + layerHandle, + shapeIndex, + cancel? tkMwBoolean.blnTrue : tkMwBoolean.blnFalse + )) + { } + public int LayerHandle { get { return _args.layerHandle; } diff --git a/src/MW5.Api/Events/BeforeVertexDigitizedEventArgs.cs b/src/MW5.Api/Events/BeforeVertexDigitizedEventArgs.cs new file mode 100644 index 00000000..46beb45a --- /dev/null +++ b/src/MW5.Api/Events/BeforeVertexDigitizedEventArgs.cs @@ -0,0 +1,40 @@ +using AxMapWinGIS; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MW5.Api.Events +{ + public class BeforeVertexDigitizedEventArgs : EventArgs + { + private readonly _DMapEvents_BeforeVertexDigitizedEvent _args; + + public BeforeVertexDigitizedEventArgs(double pointX, double pointY) + : this(new _DMapEvents_BeforeVertexDigitizedEvent(pointX, pointY)) + { + } + + internal BeforeVertexDigitizedEventArgs(_DMapEvents_BeforeVertexDigitizedEvent args) + { + _args = args; + if (args == null) + { + throw new NullReferenceException("Internal reference is null."); + } + } + + public double PointX + { + get { return _args.pointX; } + set { _args.pointX = value; } + } + + public double PointY + { + get { return _args.pointY; } + set { _args.pointY = value; } + } + } +} diff --git a/src/MW5.Api/Events/LayerProjectionIsEmptyEventArgs.cs b/src/MW5.Api/Events/LayerProjectionIsEmptyEventArgs.cs index ef508b7f..205101f8 100644 --- a/src/MW5.Api/Events/LayerProjectionIsEmptyEventArgs.cs +++ b/src/MW5.Api/Events/LayerProjectionIsEmptyEventArgs.cs @@ -1,10 +1,11 @@ using System; using AxMapWinGIS; using MapWinGIS; +using MW5.Api.Interfaces; namespace MW5.Api.Events { - public class LayerProjectionIsEmptyEventArgs: EventArgs + public class LayerProjectionIsEmptyEventArgs: EventArgs, ICancellableEvent { private readonly _DMapEvents_LayerProjectionIsEmptyEvent _args; @@ -27,5 +28,7 @@ public bool CancelAdding get { return _args.cancelAdding == tkMwBoolean.blnTrue; } set { _args.cancelAdding = value ? tkMwBoolean.blnTrue : tkMwBoolean.blnFalse; } } + + public bool Cancel => CancelAdding; } } diff --git a/src/MW5.Api/Events/ProjectionChangedEventArgs.cs b/src/MW5.Api/Events/ProjectionChangedEventArgs.cs index cdcb8211..0b811cb5 100644 --- a/src/MW5.Api/Events/ProjectionChangedEventArgs.cs +++ b/src/MW5.Api/Events/ProjectionChangedEventArgs.cs @@ -1,10 +1,11 @@ using System; using AxMapWinGIS; using MapWinGIS; +using MW5.Api.Interfaces; namespace MW5.Api.Events { - public class ProjectionMismatchEventArgs: EventArgs + public class ProjectionMismatchEventArgs: EventArgs, ICancellableEvent { private readonly _DMapEvents_ProjectionMismatchEvent _args; @@ -23,6 +24,8 @@ public bool CancelAdding set { _args.cancelAdding = value ? tkMwBoolean.blnTrue : tkMwBoolean.blnFalse; } } + public bool Cancel => CancelAdding; + public bool Reproject { get { return _args.reproject == tkMwBoolean.blnTrue; } diff --git a/src/MW5.Api/Events/ValidateShapeEventArgs.cs b/src/MW5.Api/Events/ValidateShapeEventArgs.cs index b5ef7ea5..45c885f7 100644 --- a/src/MW5.Api/Events/ValidateShapeEventArgs.cs +++ b/src/MW5.Api/Events/ValidateShapeEventArgs.cs @@ -6,7 +6,7 @@ namespace MW5.Api.Events { - public class ValidateShapeEventArgs : EventArgs + public class ValidateShapeEventArgs : EventArgs, ICancellableEvent { private readonly _DMapEvents_ValidateShapeEvent _args; @@ -19,10 +19,10 @@ internal ValidateShapeEventArgs(_DMapEvents_ValidateShapeEvent args) } } - public tkMwBoolean Cancel + public bool Cancel { - get { return _args.cancel; } - set { _args.cancel = value; } + get { return _args.cancel == tkMwBoolean.blnTrue; } + set { _args.cancel = value ? tkMwBoolean.blnTrue : tkMwBoolean.blnFalse; } } public int LayerHandle diff --git a/src/MW5.Api/Interfaces/ICancellableEvent.cs b/src/MW5.Api/Interfaces/ICancellableEvent.cs new file mode 100644 index 00000000..5b736ccf --- /dev/null +++ b/src/MW5.Api/Interfaces/ICancellableEvent.cs @@ -0,0 +1,7 @@ +namespace MW5.Api.Interfaces +{ + public interface ICancellableEvent + { + bool Cancel { get; } + } +} \ No newline at end of file diff --git a/src/MW5.Api/Interfaces/IFeature.cs b/src/MW5.Api/Interfaces/IFeature.cs index 5d4afc8a..0c27f180 100644 --- a/src/MW5.Api/Interfaces/IFeature.cs +++ b/src/MW5.Api/Interfaces/IFeature.cs @@ -26,6 +26,7 @@ public interface IFeature bool SetInteger(int fieldIndex, int value); bool SetString(int fieldIndex, string value); IAttributeField GetField(int fieldIndex); - bool RowModified { get; } + bool RowModified { get; } + bool IsPartOfSet(IFeatureSet featureSet); } } \ No newline at end of file diff --git a/src/MW5.Api/Interfaces/IFeatureSet.cs b/src/MW5.Api/Interfaces/IFeatureSet.cs index 2c9dfc83..cbec4081 100644 --- a/src/MW5.Api/Interfaces/IFeatureSet.cs +++ b/src/MW5.Api/Interfaces/IFeatureSet.cs @@ -40,6 +40,7 @@ public interface IFeatureSet: ILayerSource CollisionMode CollisionMode { get; set; } bool Snappable { get; set; } + bool Selectable { get; set; } bool Volatile { get; set; } bool Identifiable { get; set; } string VisibilityExpression { get; set; } diff --git a/src/MW5.Api/Interfaces/IGeometryEditor.cs b/src/MW5.Api/Interfaces/IGeometryEditor.cs index 815d448f..360f5930 100644 --- a/src/MW5.Api/Interfaces/IGeometryEditor.cs +++ b/src/MW5.Api/Interfaces/IGeometryEditor.cs @@ -21,6 +21,7 @@ public interface IGeometryEditor: IComWrapper int ShapeIndex { get; } GeometryType GeometryType { get; set; } LayerSelectionMode SnapBehavior { get; set; } + SnapMode SnapMode { get; set; } double SnapTolerance { get; set; } IGeometry ValidatedShape { get; } EditorValidation ValidationMode { get; set; } diff --git a/src/MW5.Api/Interfaces/ILayer.cs b/src/MW5.Api/Interfaces/ILayer.cs index a7d6b537..e4939a77 100644 --- a/src/MW5.Api/Interfaces/ILayer.cs +++ b/src/MW5.Api/Interfaces/ILayer.cs @@ -44,6 +44,8 @@ public interface ILayer: IDynamicVisibilityTarget string SizeInfo { get; } + void ReloadOgrLayerFromSource(); + #region Not implemented // bool SkipOnSaving { get; set; } diff --git a/src/MW5.Api/Interfaces/IMap.cs b/src/MW5.Api/Interfaces/IMap.cs index 186a9dca..985ab9e7 100644 --- a/src/MW5.Api/Interfaces/IMap.cs +++ b/src/MW5.Api/Interfaces/IMap.cs @@ -12,6 +12,7 @@ public interface IMap : IMuteMap { event EventHandler MapCursorChanged; event EventHandler AfterShapeEdit; + event EventHandler BeforeVertexDigitized; event EventHandler BackgroundLoadingFinished; event EventHandler BackgroundLoadingStarted; event EventHandler BeforeDeleteShape; diff --git a/src/MW5.Api/Interfaces/IVectorLayer.cs b/src/MW5.Api/Interfaces/IVectorLayer.cs index e9dea497..22489c38 100644 --- a/src/MW5.Api/Interfaces/IVectorLayer.cs +++ b/src/MW5.Api/Interfaces/IVectorLayer.cs @@ -34,6 +34,7 @@ public interface IVectorLayer: ILayerSource bool Open(string connectionString, string layerName, bool forUpdate = false); bool OpenFromQuery(string connectionString, string sql); void ReloadFromSource(); + void ReloadFromSource(bool preserveStyleAndLabels = true); IEnumerable AvailableGeometryTypes {get;} void SetActiveGeometryType(GeometryType type, ZValueType zValue); GeometryType ActiveGeometryType { get; } diff --git a/src/MW5.Api/Legend/Events/DatasourceCancelEventArgs.cs b/src/MW5.Api/Legend/Events/DatasourceCancelEventArgs.cs index 488c5d1b..02841217 100644 --- a/src/MW5.Api/Legend/Events/DatasourceCancelEventArgs.cs +++ b/src/MW5.Api/Legend/Events/DatasourceCancelEventArgs.cs @@ -8,7 +8,7 @@ namespace MW5.Api.Legend.Events { - public class DatasourceCancelEventArgs: CancelEventArgs + public class DatasourceCancelEventArgs: CancelEventArgs, ICancellableEvent { public DatasourceCancelEventArgs(ILayerSource datasource) { diff --git a/src/MW5.Api/Legend/Events/LayerCancelEventArgs.cs b/src/MW5.Api/Legend/Events/LayerCancelEventArgs.cs index 9166be93..28ed5ddf 100644 --- a/src/MW5.Api/Legend/Events/LayerCancelEventArgs.cs +++ b/src/MW5.Api/Legend/Events/LayerCancelEventArgs.cs @@ -1,4 +1,5 @@ -using System; +using MW5.Api.Interfaces; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -6,7 +7,7 @@ namespace MW5.Api.Legend.Events { - public class LayerCancelEventArgs: LayerEventArgs + public class LayerCancelEventArgs: LayerEventArgs, ICancellableEvent { public bool NewState { get; internal set; } public bool Cancel { get; set; } diff --git a/src/MW5.Api/MW5.Api.csproj b/src/MW5.Api/MW5.Api.csproj index 58b35263..fcbc1e63 100644 --- a/src/MW5.Api/MW5.Api.csproj +++ b/src/MW5.Api/MW5.Api.csproj @@ -24,6 +24,7 @@ false bin\x86\Debug\MW5.Api.XML 1591 + 7.1 bin\x86\Release\ @@ -34,6 +35,7 @@ prompt MinimumRecommendedRules.ruleset false + 7.1 true @@ -89,6 +91,8 @@ + + @@ -306,8 +310,8 @@ {C368D713-CC5F-40ED-9F53-F84FE197B96A} - 4 - 9 + 5 + 0 0 aximp True @@ -315,8 +319,8 @@ {C368D713-CC5F-40ED-9F53-F84FE197B96A} - 4 - 9 + 5 + 0 0 tlbimp True @@ -327,8 +331,8 @@ {C368D713-CC5F-40ED-9F53-F84FE197B96A} - 4 - 9 + 5 + 0 0 aximp False @@ -336,8 +340,8 @@ {C368D713-CC5F-40ED-9F53-F84FE197B96A} - 4 - 9 + 5 + 0 0 tlbimp False diff --git a/src/MW5.Api/Map/MapControl.cs b/src/MW5.Api/Map/MapControl.cs index 92b541ea..acc86bcf 100644 --- a/src/MW5.Api/Map/MapControl.cs +++ b/src/MW5.Api/Map/MapControl.cs @@ -86,6 +86,7 @@ private void OnMapPreviewKeyDown(object sender, PreviewKeyDownEventArgs e) public event EventHandler TilesLoaded; public event EventHandler HistoryChanged; public event EventHandler ValidateShape; + public event EventHandler BeforeVertexDigitized; public event EventHandler MapLocked; public event EventHandler TmsProviderChanged; diff --git a/src/MW5.Api/Map/MapEvents.cs b/src/MW5.Api/Map/MapEvents.cs index 41b4e5d1..a3e37ac1 100644 --- a/src/MW5.Api/Map/MapEvents.cs +++ b/src/MW5.Api/Map/MapEvents.cs @@ -38,6 +38,7 @@ public void AttachHandlers() _map.TilesLoaded += MapTilesLoaded; _map.UndoListChanged += MapUndoListChanged; _map.ValidateShape += MapValidateShape; + _map.BeforeVertexDigitized += MapBeforeVertexDigitized; } public void DetachHandlers() @@ -68,9 +69,14 @@ public void DetachHandlers() _map.TilesLoaded -= MapTilesLoaded; _map.UndoListChanged -= MapUndoListChanged; _map.ValidateShape -= MapValidateShape; + _map.BeforeVertexDigitized -= MapBeforeVertexDigitized; } #region Handlers + private void MapBeforeVertexDigitized(object sender, _DMapEvents_BeforeVertexDigitizedEvent e) + { + Invoke(sender, BeforeVertexDigitized, new BeforeVertexDigitizedEventArgs(e)); + } private void MapValidateShape(object sender, _DMapEvents_ValidateShapeEvent e) { diff --git a/src/MW5.Attributes/MW5.Attributes.csproj b/src/MW5.Attributes/MW5.Attributes.csproj index d0bd1b53..224dc4cc 100644 --- a/src/MW5.Attributes/MW5.Attributes.csproj +++ b/src/MW5.Attributes/MW5.Attributes.csproj @@ -21,6 +21,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 bin\x86\Release\ @@ -30,6 +31,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 true diff --git a/src/MW5.DI/MW5.DI.Castle/MW5.DI.Castle.csproj b/src/MW5.DI/MW5.DI.Castle/MW5.DI.Castle.csproj index 27b96680..48c53453 100644 --- a/src/MW5.DI/MW5.DI.Castle/MW5.DI.Castle.csproj +++ b/src/MW5.DI/MW5.DI.Castle/MW5.DI.Castle.csproj @@ -23,6 +23,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 bin\x86\Release\ @@ -32,6 +33,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 true diff --git a/src/MW5.DI/MW5.DI.LightInject/MW5.DI.LightInject.csproj b/src/MW5.DI/MW5.DI.LightInject/MW5.DI.LightInject.csproj index fa35ccb8..eb47fbae 100644 --- a/src/MW5.DI/MW5.DI.LightInject/MW5.DI.LightInject.csproj +++ b/src/MW5.DI/MW5.DI.LightInject/MW5.DI.LightInject.csproj @@ -23,6 +23,7 @@ DEBUG;TRACE prompt 4 + 7.1 pdbonly @@ -31,6 +32,7 @@ TRACE prompt 4 + 7.1 true diff --git a/src/MW5.DI/MW5.DI.Ninject/MW5.DI.Ninject.csproj b/src/MW5.DI/MW5.DI.Ninject/MW5.DI.Ninject.csproj index 816670b8..fc309ab1 100644 --- a/src/MW5.DI/MW5.DI.Ninject/MW5.DI.Ninject.csproj +++ b/src/MW5.DI/MW5.DI.Ninject/MW5.DI.Ninject.csproj @@ -23,6 +23,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 bin\x86\Release\ @@ -32,6 +33,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 true diff --git a/src/MW5.DI/MW5.DI.Unity/MW5.DI.Unity.csproj b/src/MW5.DI/MW5.DI.Unity/MW5.DI.Unity.csproj index c961d1dc..13e5ceda 100644 --- a/src/MW5.DI/MW5.DI.Unity/MW5.DI.Unity.csproj +++ b/src/MW5.DI/MW5.DI.Unity/MW5.DI.Unity.csproj @@ -23,6 +23,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 bin\x86\Release\ @@ -32,6 +33,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 true diff --git a/src/MW5.Data/MW5.Data.csproj b/src/MW5.Data/MW5.Data.csproj index e841b54a..11688b78 100644 --- a/src/MW5.Data/MW5.Data.csproj +++ b/src/MW5.Data/MW5.Data.csproj @@ -25,6 +25,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 bin\x86\Release\ @@ -34,6 +35,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 true diff --git a/src/MW5.Gdal/MW5.Gdal.csproj b/src/MW5.Gdal/MW5.Gdal.csproj index 1db35494..9355efea 100644 --- a/src/MW5.Gdal/MW5.Gdal.csproj +++ b/src/MW5.Gdal/MW5.Gdal.csproj @@ -21,6 +21,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 bin\x86\Release\ @@ -30,6 +31,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 true diff --git a/src/MW5.Mvp/MW5.Mvp.csproj b/src/MW5.Mvp/MW5.Mvp.csproj index f4f19333..70a9b229 100644 --- a/src/MW5.Mvp/MW5.Mvp.csproj +++ b/src/MW5.Mvp/MW5.Mvp.csproj @@ -36,6 +36,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 bin\x86\Release\ @@ -45,6 +46,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 true diff --git a/src/MW5.Plugins/Concrete/BasePlugin.cs b/src/MW5.Plugins/Concrete/BasePlugin.cs index adf6a1cb..820680b4 100644 --- a/src/MW5.Plugins/Concrete/BasePlugin.cs +++ b/src/MW5.Plugins/Concrete/BasePlugin.cs @@ -106,6 +106,9 @@ internal void SetApplicationPlugin(bool value) internal EventHandler ItemClicked_; internal EventHandler ProjectClosing_; internal EventHandler ProjectClosed_; + internal EventHandler ProjectSaving_; + internal EventHandler ProjectSaved_; + internal EventHandler BeforeLayerEditingChanged_; internal EventHandler LayerEditingChanged_; internal EventHandler BeforeRemoveLayer_; internal EventHandler ViewUpdating_; @@ -141,6 +144,12 @@ public event EventHandler LayerEditingChanged remove { LayerEditingChanged_ -= value; } } + public event EventHandler BeforeLayerEditingChanged + { + add { BeforeLayerEditingChanged_ += value; } + remove { BeforeLayerEditingChanged_ -= value; } + } + public event EventHandler LayerFeatureCountChanged { add { LayerFeatureCountChanged_ += value; } @@ -171,6 +180,18 @@ public event EventHandler ItemClicked remove { ItemClicked_ -= value; } } + public event EventHandler ProjectSaving + { + add { ProjectSaving_ += value; } + remove { ProjectSaving_ -= value; } + } + + public event EventHandler ProjectSaved + { + add { ProjectSaved_ += value; } + remove { ProjectSaved_ -= value; } + } + public event EventHandler ProjectClosing { add { ProjectClosing_ += value; } diff --git a/src/MW5.Plugins/Events/DockPanelCancelEventArgs.cs b/src/MW5.Plugins/Events/DockPanelCancelEventArgs.cs index 2ac77184..78b02c06 100644 --- a/src/MW5.Plugins/Events/DockPanelCancelEventArgs.cs +++ b/src/MW5.Plugins/Events/DockPanelCancelEventArgs.cs @@ -1,8 +1,9 @@ -using MW5.Plugins.Interfaces; +using MW5.Api.Interfaces; +using MW5.Plugins.Interfaces; namespace MW5.Plugins.Events { - public class DockPanelCancelEventArgs: DockPanelEventArgs + public class DockPanelCancelEventArgs: DockPanelEventArgs, ICancellableEvent { public DockPanelCancelEventArgs(IDockPanel panel, string key) : base(panel, key) { diff --git a/src/MW5.Plugins/Events/LayerCancelEventArgs.cs b/src/MW5.Plugins/Events/LayerCancelEventArgs.cs index dfa6b3f2..1a7014e4 100644 --- a/src/MW5.Plugins/Events/LayerCancelEventArgs.cs +++ b/src/MW5.Plugins/Events/LayerCancelEventArgs.cs @@ -1,9 +1,10 @@ -using System; +using MW5.Api.Interfaces; +using System; using System.ComponentModel; namespace MW5.Plugins.Events { - public class LayerCancelEventArgs: CancelEventArgs + public class LayerCancelEventArgs: CancelEventArgs, ICancellableEvent { public LayerCancelEventArgs(int layerHandle) { diff --git a/src/MW5.Plugins/Events/TileProviderArgs.cs b/src/MW5.Plugins/Events/TileProviderArgs.cs index 4647debd..f42128c9 100644 --- a/src/MW5.Plugins/Events/TileProviderArgs.cs +++ b/src/MW5.Plugins/Events/TileProviderArgs.cs @@ -5,10 +5,11 @@ using System.Text; using System.Threading.Tasks; using MW5.Api.Enums; +using MW5.Api.Interfaces; namespace MW5.Plugins.Events { - public class TileProviderArgs: CancelEventArgs + public class TileProviderArgs: CancelEventArgs, ICancellableEvent { public TileProviderArgs(int providerId) { diff --git a/src/MW5.Plugins/MW5.Plugins.csproj b/src/MW5.Plugins/MW5.Plugins.csproj index 546cecf1..fe8c94cb 100644 --- a/src/MW5.Plugins/MW5.Plugins.csproj +++ b/src/MW5.Plugins/MW5.Plugins.csproj @@ -36,6 +36,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 bin\x86\Release\ @@ -45,6 +46,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 true @@ -54,6 +56,7 @@ x64 prompt MinimumRecommendedRules.ruleset + 7.1 bin\x64\Release\ @@ -63,6 +66,7 @@ x64 prompt MinimumRecommendedRules.ruleset + 7.1 diff --git a/src/MW5.Plugins/PluginBroadcaster.cs b/src/MW5.Plugins/PluginBroadcaster.cs index 4e42b579..c2ff959b 100644 --- a/src/MW5.Plugins/PluginBroadcaster.cs +++ b/src/MW5.Plugins/PluginBroadcaster.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Diagnostics; using System.Linq; using System.Linq.Expressions; @@ -103,7 +104,13 @@ private void BroadcastEvent(MemberExpression expression, object sender, T arg string eventName = expression.Member.Name; - var singleTargetArgs = args as SingleTargetEventArgs; + bool IsCancelled() => ( + (args is ICancellableEvent bargs && bargs.Cancel) || + (args is CancelEventArgs cargs && cargs.Cancel) + ); + bool StopBubbling() => ( + (args is SingleTargetEventArgs sargs && sargs.Handled) || IsCancelled() + ); var fieldInfo = GetEventField(eventName); if (fieldInfo != null) @@ -120,17 +127,16 @@ private void BroadcastEvent(MemberExpression expression, object sender, T arg var del = fieldInfo.GetValue(p) as MulticastDelegate; if (del != null) { - if (del.GetInvocationList().Any()) + var invlst = del.GetInvocationList(); + foreach (var adel in invlst) { - del.Method.Invoke(del.Target, new[] { sender, args }); + adel.Method.Invoke(adel.Target, new[] { sender, args }); + if (StopBubbling()) + break; } } - - // in case we want only one handler - if (singleTargetArgs != null && singleTargetArgs.Handled) - { + if (StopBubbling()) break; - } } } } diff --git a/src/MW5.Plugins/PluginManager.cs b/src/MW5.Plugins/PluginManager.cs index cffe2bdd..e7f682ce 100644 --- a/src/MW5.Plugins/PluginManager.cs +++ b/src/MW5.Plugins/PluginManager.cs @@ -237,7 +237,7 @@ public void UnloadPlugin(PluginIdentity identity, IAppContext context) FirePluginUnloaded(identity); } - public void RestoreApplicationPlugins(IEnumerable plugins, IAppContext context) + public void RestoreApplicationPlugins(IEnumerable plugins, IAppContext context, Action pluginLoadingCallback = null) { var dict = new HashSet(plugins); @@ -249,6 +249,7 @@ public void RestoreApplicationPlugins(IEnumerable plugins, IAppContext con if (active && !PluginActive(p.Identity)) { + pluginLoadingCallback?.Invoke(p.Identity); LoadPlugin(p.Identity, context); } } diff --git a/src/MW5.Plugins/Services/IGeoprocessingService.cs b/src/MW5.Plugins/Services/IGeoprocessingService.cs index 953660dd..d932e081 100644 --- a/src/MW5.Plugins/Services/IGeoprocessingService.cs +++ b/src/MW5.Plugins/Services/IGeoprocessingService.cs @@ -1,4 +1,6 @@ -namespace MW5.Plugins.Services +using MW5.Api.Interfaces; + +namespace MW5.Plugins.Services { public interface IGeoprocessingService { @@ -23,5 +25,7 @@ public interface IGeoprocessingService void CopyShapes(); void PasteShapes(); void CutShapes(); + + void ReplaceShape(int layerHandle, int shapeIndex, IGeometry newGeometry); } } diff --git a/src/MW5.Plugins/Services/ILayerEditingService.cs b/src/MW5.Plugins/Services/ILayerEditingService.cs index f737574e..67dd6f96 100644 --- a/src/MW5.Plugins/Services/ILayerEditingService.cs +++ b/src/MW5.Plugins/Services/ILayerEditingService.cs @@ -4,6 +4,11 @@ public interface ILayerEditingService { void ToggleVectorLayerEditing(); bool SaveLayerChanges(int layerHandle); + bool DiscardLayerChanges(int layerHandle); void CreateLayer(); + void ToggleSnapToActiveLayer(); + void ToggleSnapToAllLayers(); + void ToggleSnapToSegments(); + void ToggleSnapToVertices(); } } diff --git a/src/MW5.Plugins/Services/IPluginManager.cs b/src/MW5.Plugins/Services/IPluginManager.cs index 03a43a67..6f831fc9 100644 --- a/src/MW5.Plugins/Services/IPluginManager.cs +++ b/src/MW5.Plugins/Services/IPluginManager.cs @@ -67,6 +67,6 @@ public interface IPluginManager bool PluginActive(PluginIdentity identity); - void RestoreApplicationPlugins(IEnumerable plugins, IAppContext context); + void RestoreApplicationPlugins(IEnumerable plugins, IAppContext context, Action pluginLoadingCallback = null); } } diff --git a/src/MW5.PostBuild/MW5.PostBuild.csproj b/src/MW5.PostBuild/MW5.PostBuild.csproj index c62b2630..77649f2c 100644 --- a/src/MW5.PostBuild/MW5.PostBuild.csproj +++ b/src/MW5.PostBuild/MW5.PostBuild.csproj @@ -21,6 +21,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 TRACE @@ -29,6 +30,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 diff --git a/src/MW5.Projections/MW5.Projections.csproj b/src/MW5.Projections/MW5.Projections.csproj index fd415cb4..d870a07e 100644 --- a/src/MW5.Projections/MW5.Projections.csproj +++ b/src/MW5.Projections/MW5.Projections.csproj @@ -25,6 +25,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 bin\x86\Release\ @@ -34,6 +35,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 true diff --git a/src/MW5.Services/Concrete/ProjectService.cs b/src/MW5.Services/Concrete/ProjectService.cs index 8966728a..9d1b0cbd 100644 --- a/src/MW5.Services/Concrete/ProjectService.cs +++ b/src/MW5.Services/Concrete/ProjectService.cs @@ -169,9 +169,18 @@ private bool TryCloseCore() public bool Save() { + var args = new CancelEventArgs(); + string filename = _filename; - var state = State; - + var state = State; + + _broadcaster.BroadcastEvent(p => p.ProjectSaving_, this, args); + if (args.Cancel) + { + return false; + } + + bool newProject = state == ProjectState.NotSaved || state == ProjectState.Empty; if (newProject) { @@ -188,6 +197,7 @@ public bool Save() // OnProjectChanged(); } + _broadcaster.BroadcastEvent(p => p.ProjectSaved_, this, args); return true; } diff --git a/src/MW5.Services/MW5.Services.csproj b/src/MW5.Services/MW5.Services.csproj index c61b3cf5..80bd3571 100644 --- a/src/MW5.Services/MW5.Services.csproj +++ b/src/MW5.Services/MW5.Services.csproj @@ -23,6 +23,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 bin\x86\Release\ @@ -32,6 +33,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 true diff --git a/src/MW5.Shared/MW5.Shared.csproj b/src/MW5.Shared/MW5.Shared.csproj index 5d076dad..6f6feef8 100644 --- a/src/MW5.Shared/MW5.Shared.csproj +++ b/src/MW5.Shared/MW5.Shared.csproj @@ -23,6 +23,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 bin\x86\Release\ @@ -32,6 +33,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 true diff --git a/src/MW5.Tiles/Helpers/BrutileHelper.cs b/src/MW5.Tiles/Helpers/BrutileHelper.cs index b7dd5855..777dde9a 100644 --- a/src/MW5.Tiles/Helpers/BrutileHelper.cs +++ b/src/MW5.Tiles/Helpers/BrutileHelper.cs @@ -54,7 +54,8 @@ public static WmsSource CreateWmsLayer(this WmsCapabilities capabilities, IEnume return null; } - var box = layer.ChooseBoundingBox(mapProjection); + // First try the layer, as a fallback, use the bounding box defined in the capabilities + var box = layer.ChooseBoundingBox(mapProjection) ?? capabilities.Capability.Layer.ChooseBoundingBox(mapProjection); if (box == null) { MessageService.Current.Info("Failed to determine bounds of the layer."); @@ -82,8 +83,7 @@ public static WmsSource CreateWmsLayer(this WmsCapabilities capabilities, IEnume private static string GetFormat(this WmsCapabilities capabilities) { - var list = capabilities.Capability.Request.GetMap.Format; - return list.Count > 2 ? list[2] : list.FirstOrDefault(); + return capabilities.Capability.Request.GetMap.Format.DefaultIfEmpty("image/png").FirstOrDefault(); } private static string GetLayers(this IEnumerable layers) diff --git a/src/MW5.Tiles/Helpers/WmsCapabilitiesCache.cs b/src/MW5.Tiles/Helpers/WmsCapabilitiesCache.cs index 5b8af5cf..0c712d68 100644 --- a/src/MW5.Tiles/Helpers/WmsCapabilitiesCache.cs +++ b/src/MW5.Tiles/Helpers/WmsCapabilitiesCache.cs @@ -17,7 +17,7 @@ internal static class WmsCapabilitiesCache { private static string GetXmlPath(string url) { - url = url.Replace('/', '_').Replace(':', '_'); + url = System.Uri.UnescapeDataString(url.Replace('/', '_').Replace(':', '_').Replace('?', '_')); return ConfigPathHelper.GetWmsCachePath() + url + ".xml"; } diff --git a/src/MW5.Tiles/MW5.Tiles.csproj b/src/MW5.Tiles/MW5.Tiles.csproj index a4dc3e27..f4abae66 100644 --- a/src/MW5.Tiles/MW5.Tiles.csproj +++ b/src/MW5.Tiles/MW5.Tiles.csproj @@ -23,6 +23,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 bin\x86\Release\ @@ -32,6 +33,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 true @@ -52,9 +54,8 @@ MinimumRecommendedRules.ruleset - - ..\packages\BruTile.0.22.1\lib\portable-net45+win+WindowsPhoneApp81+Xamarin.iOS10+MonoAndroid10+MonoTouch10\BruTile.dll - True + + ..\packages\BruTile.2.0.2\lib\net45\BruTile.dll True diff --git a/src/MW5.Tiles/packages.config b/src/MW5.Tiles/packages.config index 25b797a1..4514e472 100644 --- a/src/MW5.Tiles/packages.config +++ b/src/MW5.Tiles/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/src/MW5.Tools/MW5.Tools.csproj b/src/MW5.Tools/MW5.Tools.csproj index 549bcdca..cd15d667 100644 --- a/src/MW5.Tools/MW5.Tools.csproj +++ b/src/MW5.Tools/MW5.Tools.csproj @@ -21,6 +21,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 bin\x86\Release\ @@ -30,6 +31,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 true diff --git a/src/MW5.UI/Docking/DockPanelKeys.cs b/src/MW5.UI/Docking/DockPanelKeys.cs index ce45ca20..b06847ea 100644 --- a/src/MW5.UI/Docking/DockPanelKeys.cs +++ b/src/MW5.UI/Docking/DockPanelKeys.cs @@ -6,7 +6,7 @@ namespace MW5.UI.Docking { - internal class DockPanelKeys + public class DockPanelKeys { public const string Legend = "DockPanelLegend"; public const string Preview = "DockPanelPreview"; diff --git a/src/MW5.UI/MW5.UI.csproj b/src/MW5.UI/MW5.UI.csproj index 4b152ea7..58e24174 100644 --- a/src/MW5.UI/MW5.UI.csproj +++ b/src/MW5.UI/MW5.UI.csproj @@ -21,6 +21,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 bin\x86\Release\ @@ -30,6 +31,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 true diff --git a/src/MW5.sln b/src/MW5.sln index c57f24bc..e02dbb5c 100644 --- a/src/MW5.sln +++ b/src/MW5.sln @@ -1,7 +1,6 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +VisualStudioVersion = 15.0.28010.2026 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MW5.Api", "MW5.Api\MW5.Api.csproj", "{8AAD34B3-8EF3-485F-A04D-ED2C07D8F1DF}" EndProject diff --git a/src/MW5/AppContext.cs b/src/MW5/AppContext.cs index 7d987a11..94b4126f 100644 --- a/src/MW5/AppContext.cs +++ b/src/MW5/AppContext.cs @@ -223,7 +223,7 @@ internal void Init( Logger.Current.Trace("End AppContext.Init()"); } - internal void InitPlugins(IConfigService configService) + internal void InitPlugins(IConfigService configService, Action pluginLoadingCallback) { var pluginManager = PluginManager; pluginManager.PluginUnloaded += ManagerPluginUnloaded; @@ -232,7 +232,7 @@ internal void InitPlugins(IConfigService configService) var guids = configService.Config.ApplicationPlugins; if (guids != null) { - PluginManager.RestoreApplicationPlugins(guids, this); + PluginManager.RestoreApplicationPlugins(guids, this, pluginLoadingCallback); } } diff --git a/src/MW5/Controls/LegendPresenter.cs b/src/MW5/Controls/LegendPresenter.cs index c214595c..68403bdb 100644 --- a/src/MW5/Controls/LegendPresenter.cs +++ b/src/MW5/Controls/LegendPresenter.cs @@ -105,7 +105,18 @@ public override void RunCommand(LegendCommand command) var group = Legend.Groups.ItemByHandle(_legendDockPanel.SelectedGroupHandle); if (group != null) { - if (MessageService.Current.Ask("Do you want to remove group: " + group.Text + "?")) + var cancel = false; + foreach (var layer in group.Layers) + { + var args = new Plugins.Events.LayerCancelEventArgs(layer.Handle); + _broadcaster.BroadcastEvent(p => p.BeforeRemoveLayer_, Legend, args); + if (args.Cancel) + { + cancel = true; + break; + } + } + if (!cancel && MessageService.Current.Ask("Do you want to remove group: " + group.Text + "?")) { Legend.Groups.Remove(group.Handle); } @@ -148,12 +159,16 @@ public override void RunCommand(LegendCommand command) if (layer != null) { if (!LayerSerializationHelper.CheckFilename(layer.Filename)) + LayerSerializationHelper.SaveSettings(layer); + else { - MessageService.Current.Info("Can not save settings for a non-disk based layer."); - return; + if (!layer.SaveOptions("", true, "")) + { + MessageService.Current.Info("Can not save settings for a non-disk based layer."); + return; + } } - - LayerSerializationHelper.SaveSettings(layer); + } break; } @@ -163,13 +178,17 @@ public override void RunCommand(LegendCommand command) if (layer != null) { - if (!LayerSerializationHelper.CheckFilename(layer.Filename)) + if (LayerSerializationHelper.CheckFilename(layer.Filename)) + LayerSerializationHelper.LoadSettings(layer, _broadcaster, false); + else { - MessageService.Current.Info("Can not load settings for a non-disk based layer."); - return; + string desc=""; + if (!layer.LoadOptions("", ref desc)) + { + MessageService.Current.Info("Can not load settings for a non-disk based layer."); + return; + } } - - LayerSerializationHelper.LoadSettings(layer, _broadcaster, false); } _context.Legend.Redraw(LegendRedraw.LegendAndMap); diff --git a/src/MW5/Forms/SplashView.Designer.cs b/src/MW5/Forms/SplashView.Designer.cs index cd600a97..1dd0752a 100644 --- a/src/MW5/Forms/SplashView.Designer.cs +++ b/src/MW5/Forms/SplashView.Designer.cs @@ -66,6 +66,8 @@ private void InitializeComponent() // // panel1 // + this.panel1.AutoSize = true; + this.panel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel1.Controls.Add(this.pictureBox1); this.panel1.Controls.Add(this.lblVersion); @@ -95,6 +97,7 @@ private void InitializeComponent() this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); this.ResumeLayout(false); + this.PerformLayout(); } diff --git a/src/MW5/Helpers/MapInitializer.cs b/src/MW5/Helpers/MapInitializer.cs index 27a93e7f..5a35cb4d 100644 --- a/src/MW5/Helpers/MapInitializer.cs +++ b/src/MW5/Helpers/MapInitializer.cs @@ -92,6 +92,7 @@ public static void Initialize(this IMap map) map.Identifier.HotTracking = true; map.GeometryEditor.HighlightVertices = LayerSelectionMode.NoLayer; map.GeometryEditor.SnapBehavior = LayerSelectionMode.NoLayer; + map.GeometryEditor.SnapMode = SnapMode.VerticesAndLines; map.Identifier.HotTracking = false; map.ResizeBehavior = ResizeBehavior.KeepScale; map.Measuring.UndoButton = UndoShortcut.CtrlZ; diff --git a/src/MW5/MW5.csproj b/src/MW5/MW5.csproj index c49812c8..4c336995 100644 --- a/src/MW5/MW5.csproj +++ b/src/MW5/MW5.csproj @@ -43,6 +43,7 @@ MinimumRecommendedRules.ruleset true Off + 7.1 TRACE @@ -53,6 +54,7 @@ MinimumRecommendedRules.ruleset true On + 7.1 MW5.ico diff --git a/src/MW5/Views/MainPresenter.cs b/src/MW5/Views/MainPresenter.cs index 2890ea5f..9c39883a 100644 --- a/src/MW5/Views/MainPresenter.cs +++ b/src/MW5/Views/MainPresenter.cs @@ -100,7 +100,8 @@ public MainPresenter( _menuUpdater = new MenuUpdater(_context, PluginIdentity.Default); SplashView.Instance.ShowStatus("Loading plugins"); - appContext.InitPlugins(configService); // must be called after docking is initialized + // must be called after docking is initialized: + appContext.InitPlugins(configService, p => SplashView.Instance.ShowStatus($"Loading plugins: {p.Name}")); // this will display progress updates and debug window // file based-logger is already working diff --git a/src/Plugins/MW5.DebugWindow/MW5.DebugWindow.csproj b/src/Plugins/MW5.DebugWindow/MW5.DebugWindow.csproj index dd3b0a16..43f7a7ec 100644 --- a/src/Plugins/MW5.DebugWindow/MW5.DebugWindow.csproj +++ b/src/Plugins/MW5.DebugWindow/MW5.DebugWindow.csproj @@ -21,6 +21,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 TRACE @@ -29,6 +30,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 true diff --git a/src/Plugins/MW5.Identifier/MW5.Identifier.csproj b/src/Plugins/MW5.Identifier/MW5.Identifier.csproj index ee2fa967..0b3e7430 100644 --- a/src/Plugins/MW5.Identifier/MW5.Identifier.csproj +++ b/src/Plugins/MW5.Identifier/MW5.Identifier.csproj @@ -21,6 +21,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 TRACE @@ -29,6 +30,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 true diff --git a/src/Plugins/MW5.ImageRegistration/MW5.ImageRegistration.csproj b/src/Plugins/MW5.ImageRegistration/MW5.ImageRegistration.csproj index 643efb85..bbeda399 100644 --- a/src/Plugins/MW5.ImageRegistration/MW5.ImageRegistration.csproj +++ b/src/Plugins/MW5.ImageRegistration/MW5.ImageRegistration.csproj @@ -21,6 +21,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 TRACE @@ -29,6 +30,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 true diff --git a/src/Plugins/MW5.Printing/MW5.Printing.csproj b/src/Plugins/MW5.Printing/MW5.Printing.csproj index 3dbf8df2..1d434616 100644 --- a/src/Plugins/MW5.Printing/MW5.Printing.csproj +++ b/src/Plugins/MW5.Printing/MW5.Printing.csproj @@ -45,6 +45,7 @@ ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules true false + 7.1 TRACE @@ -60,6 +61,7 @@ ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules true false + 7.1 true diff --git a/src/Plugins/MW5.Repository/MW5.Repository.csproj b/src/Plugins/MW5.Repository/MW5.Repository.csproj index 2e22c7b7..1daadfea 100644 --- a/src/Plugins/MW5.Repository/MW5.Repository.csproj +++ b/src/Plugins/MW5.Repository/MW5.Repository.csproj @@ -21,6 +21,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 TRACE @@ -29,6 +30,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 true diff --git a/src/Plugins/MW5.ShapeEditor/Context/ContextMenuPresenter.cs b/src/Plugins/MW5.ShapeEditor/Context/ContextMenuPresenter.cs index fa6858e2..f4a59cbe 100644 --- a/src/Plugins/MW5.ShapeEditor/Context/ContextMenuPresenter.cs +++ b/src/Plugins/MW5.ShapeEditor/Context/ContextMenuPresenter.cs @@ -4,6 +4,7 @@ using MW5.Plugins.Interfaces; using MW5.Plugins.Mvp; using MW5.Plugins.Services; +using MW5.Plugins.ShapeEditor.Menu; namespace MW5.Plugins.ShapeEditor.Context { @@ -12,8 +13,9 @@ public class ContextMenuPresenter : CommandDispatcher173, 21 - 328, 25 + 332, 24 \ No newline at end of file diff --git a/src/Plugins/MW5.ShapeEditor/Context/EditorCommand.cs b/src/Plugins/MW5.ShapeEditor/Context/EditorCommand.cs index 200cf185..c6c546f2 100644 --- a/src/Plugins/MW5.ShapeEditor/Context/EditorCommand.cs +++ b/src/Plugins/MW5.ShapeEditor/Context/EditorCommand.cs @@ -38,5 +38,9 @@ public enum EditorCommand UndoPoint = 33, FinishShape = 34, CancelShape = 35, + + SnapToVertices = 63, + SnapToLinesAndVertices = 64, + SnapToLines = 65 } } diff --git a/src/Plugins/MW5.ShapeEditor/MW5.ShapeEditor.csproj b/src/Plugins/MW5.ShapeEditor/MW5.ShapeEditor.csproj index e346ae92..6bf29816 100644 --- a/src/Plugins/MW5.ShapeEditor/MW5.ShapeEditor.csproj +++ b/src/Plugins/MW5.ShapeEditor/MW5.ShapeEditor.csproj @@ -21,6 +21,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 TRACE @@ -29,6 +30,7 @@ x86 prompt MinimumRecommendedRules.ruleset + 7.1 true @@ -235,6 +237,12 @@ + + + + + +