mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-04 14:08:32 +00:00
Minor code improvements
This commit is contained in:
parent
6b25260536
commit
472658a6d9
19 changed files with 301 additions and 175 deletions
15
SampleApps/SampleApplication/App.config
Normal file
15
SampleApps/SampleApplication/App.config
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||
<section name="SampleApplication.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<applicationSettings>
|
||||
<SampleApplication.Properties.Settings>
|
||||
<setting name="UsePersistentCache" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
</SampleApplication.Properties.Settings>
|
||||
</applicationSettings>
|
||||
</configuration>
|
||||
|
|
@ -1,13 +1,9 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using MapControl;
|
||||
using Caching;
|
||||
using MapControl;
|
||||
|
||||
namespace SampleApplication
|
||||
{
|
||||
|
|
@ -15,13 +11,9 @@ namespace SampleApplication
|
|||
{
|
||||
public MainWindow()
|
||||
{
|
||||
bool usePersistentCache = false;
|
||||
|
||||
if (usePersistentCache)
|
||||
if (Properties.Settings.Default.UsePersistentCache)
|
||||
{
|
||||
string appDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
|
||||
string cachePath = Path.Combine(appDataFolder, "MapControl", "Cache.fdb");
|
||||
TileImageLoader.Cache = new FileDbCache("MapControlCache", cachePath) { AutoFlush = false };
|
||||
TileImageLoader.CreateCache<FileDbCache>();
|
||||
}
|
||||
|
||||
InitializeComponent();
|
||||
|
|
|
|||
35
SampleApps/SampleApplication/Properties/Settings.Designer.cs
generated
Normal file
35
SampleApps/SampleApplication/Properties/Settings.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.225
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace SampleApplication.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||
public bool UsePersistentCache {
|
||||
get {
|
||||
return ((bool)(this["UsePersistentCache"]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="SampleApplication.Properties" GeneratedClassName="Settings">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="UsePersistentCache" Type="System.Boolean" Scope="Application">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
|
|
@ -54,6 +54,11 @@
|
|||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SampleItems.cs" />
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
|
@ -84,6 +89,13 @@
|
|||
<Name>MapControl</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
|
|||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("SurfaceApplication")]
|
||||
[assembly: AssemblyDescription("WPF Map Control Sample SurfaceApplication")]
|
||||
[assembly: AssemblyDescription("WPF Map Control Sample Surface Application")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Clemens Fischer")]
|
||||
[assembly: AssemblyProduct("WPF Map Control")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue