Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
199b955
Merge branch 'release/v5.4.0'
pmeems Jan 19, 2019
609ec8b
Merge tag 'v5.4.0' into develop
pmeems Jan 19, 2019
3af3b0a
Making v5.4.1
pmeems Mar 1, 2019
d1b85a9
MW5CORE-221 Adding segment/vertex snapping options to the shape edito…
mathijs-dumon Dec 14, 2018
9fb08ac
MW5Core-222 Adding BeforeShapeEditEvent broadcast when removing selec…
mathijs-dumon Nov 7, 2018
9a489f5
MW5CORE-224 MW5CORE-225 MW5CORE-226 MW5CORE-227 MW5CORE-228 MW5CORE-2…
mathijs-dumon May 13, 2019
3283613
MW5CORE-238 Adding ReloadFromSource method to IVectorLayer which pres…
mathijs-dumon May 13, 2019
e3518b1
MW5CORE-223 Added IsPartOfSet function on IFeature interface and impl…
mathijs-dumon Dec 14, 2018
7d037f8
MW5CORE-231 Splash window now shows what plugins it is loading
mathijs-dumon May 13, 2019
d10253f
MW5CORE-232 Made DockPanelKeys class public so plugins can locate cor…
mathijs-dumon Dec 14, 2018
7c47d5c
MW5CORE-233 Fixing invalid temp file names for WMS, improving detecti…
mathijs-dumon Jan 21, 2019
24e107b
MW5CORE-220 Exposing selectable property to FeatureSet
mathijs-dumon May 9, 2019
fe3aeb5
MW5CORE-234 Small improvements to installer script. Adding install lo…
mathijs-dumon Jan 21, 2019
2a699bb
MW5CORE-235 Adding a replace shape method to the GeoProcessingService…
mathijs-dumon May 9, 2019
4e6cf3f
MW5CORE-237 Adding layer removed events when a group is removed from …
mathijs-dumon May 9, 2019
144d03d
Adding missing MapWinGIS methods, attributes & events
mathijs-dumon May 9, 2019
89ac8cc
Switch MW.API to VS2017
mathijs-dumon May 13, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*.suo
*.user
*.sln.docstates
.vs/

# Build results

Expand Down
5 changes: 3 additions & 2 deletions install/MapWindow5.iss
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/MW5.Api/Concrete/Feature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ public int Index
get { return _shapeIndex; }
}

public bool IsPartOfSet(IFeatureSet set)
{
return set?.InternalObject == InternalShapefile;
}

public IGeometry Geometry
{
get
Expand Down
2 changes: 2 additions & 0 deletions src/MW5.Api/Concrete/FeatureSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 7 additions & 1 deletion src/MW5.Api/Concrete/GeometryEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
5 changes: 5 additions & 0 deletions src/MW5.Api/Concrete/Layer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@ public bool Deserialize(string state)
return Map.DeserializeLayer(LayerHandle, state);
}

public void ReloadOgrLayerFromSource()
{
Map.ReloadOgrLayerFromSource(LayerHandle);
}

/// <summary>
/// Changes selection of the shapefile adding new shapes using the specified mode
/// </summary>
Expand Down
11 changes: 10 additions & 1 deletion src/MW5.Api/Concrete/VectorLayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions src/MW5.Api/Enums/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,13 @@ public enum LayerSelectionMode
ActiveLayer = 2,
}

public enum SnapMode
{
Vertices = 0,
VerticesAndLines = 1,
Lines = 2
}

public enum LengthDisplay
{
Metric = 0,
Expand Down
6 changes: 6 additions & 0 deletions src/MW5.Api/Events/AfterShapeEditEventArgs.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using AxMapWinGIS;
using MapWinGIS;
using MW5.Api.Enums;

namespace MW5.Api.Events
Expand All @@ -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;
Expand Down
11 changes: 10 additions & 1 deletion src/MW5.Api/Events/BeforeDeleteShapeEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 9 additions & 1 deletion src/MW5.Api/Events/BeforeShapeEditEventArgs.cs
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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; }
Expand Down
40 changes: 40 additions & 0 deletions src/MW5.Api/Events/BeforeVertexDigitizedEventArgs.cs
Original file line number Diff line number Diff line change
@@ -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; }
}
}
}
5 changes: 4 additions & 1 deletion src/MW5.Api/Events/LayerProjectionIsEmptyEventArgs.cs
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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;
}
}
5 changes: 4 additions & 1 deletion src/MW5.Api/Events/ProjectionChangedEventArgs.cs
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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; }
Expand Down
8 changes: 4 additions & 4 deletions src/MW5.Api/Events/ValidateShapeEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace MW5.Api.Events
{
public class ValidateShapeEventArgs : EventArgs
public class ValidateShapeEventArgs : EventArgs, ICancellableEvent
{
private readonly _DMapEvents_ValidateShapeEvent _args;

Expand All @@ -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
Expand Down
7 changes: 7 additions & 0 deletions src/MW5.Api/Interfaces/ICancellableEvent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace MW5.Api.Interfaces
{
public interface ICancellableEvent
{
bool Cancel { get; }
}
}
3 changes: 2 additions & 1 deletion src/MW5.Api/Interfaces/IFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
1 change: 1 addition & 0 deletions src/MW5.Api/Interfaces/IFeatureSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
1 change: 1 addition & 0 deletions src/MW5.Api/Interfaces/IGeometryEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
2 changes: 2 additions & 0 deletions src/MW5.Api/Interfaces/ILayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public interface ILayer: IDynamicVisibilityTarget

string SizeInfo { get; }

void ReloadOgrLayerFromSource();

#region Not implemented

// bool SkipOnSaving { get; set; }
Expand Down
1 change: 1 addition & 0 deletions src/MW5.Api/Interfaces/IMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public interface IMap : IMuteMap
{
event EventHandler<EventArgs> MapCursorChanged;
event EventHandler<AfterShapeEditEventArgs> AfterShapeEdit;
event EventHandler<BeforeVertexDigitizedEventArgs> BeforeVertexDigitized;
event EventHandler<BackgroundLoadingFinishedEventArgs> BackgroundLoadingFinished;
event EventHandler<BackgroundLoadingStartedEventArgs> BackgroundLoadingStarted;
event EventHandler<BeforeDeleteShapeEventArgs> BeforeDeleteShape;
Expand Down
1 change: 1 addition & 0 deletions src/MW5.Api/Interfaces/IVectorLayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ComplexGeometryType> AvailableGeometryTypes {get;}
void SetActiveGeometryType(GeometryType type, ZValueType zValue);
GeometryType ActiveGeometryType { get; }
Expand Down
2 changes: 1 addition & 1 deletion src/MW5.Api/Legend/Events/DatasourceCancelEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace MW5.Api.Legend.Events
{
public class DatasourceCancelEventArgs: CancelEventArgs
public class DatasourceCancelEventArgs: CancelEventArgs, ICancellableEvent
{
public DatasourceCancelEventArgs(ILayerSource datasource)
{
Expand Down
5 changes: 3 additions & 2 deletions src/MW5.Api/Legend/Events/LayerCancelEventArgs.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using System;
using MW5.Api.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

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; }
Expand Down
Loading