-
Notifications
You must be signed in to change notification settings - Fork 51
/
MyApplication.cs
63 lines (58 loc) · 1.68 KB
/
MyApplication.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Copyright M. Griffie <nexus@nexussays.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
using System;
using Acr.UserDialogs;
using Foundation;
using nexus.core.logging;
using nexus.protocols.ble;
using UIKit;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
namespace ble.net.sampleapp.ios
{
public class MyApplication
{
public const Boolean IS_DEBUG =
#if DEBUG
true;
#else
false;
#endif
internal static void Main( String[] args )
{
// ReSharper disable once ConditionIsAlwaysTrueOrFalse
if(IS_DEBUG)
{
#pragma warning disable 162
SystemLog.Instance.AddSink(
entry =>
{
var message = entry.FormatAsString();
if(entry.Severity == LogLevel.Error)
{
Console.Error.WriteLine( message );
}
else
{
Console.Out.WriteLine( message );
}
} );
#pragma warning restore 162
}
UIApplication.Main( args, null, nameof(AppDelegate) );
}
}
[Register( "AppDelegate" )]
public class AppDelegate : FormsApplicationDelegate
{
public override Boolean FinishedLaunching( UIApplication app, NSDictionary options )
{
Forms.Init();
LoadApplication( new FormsApp( BluetoothLowEnergyAdapter.ObtainDefaultAdapter(), UserDialogs.Instance ) );
return base.FinishedLaunching( app, options );
}
}
}