Skip to content

Commit 58764d7

Browse files
committed
Adjust ISession's and Session's namespace (SharpMap#9)
1 parent 4aacd0f commit 58764d7

3 files changed

Lines changed: 109 additions & 108 deletions

File tree

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using GeoAPI;
22

3-
namespace SharpMap.CoordinateSystems
3+
namespace SharpMap
44
{
55
/// <summary>
66
/// A SharpMap session
@@ -11,6 +11,7 @@ public interface ISession
1111
/// The geometry services instance
1212
/// </summary>
1313
IGeometryServices GeometryServices { get; }
14+
1415
/// <summary>
1516
/// Gets the coordinate system services instance
1617
/// </summary>
@@ -21,10 +22,11 @@ public interface ISession
2122
/// </summary>
2223
ICoordinateSystemRepository CoordinateSystemRepository { get; }
2324

24-
25+
#region Fluent configuration
2526
ISession SetGeometryServices(IGeometryServices geometryServices);
2627
ISession SetCoordinateSystemServices(ICoordinateSystemServices geometryServices);
2728
ISession SetCoordinateSystemRepository(ICoordinateSystemRepository geometryServices);
28-
ISession ReadConfiguration();
29+
#endregion
30+
2931
}
3032
}
Lines changed: 102 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,103 @@
1-
using System;
2-
using Common.Logging;
3-
using GeoAPI;
4-
5-
namespace SharpMap.CoordinateSystems
6-
{
7-
/// <summary>
8-
/// A SharpMap Session class
9-
/// </summary>
10-
public class Session : ISession
11-
{
12-
private static ICoordinateSystemRepository _repository;
13-
private ICoordinateSystemServices _coordinateSystemServices;
14-
15-
/// <summary>
16-
/// Static constructor
17-
/// </summary>
18-
static Session()
19-
{
20-
Instance = new Session();
21-
}
22-
23-
/// <summary>
24-
/// Gets a value indicating the current instance
25-
/// </summary>
26-
public static ISession Instance { get; private set; }
27-
28-
/// <summary>
29-
/// The geometry services instance
30-
/// </summary>
31-
public IGeometryServices GeometryServices { get; set; }
32-
33-
/// <summary>
34-
/// Gets the coordinate system services instance
35-
/// </summary>
36-
public ICoordinateSystemServices CoordinateSystemServices
37-
{
38-
get
39-
{
40-
if (_coordinateSystemServices == null)
41-
throw new InvalidOperationException("Must declare a coordinate system services object!");
42-
return _coordinateSystemServices;
43-
}
44-
set { _coordinateSystemServices = value; }
45-
}
46-
47-
/// <summary>
48-
/// Gets the coordinate system repository
49-
/// </summary>
50-
public ICoordinateSystemRepository CoordinateSystemRepository
51-
{
52-
get { return _repository ?? CoordinateSystemServices as ICoordinateSystemRepository; }
53-
set { _repository = value; }
54-
}
55-
56-
#region Fluent
57-
58-
/// <summary>
59-
/// Method to set the geometry services class
60-
/// </summary>
61-
/// <param name="geometryServices">The geometry services class</param>
62-
/// <returns>A reference to this session</returns>
63-
public ISession SetGeometryServices(IGeometryServices geometryServices)
64-
{
65-
GeometryServices = geometryServices;
66-
return this;
67-
}
68-
69-
/// <summary>
70-
/// Method to set the coordinate system services class
71-
/// </summary>
72-
/// <param name="coordinateSystemServices">The coordinate system services class</param>
73-
/// <returns>A reference to this session</returns>
74-
public ISession SetCoordinateSystemServices(ICoordinateSystemServices coordinateSystemServices)
75-
{
76-
CoordinateSystemServices = coordinateSystemServices;
77-
return this;
78-
}
79-
80-
/// <summary>
81-
/// Method to set the coordinate system repository class
82-
/// </summary>
83-
/// <param name="coordinateSystemRepository">The coordinate system repository class</param>
84-
/// <returns>A reference to this session</returns>
85-
public ISession SetCoordinateSystemRepository(ICoordinateSystemRepository coordinateSystemRepository)
86-
{
87-
CoordinateSystemRepository = coordinateSystemRepository;
88-
return this;
89-
}
90-
91-
/// <summary>
92-
/// Method to read the configuration
93-
/// </summary>
94-
/// <returns>A reference to this session</returns>
95-
public ISession ReadConfiguration()
96-
{
97-
var log = LogManager.GetLogger<ISession>();
98-
log.Warn(f => f("Configuring SharpMap session via ReadConfiguration currently not supported"));
99-
return this;
100-
}
101-
#endregion
102-
}
1+
using System;
2+
using Common.Logging;
3+
using GeoAPI;
4+
5+
namespace SharpMap
6+
{
7+
/// <summary>
8+
/// A SharpMap Session class
9+
/// </summary>
10+
public class Session : ISession
11+
{
12+
private static ICoordinateSystemRepository _repository;
13+
private ICoordinateSystemServices _coordinateSystemServices;
14+
15+
/// <summary>
16+
/// Static constructor
17+
/// </summary>
18+
static Session()
19+
{
20+
Instance = new Session();
21+
}
22+
23+
/// <summary>
24+
/// Gets a value indicating the current instance
25+
/// </summary>
26+
public static ISession Instance { get; private set; }
27+
28+
/// <summary>
29+
/// The geometry services instance
30+
/// </summary>
31+
public IGeometryServices GeometryServices { get; set; }
32+
33+
/// <summary>
34+
/// Gets the coordinate system services instance
35+
/// </summary>
36+
public ICoordinateSystemServices CoordinateSystemServices
37+
{
38+
get
39+
{
40+
if (_coordinateSystemServices == null)
41+
throw new InvalidOperationException("Must declare a coordinate system services object!");
42+
return _coordinateSystemServices;
43+
}
44+
set { _coordinateSystemServices = value; }
45+
}
46+
47+
/// <summary>
48+
/// Gets the coordinate system repository
49+
/// </summary>
50+
public ICoordinateSystemRepository CoordinateSystemRepository
51+
{
52+
get { return _repository ?? CoordinateSystemServices as ICoordinateSystemRepository; }
53+
set { _repository = value; }
54+
}
55+
56+
#region Fluent
57+
58+
/// <summary>
59+
/// Method to set the geometry services class
60+
/// </summary>
61+
/// <param name="geometryServices">The geometry services class</param>
62+
/// <returns>A reference to this session</returns>
63+
public ISession SetGeometryServices(IGeometryServices geometryServices)
64+
{
65+
GeometryServices = geometryServices;
66+
return this;
67+
}
68+
69+
/// <summary>
70+
/// Method to set the coordinate system services class
71+
/// </summary>
72+
/// <param name="coordinateSystemServices">The coordinate system services class</param>
73+
/// <returns>A reference to this session</returns>
74+
public ISession SetCoordinateSystemServices(ICoordinateSystemServices coordinateSystemServices)
75+
{
76+
CoordinateSystemServices = coordinateSystemServices;
77+
return this;
78+
}
79+
80+
/// <summary>
81+
/// Method to set the coordinate system repository class
82+
/// </summary>
83+
/// <param name="coordinateSystemRepository">The coordinate system repository class</param>
84+
/// <returns>A reference to this session</returns>
85+
public ISession SetCoordinateSystemRepository(ICoordinateSystemRepository coordinateSystemRepository)
86+
{
87+
CoordinateSystemRepository = coordinateSystemRepository;
88+
return this;
89+
}
90+
91+
/// <summary>
92+
/// Method to read the configuration
93+
/// </summary>
94+
/// <returns>A reference to this session</returns>
95+
public ISession ReadConfiguration()
96+
{
97+
var log = LogManager.GetLogger<ISession>();
98+
log.Warn(f => f("Configuring SharpMap session via ReadConfiguration currently not supported"));
99+
return this;
100+
}
101+
#endregion
102+
}
103103
}

SharpMap/SharpMap.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
1717
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
1818
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">../</SolutionDir>
19-
2019
</PropertyGroup>
2120
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2221
<DebugSymbols>true</DebugSymbols>
@@ -111,8 +110,6 @@
111110
<Compile Include="CoordinateSystems\CoordinateSystemExtensions.cs" />
112111
<Compile Include="CoordinateSystems\CoordinateSystemServices.cs" />
113112
<Compile Include="CoordinateSystems\ICoordinateSystemRepository.cs" />
114-
<Compile Include="CoordinateSystems\ISession.cs" />
115-
<Compile Include="CoordinateSystems\Session.cs" />
116113
<Compile Include="CoordinateSystems\Transformations\GeometryTransform.cs" />
117114
<Compile Include="CoordinateSystems\Transformations\GeometryTransformDotSpatial.cs" />
118115
<Compile Include="Data\FeatureDataSet.cs">
@@ -142,6 +139,7 @@
142139
<Compile Include="Data\Providers\SqlServer2008.cs" />
143140
<Compile Include="Data\Providers\WFSClient.cs" />
144141
<Compile Include="Geometries\GeoAPIEx.cs" />
142+
<Compile Include="ISession.cs" />
145143
<Compile Include="Layers\AsyncLayerProxyLayer.cs" />
146144
<Compile Include="Layers\DuplicateLayerException.cs" />
147145
<Compile Include="Layers\GdiImageLayer.cs" />
@@ -162,6 +160,7 @@
162160
<Compile Include="Layers\VariableLayerCollection.cs" />
163161
<Compile Include="Layers\VectorLayer.cs" />
164162
<Compile Include="Rendering\Thematics\FontSizeTheme.cs" />
163+
<Compile Include="Session.cs" />
165164
<Compile Include="Styles\VisibilityUnits.cs" />
166165
<Compile Include="Layers\WmsLayer.cs" />
167166
<Compile Include="Map\MapViewportGuard.cs" />

0 commit comments

Comments
 (0)