[ACR-564] deprecate unused API
[platform/core/csapi/tizenfx.git] / src / ElmSharp / ElmSharp / EcoreSynchronizationContext.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 System;
18 using System.Threading;
19
20 namespace ElmSharp
21 {
22
23     /// <summary>
24     /// Provides a synchronization context for the EFL application.
25     /// </summary>
26     /// <since_tizen> preview </since_tizen>
27     [Obsolete("This has been deprecated in API12")]
28     public class EcoreSynchronizationContext : SynchronizationContext
29     {
30         /// <summary>
31         /// Initializes a new instance of the EcoreSynchronizationContext class.
32         /// </summary>
33         /// <since_tizen> preview </since_tizen>
34         [Obsolete("This has been deprecated in API12")]
35         public EcoreSynchronizationContext()
36         {
37         }
38
39         /// <summary>
40         /// Initilizes a new EcoreSynchronizationContext and installs into the current thread.
41         /// </summary>
42         /// <remarks>
43         /// It is equivalent
44         /// <code>
45         /// SetSynchronizationContext(new EcoreSynchronizationContext());
46         /// </code>
47         /// </remarks>
48         /// <since_tizen> preview </since_tizen>
49         [Obsolete("This has been deprecated in API12")]
50         public static void Initialize()
51         {
52             SetSynchronizationContext(new EcoreSynchronizationContext());
53         }
54
55         /// <summary>
56         /// Dispatches an asynchronous message to a Ecore main loop.
57         /// </summary>
58         /// <param name="d">The <see cref="T:System.Threading.SendOrPostCallback"/> delegate to call.</param>
59         /// <param name="state">The object passed to the delegate.</param>
60         /// <remarks>The Post method starts an asynchronous request to post a message.</remarks>
61         /// <since_tizen> preview </since_tizen>
62         [Obsolete("This has been deprecated in API12")]
63         public override void Post(SendOrPostCallback d, object state)
64         {
65             EcoreMainloop.PostAndWakeUp(() =>
66             {
67                 d(state);
68             });
69         }
70
71         /// <summary>
72         /// Dispatches an synchronous message to a Ecore main loop.
73         /// </summary>
74         /// <param name="d">The <see cref="T:System.Threading.SendOrPostCallback"/> delegate to call.</param>
75         /// <param name="state">The object passed to the delegate.</param>
76         /// <remarks>
77         /// The Send method starts a synchronous request to send a message.</remarks>
78         /// <since_tizen> preview </since_tizen>
79         [Obsolete("This has been deprecated in API12")]
80         public override void Send(SendOrPostCallback d, object state)
81         {
82             EcoreMainloop.Send(() =>
83             {
84                 d(state);
85             });
86         }
87     }
88 }