Beispiel #1
0
        internal static CefUserData FromNativeOrNull(cef_user_data_t *ptr)
        {
            CefUserData value = null;
            bool        found;

            lock (_roots)
            {
                found = _roots.TryGetValue((IntPtr)ptr, out value);
            }
            return(found ? value : null);
        }
 /// <summary>
 /// Returns the user data, if any, assigned to this object.
 /// </summary>
 public CefUserData GetUserData()
 {
     return(CefUserData.FromNativeOrNull(
                (cef_user_data_t *)cef_v8value_t.get_user_data(_self)
                ));
 }
 /// <summary>
 /// Sets the user data for this object and returns true on success. Returns
 /// false if this method is called incorrectly. This method can only be called
 /// on user created objects.
 /// </summary>
 public bool SetUserData(CefUserData userData)
 {
     return(cef_v8value_t.set_user_data(_self, userData != null ? (cef_base_t *)userData.ToNative() : null) != 0);
 }