예제 #1
0
        /// <summary>
        /// Sets the value at the specified key as type binary. Returns true (1) if the
        /// value was set successfully. If |value| is currently owned by another object
        /// then the value will be copied and the |value| reference will not change.
        /// Otherwise, ownership will be transferred to this object and the |value|
        /// reference will be invalidated.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_values_capi.h">cef/include/capi/cef_values_capi.h</see>.
        /// </remarks>
        public bool SetBinary(string key, CfrBinaryValue value)
        {
            var call = new CfxDictionaryValueSetBinaryRemoteCall();

            call.@this = RemotePtr.ptr;
            call.key   = key;
            call.value = CfrObject.Unwrap(value).ptr;
            call.RequestExecution(RemotePtr.connection);
            return(call.__retval);
        }
예제 #2
0
        /// <summary>
        /// Sets the value at the specified key as type binary. Returns true (1) if the
        /// value was set successfully. If |value| is currently owned by another object
        /// then the value will be copied and the |value| reference will not change.
        /// Otherwise, ownership will be transferred to this object and the |value|
        /// reference will be invalidated.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_values_capi.h">cef/include/capi/cef_values_capi.h</see>.
        /// </remarks>
        public bool SetBinary(string key, CfrBinaryValue value)
        {
            var connection = RemotePtr.connection;
            var call       = new CfxDictionaryValueSetBinaryRemoteCall();

            call.@this = RemotePtr.ptr;
            call.key   = key;
            if (!CfrObject.CheckConnection(value, connection))
            {
                throw new ArgumentException("Render process connection mismatch.", "value");
            }
            call.value = CfrObject.Unwrap(value).ptr;
            call.RequestExecution(connection);
            return(call.__retval);
        }