Merge "[NUI] Fix Build warnings: GetFunctionPointerFor" preview1-00204
authordongsug song <dongsug.song@samsung.com>
Thu, 14 Sep 2017 06:45:08 +0000 (06:45 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Thu, 14 Sep 2017 06:45:08 +0000 (06:45 +0000)
1  2 
src/Tizen.NUI/src/internal/Application.cs

@@@ -1134,29 -1079,10 +1134,29 @@@ namespace Tizen.NU
              return ret;
          }
  
 -        //Removed from v0.2.33
 -        /*public bool AddIdle(System.Delegate func)
 +
 +        public static Application NewApplication(string[] args, string stylesheet, Application.WindowMode windowMode)
 +        {
 +            NUILog.Debug(" NewApplication(string[] args, string stylesheet, Application.WindowMode windowMode) is called! ");
 +
 +            Application ret = New(args, stylesheet, (Application.WindowMode)windowMode);
 +            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
 +
 +            // we've got an application now connect the signals
 +            ret.SetupDelegates();
 +            // set the singleton
 +            _instance = ret;
 +            return _instance;
 +        }
 +
 +        /// <summary>
 +        /// Ensures that the function passed in is called from the main loop when it is idle.
 +        /// </summary>
 +        /// <param name="func">The function to call</param>
 +        /// <returns>true if added successfully, false otherwise</returns>
 +        public bool AddIdle(System.Delegate func)
          {
-             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
+             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
              System.IntPtr ip2 = NDalicManualPINVOKE.MakeCallback(new System.Runtime.InteropServices.HandleRef(this, ip));
  
              bool ret = NDalicPINVOKE.Application_AddIdle(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip2));