Skip to content

Commit

Permalink
GMap.NET.Core: updated sqlite dll v96/3.8.8.3 & some cleanup...
Browse files Browse the repository at this point in the history
  • Loading branch information
radioman committed May 16, 2015
1 parent 1126c04 commit 8fd03e2
Show file tree
Hide file tree
Showing 39 changed files with 41,487 additions and 4,045 deletions.
5 changes: 0 additions & 5 deletions GMap.NET vs10.sln
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GMap.NET.WindowsPresentatio
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TemplatedBinding", "Testing\TemplatedBinding\TemplatedBinding.csproj", "{C7CD6A76-D941-493F-91F8-6222AB87BECA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WPF-GMapControlNew", "Testing\WPF-GMapControlNew\WPF-GMapControlNew.csproj", "{B5A673B4-6286-4150-A536-1C16F3B8DC8B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo.StreetView", "Testing\Demo.StreetView\Demo.StreetView.csproj", "{B6E411A2-DFD8-461E-8207-BDBA405264CA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BigMapMaker", "Testing\BigMapMaker\BigMapMaker.csproj", "{A6E9D42C-935B-44D0-9FB0-E2E0319627D1}"
Expand Down Expand Up @@ -83,8 +81,6 @@ Global
{644FE7D4-0184-400F-B2D7-99CB41360658}.Release|Any CPU.Build.0 = Release|Any CPU
{C7CD6A76-D941-493F-91F8-6222AB87BECA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C7CD6A76-D941-493F-91F8-6222AB87BECA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B5A673B4-6286-4150-A536-1C16F3B8DC8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B5A673B4-6286-4150-A536-1C16F3B8DC8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B6E411A2-DFD8-461E-8207-BDBA405264CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B6E411A2-DFD8-461E-8207-BDBA405264CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A6E9D42C-935B-44D0-9FB0-E2E0319627D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -118,7 +114,6 @@ Global
{A2E07A76-8B2C-41A2-B23E-EA31AE94D706} = {4071E6E4-D401-4EF2-94B0-6F5257088116}
{83195AEF-0071-471C-9E8B-E67211F5D028} = {4071E6E4-D401-4EF2-94B0-6F5257088116}
{C7CD6A76-D941-493F-91F8-6222AB87BECA} = {A24009F2-84ED-4F0A-BC1C-8B05F474986A}
{B5A673B4-6286-4150-A536-1C16F3B8DC8B} = {A24009F2-84ED-4F0A-BC1C-8B05F474986A}
{B6E411A2-DFD8-461E-8207-BDBA405264CA} = {A24009F2-84ED-4F0A-BC1C-8B05F474986A}
{A6E9D42C-935B-44D0-9FB0-E2E0319627D1} = {A24009F2-84ED-4F0A-BC1C-8B05F474986A}
{097FA134-51A5-4801-AADD-A1914EAA32FF} = {A24009F2-84ED-4F0A-BC1C-8B05F474986A}
Expand Down
12 changes: 9 additions & 3 deletions GMap.NET.Core/GMap.NET.CacheProviders/SQLitePureImageCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace GMap.NET.CacheProviders

#if !MONO
using System.Data.SQLite;
using GMap.NET.Internals;
#else
using SQLiteConnection = Mono.Data.Sqlite.SqliteConnection;
using SQLiteTransaction = Mono.Data.Sqlite.SqliteTransaction;
Expand All @@ -39,9 +40,14 @@ static System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, R
{
if(args.Name.StartsWith("System.Data.SQLite", StringComparison.OrdinalIgnoreCase))
{
string rootDir = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + Path.DirectorySeparatorChar + "GMap.NET" + Path.DirectorySeparatorChar;
string dllDir = rootDir + "DllCache" + Path.DirectorySeparatorChar;
string dll = dllDir + "SQLite_v84_NET" + Environment.Version.Major + "_" + (IntPtr.Size == 8 ? "x64" : "x86") + Path.DirectorySeparatorChar + "System.Data.SQLite.DLL";
string appDataDir = CacheLocator.GetApplicationDataFolderPath();
if(string.IsNullOrEmpty(appDataDir))
{
return null;
}

string dllDir = appDataDir + "DllCache" + Path.DirectorySeparatorChar;
string dll = dllDir + "SQLite_v96_NET" + Environment.Version.Major + "_" + (IntPtr.Size == 8 ? "x64" : "x86") + Path.DirectorySeparatorChar + "System.Data.SQLite.DLL";
if(!File.Exists(dll))
{
string dir = Path.GetDirectoryName(dll);
Expand Down
74 changes: 44 additions & 30 deletions GMap.NET.Core/GMap.NET.Internals/Cache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,54 +41,68 @@ public static string Location
}

static void Reset()
{
string appDataLocation = GetApplicationDataFolderPath();

#if !PocketPC
// http://greatmaps.codeplex.com/discussions/403151
// by default Network Service don't have disk write access
if(string.IsNullOrEmpty(appDataLocation))
{
GMaps.Instance.Mode = AccessMode.ServerOnly;
GMaps.Instance.UseDirectionsCache = false;
GMaps.Instance.UseGeocoderCache = false;
GMaps.Instance.UsePlacemarkCache = false;
GMaps.Instance.UseRouteCache = false;
GMaps.Instance.UseUrlCache = false;
}
else
#endif
{
Location = appDataLocation;
}
}

public static string GetApplicationDataFolderPath()
{
#if !PocketPC
string GetFolderPath = string.Empty;

bool isSystem = false;
try
{
using (var identity = System.Security.Principal.WindowsIdentity.GetCurrent())
{
if(identity != null)
{
isSystem = identity.IsSystem;
}
}
using(var identity = System.Security.Principal.WindowsIdentity.GetCurrent())
{
if(identity != null)
{
isSystem = identity.IsSystem;
}
}
}
catch(Exception ex)
{
Trace.WriteLine("SQLitePureImageCache, WindowsIdentity.GetCurrent: " + ex);
Trace.WriteLine("SQLitePureImageCache, WindowsIdentity.GetCurrent: " + ex);
}


string path = string.Empty;

// https://greatmaps.codeplex.com/workitem/16112
if (isSystem)
if(isSystem)
{
GetFolderPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.CommonApplicationData);
path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.CommonApplicationData);
}
else
{
GetFolderPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData);
path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData);
}
#else
path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData);
#endif

// http://greatmaps.codeplex.com/discussions/403151
// by default Network Service don't have disk write access
if(string.IsNullOrEmpty(GetFolderPath))
{
GMaps.Instance.Mode = AccessMode.ServerOnly;
GMaps.Instance.UseDirectionsCache = false;
GMaps.Instance.UseGeocoderCache = false;
GMaps.Instance.UsePlacemarkCache = false;
GMaps.Instance.UseRouteCache = false;
GMaps.Instance.UseUrlCache = false;
}
else
if(!string.IsNullOrEmpty(path))
{
Location = GetFolderPath + Path.DirectorySeparatorChar + "GMap.NET" + Path.DirectorySeparatorChar;
path += Path.DirectorySeparatorChar + "GMap.NET" + Path.DirectorySeparatorChar;
}
#else
location = System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData) + Path.DirectorySeparatorChar + "GMap.NET" + Path.DirectorySeparatorChar;
#endif

return path;
}

public static bool Delay = false;
Expand Down
2 changes: 1 addition & 1 deletion GMap.NET.Core/GMap.NET.Internals/FastResourceLock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* along with Process Hacker. If not, see <http://www.gnu.org/licenses/>.
*/

#define DEFER_EVENT_CREATION
//#define DEFER_EVENT_CREATION
//#define ENABLE_STATISTICS
//#define RIGOROUS_CHECKS

Expand Down
Binary file modified GMap.NET.Core/Resources/System.Data.SQLite.x64.NET2.dll.gz
Binary file not shown.
Binary file modified GMap.NET.Core/Resources/System.Data.SQLite.x64.NET4.dll.gz
Binary file not shown.
Binary file modified GMap.NET.Core/Resources/System.Data.SQLite.x86.NET2.dll.gz
Binary file not shown.
Binary file modified GMap.NET.Core/Resources/System.Data.SQLite.x86.NET4.dll.gz
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,9 @@
<Compile Include="..\GMap.NET.Core\Properties\VersionInfo.cs">
<Link>Properties\VersionInfo.cs</Link>
</Compile>
<Compile Include="GMap.NET.WindowsPresentation\etc\CompositionTargetEx.cs" />
<Compile Include="GMap.NET.WindowsPresentation\GMapMarker.cs" />
<Compile Include="GMap.NET.WindowsPresentation\GMapPolygon.cs" />
<Compile Include="GMap.NET.WindowsPresentation\GMapRoute.cs" />
<Compile Include="GMap.NET.WindowsPresentation\etc\PerfTimer.cs" />
<Compile Include="GMap.NET.WindowsPresentation\etc\QuadTree.cs" />
<Compile Include="GMap.NET.WindowsPresentation\GMapImage.cs" />
<Compile Include="GMap.NET.WindowsPresentation\GMapControl.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
Expand Down

This file was deleted.

Loading

0 comments on commit 8fd03e2

Please sign in to comment.