コード例 #1
0
ファイル: CfrV8Value.cs プロジェクト: 386845154a/NanUI-1
        /// <summary>
        /// Create a new CfrV8Value object of type Date. This function should only be
        /// called from within the scope of a CfrRenderProcessHandler,
        /// CfrV8Handler or CfrV8Accessor callback, or in combination with calling
        /// enter() and exit() on a stored CfrV8Context reference.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_v8_capi.h">cef/include/capi/cef_v8_capi.h</see>.
        /// </remarks>
        public static CfrV8Value CreateDate(CfrTime date)
        {
            var call = new CfxV8ValueCreateDateRemoteCall();

            call.date = CfrObject.Unwrap(date).ptr;
            call.RequestExecution();
            return(CfrV8Value.Wrap(new RemotePtr(call.__retval)));
        }
コード例 #2
0
ファイル: CfrV8Value.cs プロジェクト: MeetOct/ChromiumFX
        /// <summary>
        /// Create a new CfrV8Value object of type Date. This function should only be
        /// called from within the scope of a CfrRenderProcessHandler,
        /// CfrV8Handler or CfrV8Accessor callback, or in combination with calling
        /// enter() and exit() on a stored CfrV8Context reference.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_v8_capi.h">cef/include/capi/cef_v8_capi.h</see>.
        /// </remarks>
        public static CfrV8Value CreateDate(CfrTime date)
        {
            var call = new CfxV8ValueCreateDateRenderProcessCall();

            call.date = CfrObject.Unwrap(date);
            call.RequestExecution(CfxRemoteCallContext.CurrentContext.connection);
            return(CfrV8Value.Wrap(call.__retval));
        }
コード例 #3
0
        /// <summary>
        /// Create a new CfrV8Value object of type Date. This function should only be
        /// called from within the scope of a CfrRenderProcessHandler,
        /// CfrV8Handler or CfrV8Accessor callback, or in combination with calling
        /// enter() and exit() on a stored CfrV8Context reference.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_v8_capi.h">cef/include/capi/cef_v8_capi.h</see>.
        /// </remarks>
        public static CfrV8Value CreateDate(CfrTime date)
        {
            var connection = CfxRemoteCallContext.CurrentContext.connection;
            var call       = new CfxV8ValueCreateDateRemoteCall();

            if (!CfrObject.CheckConnection(date, connection))
            {
                throw new ArgumentException("Render process connection mismatch.", "date");
            }
            call.date = CfrObject.Unwrap(date).ptr;
            call.RequestExecution(connection);
            return(CfrV8Value.Wrap(new RemotePtr(connection, call.__retval)));
        }
コード例 #4
0
ファイル: CfrTime.cs プロジェクト: xmcy0011/NanUI
        public static CfrTime FromUniversalTime(DateTime time)
        {
            if (time.Kind != DateTimeKind.Utc)
                throw new ArgumentException("time must be of kind DateTimeKind.Utc", "time");

            var r = new CfrTime();
            r.Year = time.Year;
            r.Month = time.Month;
            r.DayOfMonth = time.Day;
            r.DayOfWeek = (int)time.DayOfWeek;
            r.Hour = time.Hour;
            r.Minute = time.Minute;
            r.Second = time.Second;
            r.Millisecond = time.Millisecond;
            return r;
        }
コード例 #5
0
        internal static CfrTime Wrap(RemotePtr remotePtr)
        {
            if (remotePtr == RemotePtr.Zero)
            {
                return(null);
            }
            var weakCache = CfxRemoteCallContext.CurrentContext.connection.weakCache;

            lock (weakCache) {
                var cfrObj = (CfrTime)weakCache.Get(remotePtr.ptr);
                if (cfrObj == null)
                {
                    cfrObj = new CfrTime(remotePtr);
                    weakCache.Add(remotePtr.ptr, cfrObj);
                }
                return(cfrObj);
            }
        }
コード例 #6
0
ファイル: CfrTime.cs プロジェクト: 386845154a/NanUI-1
        internal static CfrTime Wrap(IntPtr proxyId)
        {
            if (proxyId == IntPtr.Zero)
            {
                return(null);
            }
            var weakCache = CfxRemoteCallContext.CurrentContext.connection.weakCache;

            lock (weakCache) {
                var cfrObj = (CfrTime)weakCache.Get(proxyId);
                if (cfrObj == null)
                {
                    cfrObj = new CfrTime(proxyId);
                    weakCache.Add(proxyId, cfrObj);
                }
                return(cfrObj);
            }
        }
コード例 #7
0
        public static CfrTime FromUniversalTime(DateTime time)
        {
            if (time.Kind != DateTimeKind.Utc)
            {
                throw new ArgumentException("time must be of kind DateTimeKind.Utc", "time");
            }

            var r = new CfrTime();

            r.Year        = time.Year;
            r.Month       = time.Month;
            r.DayOfMonth  = time.Day;
            r.DayOfWeek   = (int)time.DayOfWeek;
            r.Hour        = time.Hour;
            r.Minute      = time.Minute;
            r.Second      = time.Second;
            r.Millisecond = time.Millisecond;
            return(r);
        }
コード例 #8
0
 public DateTime ToUniversalTime(CfrTime time)
 {
     return(new DateTime(time.Year, time.Month, time.DayOfMonth, time.Hour, time.Minute, time.Second, time.Millisecond, DateTimeKind.Utc));
 }
コード例 #9
0
ファイル: CfrTime.cs プロジェクト: xmcy0011/NanUI
 public DateTime ToUniversalTime(CfrTime time)
 {
     return new DateTime(time.Year, time.Month, time.DayOfMonth, time.Hour, time.Minute, time.Second, time.Millisecond, DateTimeKind.Utc);
 }