Skip to content

Commit 8fd03e2

Browse files
author
radioman
committed
GMap.NET.Core: updated sqlite dll v96/3.8.8.3 & some cleanup...
1 parent 1126c04 commit 8fd03e2

39 files changed

+41487
-4045
lines changed

GMap.NET vs10.sln

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GMap.NET.WindowsPresentatio
2525
EndProject
2626
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TemplatedBinding", "Testing\TemplatedBinding\TemplatedBinding.csproj", "{C7CD6A76-D941-493F-91F8-6222AB87BECA}"
2727
EndProject
28-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF-GMapControlNew", "Testing\WPF-GMapControlNew\WPF-GMapControlNew.csproj", "{B5A673B4-6286-4150-A536-1C16F3B8DC8B}"
29-
EndProject
3028
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo.StreetView", "Testing\Demo.StreetView\Demo.StreetView.csproj", "{B6E411A2-DFD8-461E-8207-BDBA405264CA}"
3129
EndProject
3230
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BigMapMaker", "Testing\BigMapMaker\BigMapMaker.csproj", "{A6E9D42C-935B-44D0-9FB0-E2E0319627D1}"
@@ -83,8 +81,6 @@ Global
8381
{644FE7D4-0184-400F-B2D7-99CB41360658}.Release|Any CPU.Build.0 = Release|Any CPU
8482
{C7CD6A76-D941-493F-91F8-6222AB87BECA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
8583
{C7CD6A76-D941-493F-91F8-6222AB87BECA}.Release|Any CPU.ActiveCfg = Release|Any CPU
86-
{B5A673B4-6286-4150-A536-1C16F3B8DC8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
87-
{B5A673B4-6286-4150-A536-1C16F3B8DC8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
8884
{B6E411A2-DFD8-461E-8207-BDBA405264CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
8985
{B6E411A2-DFD8-461E-8207-BDBA405264CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
9086
{A6E9D42C-935B-44D0-9FB0-E2E0319627D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
@@ -118,7 +114,6 @@ Global
118114
{A2E07A76-8B2C-41A2-B23E-EA31AE94D706} = {4071E6E4-D401-4EF2-94B0-6F5257088116}
119115
{83195AEF-0071-471C-9E8B-E67211F5D028} = {4071E6E4-D401-4EF2-94B0-6F5257088116}
120116
{C7CD6A76-D941-493F-91F8-6222AB87BECA} = {A24009F2-84ED-4F0A-BC1C-8B05F474986A}
121-
{B5A673B4-6286-4150-A536-1C16F3B8DC8B} = {A24009F2-84ED-4F0A-BC1C-8B05F474986A}
122117
{B6E411A2-DFD8-461E-8207-BDBA405264CA} = {A24009F2-84ED-4F0A-BC1C-8B05F474986A}
123118
{A6E9D42C-935B-44D0-9FB0-E2E0319627D1} = {A24009F2-84ED-4F0A-BC1C-8B05F474986A}
124119
{097FA134-51A5-4801-AADD-A1914EAA32FF} = {A24009F2-84ED-4F0A-BC1C-8B05F474986A}

GMap.NET.Core/GMap.NET.CacheProviders/SQLitePureImageCache.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ namespace GMap.NET.CacheProviders
1515

1616
#if !MONO
1717
using System.Data.SQLite;
18+
using GMap.NET.Internals;
1819
#else
1920
using SQLiteConnection = Mono.Data.Sqlite.SqliteConnection;
2021
using SQLiteTransaction = Mono.Data.Sqlite.SqliteTransaction;
@@ -39,9 +40,14 @@ static System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, R
3940
{
4041
if(args.Name.StartsWith("System.Data.SQLite", StringComparison.OrdinalIgnoreCase))
4142
{
42-
string rootDir = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + Path.DirectorySeparatorChar + "GMap.NET" + Path.DirectorySeparatorChar;
43-
string dllDir = rootDir + "DllCache" + Path.DirectorySeparatorChar;
44-
string dll = dllDir + "SQLite_v84_NET" + Environment.Version.Major + "_" + (IntPtr.Size == 8 ? "x64" : "x86") + Path.DirectorySeparatorChar + "System.Data.SQLite.DLL";
43+
string appDataDir = CacheLocator.GetApplicationDataFolderPath();
44+
if(string.IsNullOrEmpty(appDataDir))
45+
{
46+
return null;
47+
}
48+
49+
string dllDir = appDataDir + "DllCache" + Path.DirectorySeparatorChar;
50+
string dll = dllDir + "SQLite_v96_NET" + Environment.Version.Major + "_" + (IntPtr.Size == 8 ? "x64" : "x86") + Path.DirectorySeparatorChar + "System.Data.SQLite.DLL";
4551
if(!File.Exists(dll))
4652
{
4753
string dir = Path.GetDirectoryName(dll);

GMap.NET.Core/GMap.NET.Internals/Cache.cs

Lines changed: 44 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -41,54 +41,68 @@ public static string Location
4141
}
4242

4343
static void Reset()
44+
{
45+
string appDataLocation = GetApplicationDataFolderPath();
46+
47+
#if !PocketPC
48+
// http://greatmaps.codeplex.com/discussions/403151
49+
// by default Network Service don't have disk write access
50+
if(string.IsNullOrEmpty(appDataLocation))
51+
{
52+
GMaps.Instance.Mode = AccessMode.ServerOnly;
53+
GMaps.Instance.UseDirectionsCache = false;
54+
GMaps.Instance.UseGeocoderCache = false;
55+
GMaps.Instance.UsePlacemarkCache = false;
56+
GMaps.Instance.UseRouteCache = false;
57+
GMaps.Instance.UseUrlCache = false;
58+
}
59+
else
60+
#endif
61+
{
62+
Location = appDataLocation;
63+
}
64+
}
65+
66+
public static string GetApplicationDataFolderPath()
4467
{
4568
#if !PocketPC
46-
string GetFolderPath = string.Empty;
47-
4869
bool isSystem = false;
4970
try
5071
{
51-
using (var identity = System.Security.Principal.WindowsIdentity.GetCurrent())
52-
{
53-
if(identity != null)
54-
{
55-
isSystem = identity.IsSystem;
56-
}
57-
}
72+
using(var identity = System.Security.Principal.WindowsIdentity.GetCurrent())
73+
{
74+
if(identity != null)
75+
{
76+
isSystem = identity.IsSystem;
77+
}
78+
}
5879
}
5980
catch(Exception ex)
6081
{
61-
Trace.WriteLine("SQLitePureImageCache, WindowsIdentity.GetCurrent: " + ex);
82+
Trace.WriteLine("SQLitePureImageCache, WindowsIdentity.GetCurrent: " + ex);
6283
}
63-
84+
85+
string path = string.Empty;
86+
6487
// https://greatmaps.codeplex.com/workitem/16112
65-
if (isSystem)
88+
if(isSystem)
6689
{
67-
GetFolderPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.CommonApplicationData);
90+
path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.CommonApplicationData);
6891
}
6992
else
7093
{
71-
GetFolderPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData);
94+
path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData);
7295
}
96+
#else
97+
path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData);
98+
#endif
7399

74-
// http://greatmaps.codeplex.com/discussions/403151
75-
// by default Network Service don't have disk write access
76-
if(string.IsNullOrEmpty(GetFolderPath))
77-
{
78-
GMaps.Instance.Mode = AccessMode.ServerOnly;
79-
GMaps.Instance.UseDirectionsCache = false;
80-
GMaps.Instance.UseGeocoderCache = false;
81-
GMaps.Instance.UsePlacemarkCache = false;
82-
GMaps.Instance.UseRouteCache = false;
83-
GMaps.Instance.UseUrlCache = false;
84-
}
85-
else
100+
if(!string.IsNullOrEmpty(path))
86101
{
87-
Location = GetFolderPath + Path.DirectorySeparatorChar + "GMap.NET" + Path.DirectorySeparatorChar;
102+
path += Path.DirectorySeparatorChar + "GMap.NET" + Path.DirectorySeparatorChar;
88103
}
89-
#else
90-
location = System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + Path.DirectorySeparatorChar + "GMap.NET" + Path.DirectorySeparatorChar;
91-
#endif
104+
105+
return path;
92106
}
93107

94108
public static bool Delay = false;

GMap.NET.Core/GMap.NET.Internals/FastResourceLock.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* along with Process Hacker. If not, see <http://www.gnu.org/licenses/>.
2121
*/
2222

23-
#define DEFER_EVENT_CREATION
23+
//#define DEFER_EVENT_CREATION
2424
//#define ENABLE_STATISTICS
2525
//#define RIGOROUS_CHECKS
2626

87.1 KB
Binary file not shown.
16 KB
Binary file not shown.
75.5 KB
Binary file not shown.
53.3 KB
Binary file not shown.

GMap.NET.WindowsPresentation/GMap.NET.WindowsPresentation.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,9 @@
7474
<Compile Include="..\GMap.NET.Core\Properties\VersionInfo.cs">
7575
<Link>Properties\VersionInfo.cs</Link>
7676
</Compile>
77-
<Compile Include="GMap.NET.WindowsPresentation\etc\CompositionTargetEx.cs" />
7877
<Compile Include="GMap.NET.WindowsPresentation\GMapMarker.cs" />
7978
<Compile Include="GMap.NET.WindowsPresentation\GMapPolygon.cs" />
8079
<Compile Include="GMap.NET.WindowsPresentation\GMapRoute.cs" />
81-
<Compile Include="GMap.NET.WindowsPresentation\etc\PerfTimer.cs" />
82-
<Compile Include="GMap.NET.WindowsPresentation\etc\QuadTree.cs" />
8380
<Compile Include="GMap.NET.WindowsPresentation\GMapImage.cs" />
8481
<Compile Include="GMap.NET.WindowsPresentation\GMapControl.cs" />
8582
<Compile Include="Properties\AssemblyInfo.cs">

GMap.NET.WindowsPresentation/GMap.NET.WindowsPresentation/etc/CompositionTargetEx.cs

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)