[EflSharp] Update Circle and efl cs files (#995)
[platform/core/csapi/tizenfx.git] / test / SampleTelephony / Program.cs
1 /*
2  *  Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *  Licensed under the Apache License, Version 2.0 (the "License");
5  *  you may not use this file except in compliance with the License.
6  *  You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *  Unless required by applicable law or agreed to in writing, software
11  *  distributed under the License is distributed on an "AS IS" BASIS,
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *  See the License for the specific language governing permissions and
14  *  limitations under the License
15  */
16
17 using Xamarin.Forms;
18 using Tizen;
19 using Tizen.System;
20 using Tizen.Telephony;
21
22 namespace XamarinForTizen.Tizen
23 {
24     internal static class Globals
25     {
26         internal static string LogTag = "TelephonyTest";
27         internal static SlotHandle slotHandle = null;
28     }
29     public class App : Application
30     {
31         private static bool s_isTelephonySupported = false;
32         public App()
33         {
34             SystemInfo.TryGetValue("http://tizen.org/feature/network.telephony", out s_isTelephonySupported);
35             if (s_isTelephonySupported)
36             {
37                 Log.Debug(Globals.LogTag, "Telephony feature check = " + s_isTelephonySupported);
38                 MainPage = new NavigationPage(new MainPage());
39             }
40
41             else
42             {
43                 Log.Debug(Globals.LogTag, "Telephony feature is not supported");
44             }
45         }
46
47         protected override void OnStart()
48         {
49             // Handle when your app starts
50         }
51
52         protected override void OnSleep()
53         {
54             // Handle when your app sleeps
55         }
56
57         protected override void OnResume()
58         {
59             // Handle when your app resumes
60         }
61     }
62
63     class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication
64     {
65         private static App _app;
66         protected override void OnCreate()
67         {
68             base.OnCreate();
69
70             Log.Debug(Globals.LogTag, "OnCreate()");
71             _app = new App();
72             LoadApplication(_app);
73         }
74
75         public static App getApp()
76         {
77             return _app;
78         }
79         static void Main(string[] args)
80         {
81             var app = new Program();
82             global::Xamarin.Forms.Platform.Tizen.Forms.Init(app);
83             app.Run(args);
84         }
85     }
86 }