-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathApp.xaml.cs
30 lines (27 loc) · 1.1 KB
/
App.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// This source file is covered by the LICENSE.TXT file in the root folder of the SDK.
using System;
using Ptv.XServer.Demo.Properties;
using Ptv.XServer.Controls.Map.Tools;
namespace Ptv.XServer.Demo
{
/// <summary> Interaction logic for App.xaml. </summary>
public partial class App
{
/// <summary>
/// When accessing PTV xServer in the cloud, inject the default token
/// when no user or password is provided through the configuration file.
/// </summary>
private static void SetDefaultPtvXServerInternetToken()
{
if (XServerUrl.IsXServerInternet(XServerUrl.Complete(Settings.Default.XUrl, "XMap")) && !String.IsNullOrEmpty(DefaultXServerInternetToken.Value) && String.IsNullOrEmpty(Settings.Default.XToken))
Settings.Default["XToken"] = DefaultXServerInternetToken.Value; // overwrite settings with default access token
}
/// <summary>
/// Static application initializer.
/// </summary>
static App()
{
SetDefaultPtvXServerInternetToken();
}
}
}