Change to public about TizenSynchronizationContext
authorSeungkeun Lee <sngn.lee@samsung.com>
Tue, 19 Apr 2016 05:12:12 +0000 (14:12 +0900)
committerSeungkeun Lee <sngn.lee@samsung.com>
Tue, 19 Apr 2016 05:12:12 +0000 (14:12 +0900)
 - The application developer could use this class to post task into tizen main loop
 - Others SynchronizationContext are also public classes

Change-Id: Id3e4781c9d7059be22b21f6327d6674f6c75009f

Tizen.Applications/Tizen.Applications/TizenSynchronizationContext.cs [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 6f7d0bc..ca70228
@@ -13,23 +13,47 @@ using System.Threading;
 
 namespace Tizen.Applications
 {
-    internal class TizenSynchronizationContext : SynchronizationContext
+
+    /// <summary>
+    /// Provides a synchronization context for the Tizen application model.
+    /// </summary>
+    public class TizenSynchronizationContext : SynchronizationContext
     {
         private readonly Interop.Glib.GSourceFunc _wrapperHandler;
         private readonly Object _transactionLock = new Object();
         private readonly Dictionary<int, Action> _handlerMap = new Dictionary<int, Action>();
         private int _transactionId = 0;
 
-        private TizenSynchronizationContext()
+        /// <summary>
+        /// Initializes a new instance of the TizenSynchronizationContext class.
+        /// </summary>
+        public TizenSynchronizationContext()
         {
             _wrapperHandler = new Interop.Glib.GSourceFunc(Handler);
         }
 
+        /// <summary>
+        /// Initilizes a new TizenSynchronizationContext and install into current thread
+        /// </summary>
+        /// <remarks>
+        /// It is equivalent
+        /// <code>
+        /// SetSynchronizationContext(new TizenSynchronizationContext());
+        /// </code>
+        /// </remarks>
         public static void Initialize()
         {
             SetSynchronizationContext(new TizenSynchronizationContext());
         }
 
+
+        /// <summary>
+        /// Dispatches an asynchronous message to a Tizen main loop.
+        /// </summary>
+        /// <param name="d"><see cref="System.Threading.SendOrPostCallback"/>The SendOrPostCallback delegate to call.</param>
+        /// <param name="state"><see cref="System.Object"/>The object passed to the delegate.</param>
+        /// <remarks>
+        /// The Post method starts an asynchronous request to post a message.</remarks>
         public override void Post(SendOrPostCallback d, object state)
         {
             Post(() =>
@@ -38,6 +62,13 @@ namespace Tizen.Applications
             });
         }
 
+        /// <summary>
+        /// Dispatches a synchronous message to a Tizen main loop
+        /// </summary>
+        /// <param name="d"><see cref="System.Threading.SendOrPostCallback"/>The SendOrPostCallback delegate to call.</param>
+        /// <param name="state"><see cref="System.Object"/>The object passed to the delegate.</param>
+        /// <remarks>
+        /// The Send method starts a synchronous request to send a message.</remarks>
         public override void Send(SendOrPostCallback d, object state)
         {
             var mre = new ManualResetEvent(false);
@@ -64,7 +95,7 @@ namespace Tizen.Applications
             }
         }
 
-        public void Post(Action action)
+        private void Post(Action action)
         {
             int id = 0;
             lock (_transactionLock)
@@ -75,7 +106,7 @@ namespace Tizen.Applications
             Interop.Glib.IdleAdd(_wrapperHandler, (IntPtr)id);
         }
 
-        public bool Handler(IntPtr userData)
+        private bool Handler(IntPtr userData)
         {
             int key = (int)userData;
             if (_handlerMap.ContainsKey(key))