Fix lifecycles
[platform/core/csapi/tizenfx.git] / Tizen.Applications / Tizen.Applications / Service.cs
1 /// Copyright 2016 by Samsung Electronics, Inc.,
2 ///
3 /// This software is the confidential and proprietary information
4 /// of Samsung Electronics, Inc. ("Confidential Information"). You
5 /// shall not disclose such Confidential Information and shall use
6 /// it only in accordance with the terms of the license agreement
7 /// you entered into with Samsung.
8
9
10 using System;
11
12 namespace Tizen.Applications
13 {
14     /// <summary>
15     /// 
16     /// </summary>
17     public abstract class Service : Context
18     {
19         /// <summary>
20         /// 
21         /// </summary>
22         public event EventHandler Created;
23
24         /// <summary>
25         /// 
26         /// </summary>
27         public event EventHandler Started;
28
29         /// <summary>
30         /// 
31         /// </summary>
32         public event EventHandler Destroyed;
33
34         internal void OnCreate(AppControl control)
35         {
36             _control = control;
37             if (Created != null)
38             {
39                 Created(this, EventArgs.Empty);
40             }
41         }
42
43         internal void OnStart()
44         {
45             if (Started != null)
46             {
47                 Started(this, EventArgs.Empty);
48             }
49         }
50
51         internal void OnDestroy()
52         {
53             if (Destroyed != null)
54             {
55                 Destroyed(this, EventArgs.Empty);
56             }
57         }
58     }
59 }