Skip to content

Commit 98e7474

Browse files
committed
[branches/1.0] Added local Resharper definitions and some minor code cleanup
git-tfs-id: [https://tfs.codeplex.com/tfs/TFS01]$/SharpMap/Branches/1.0;C104788
1 parent d61b8e2 commit 98e7474

3 files changed

Lines changed: 16 additions & 10 deletions

File tree

SharpMap.sln

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 2010
3+
# Visual Studio 2012
44
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpMap", "SharpMap\SharpMap.csproj", "{C83777FC-AABB-47D9-911F-D76255D4D541}"
55
EndProject
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpMap.UI", "SharpMap.UI\SharpMap.UI.csproj", "{DD1CC1DB-4BF9-4C88-A100-733D84795F3A}"
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\UnitTests.csproj", "{0C76DD99-AC5D-47C0-B76F-CE70092A9AC7}"
99
EndProject
10-
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "DemoWebSite", "Examples\DemoWebSite", "{32ECD993-CB5A-4AD9-8C8F-45C73A088C13}"
10+
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "DemoWebSite", "Examples\DemoWebSite\", "{32ECD993-CB5A-4AD9-8C8F-45C73A088C13}"
1111
ProjectSection(WebsiteProperties) = preProject
1212
SccProjectName = ""
1313
SccAuxPath = ""
@@ -92,6 +92,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MSBuild", "MSBuild", "{A5E4
9292
EndProject
9393
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpMap.Layers.HeatLayer", "SharpMap.Layers.HeatLayer\SharpMap.Layers.HeatLayer.csproj", "{47F790C2-6DC0-4A09-9026-FC81A09FD6A3}"
9494
EndProject
95+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{AEBB513B-1509-439F-BA86-FA9413BF8D8C}"
96+
ProjectSection(SolutionItems) = preProject
97+
SharpMap.sln.DotSettings = SharpMap.sln.DotSettings
98+
EndProjectSection
99+
EndProject
95100
Global
96101
GlobalSection(SolutionConfigurationPlatforms) = preSolution
97102
Debug|.NET = Debug|.NET

SharpMap.sln.DotSettings

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /&gt;</s:String></wpf:ResourceDictionary>

SharpMap/Map/Map.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
using System.Drawing.Drawing2D;
2222
using System.Globalization;
2323
using System.IO;
24+
using System.Linq;
2425
using GeoAPI.Geometries;
2526
using SharpMap.Layers;
2627
using SharpMap.Rendering;
@@ -44,7 +45,7 @@ public class Map : IDisposable
4445
{
4546
static Map()
4647
{
47-
if (!(System.ComponentModel.LicenseManager.UsageMode == System.ComponentModel.LicenseUsageMode.Designtime))
48+
if (System.ComponentModel.LicenseManager.UsageMode != System.ComponentModel.LicenseUsageMode.Designtime)
4849
{
4950
// We have to do this initialization with reflection due to the fact that NTS can reference an older version of GeoAPI and redirection
5051
// is not available at design time..
@@ -105,7 +106,7 @@ public Map(Size size)
105106
{
106107
_mapViewportGuard = new MapViewPortGuard(size, 0d, Double.MaxValue);
107108

108-
if (!(System.ComponentModel.LicenseManager.UsageMode == System.ComponentModel.LicenseUsageMode.Designtime))
109+
if (System.ComponentModel.LicenseManager.UsageMode != System.ComponentModel.LicenseUsageMode.Designtime)
109110
{
110111
Factory = GeoAPI.GeometryServiceProvider.Instance.CreateGeometryFactory(_srid);
111112
}
@@ -588,7 +589,7 @@ public void RenderMap(Graphics g, LayerCollectionType layerCollectionType, bool
588589
g.PageUnit = GraphicsUnit.Pixel;
589590

590591

591-
ILayer[] layerList = new ILayer[lc.Count];
592+
var layerList = new ILayer[lc.Count];
592593
lc.CopyTo(layerList, 0);
593594

594595
foreach (ILayer layer in layerList)
@@ -629,10 +630,10 @@ public void RenderMap(Graphics g, LayerCollectionType layerCollectionType, bool
629630
/// <returns>Instance of <see cref="Map"/></returns>
630631
public Map Clone()
631632
{
632-
Map clone = null;
633+
Map clone;
633634
lock (MapTransform)
634635
{
635-
clone = new Map()
636+
clone = new Map
636637
{
637638
BackColor = BackColor,
638639
#pragma warning disable 612,618
@@ -718,9 +719,7 @@ private void RenderDisclaimer(Graphics g)
718719
/// <returns>IEnumerable</returns>
719720
public IEnumerable<ILayer> FindLayer(string layername)
720721
{
721-
foreach (ILayer l in Layers)
722-
if (l.LayerName.Contains(layername))
723-
yield return l;
722+
return Layers.Where(l => l.LayerName.Contains(layername));
724723
}
725724

726725
/// <summary>

0 commit comments

Comments
 (0)