Release 4.0.1.38
[platform/core/csapi/tizenfx.git] / test / Tizen.CallManager.Test / 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.CallManager;
21
22 namespace XamarinForTizen.Tizen
23 {
24     internal static class Globals
25     {
26         internal static string LogTag = "CallManagerTest";
27         internal static CmClientHandle cmHandle = null;
28         internal static string Number = "9900816947";
29         internal static bool DialTest = false;
30         internal static bool HoldTest = false;
31     }
32     public class App : Application
33     {
34         private static bool s_isTelephonySupported = false;
35         public App()
36         {
37             SystemInfo.TryGetValue("http://tizen.org/feature/network.telephony", out s_isTelephonySupported);
38             if (s_isTelephonySupported)
39             {
40                 Log.Debug(Globals.LogTag, "Telephony feature check = " + s_isTelephonySupported);
41                 MainPage = new NavigationPage(new MainPage());
42             }
43
44             else
45             {
46                 Log.Debug(Globals.LogTag, "Telephony feature is not supported");
47             }
48         }
49
50         protected override void OnStart()
51         {
52             // Handle when your app starts
53         }
54
55         protected override void OnSleep()
56         {
57             // Handle when your app sleeps
58         }
59
60         protected override void OnResume()
61         {
62             // Handle when your app resumes
63         }
64     }
65
66     class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication
67     {
68         private static App _app;
69         protected override void OnCreate()
70         {
71             base.OnCreate();
72
73             Log.Debug(Globals.LogTag, "OnCreate()");
74             _app = new App();
75             LoadApplication(_app);
76         }
77
78         public static App getApp()
79         {
80             return _app;
81         }
82         static void Main(string[] args)
83         {
84             var app = new Program();
85             global::Xamarin.Forms.Platform.Tizen.Forms.Init(app);
86             app.Run(args);
87         }
88     }
89 }