Inheritance: CollectionHandleBase
Example #1
0
        internal ListHandle TableLinkList(IntPtr propertyIndex)
        {
            var listHandle = new ListHandle(Root ?? this);

            listHandle.SetHandle(GetLinklist(propertyIndex));
            return(listHandle);
        }
Example #2
0
        public RealmList <T> GetList <T>(Realm realm, IntPtr propertyIndex, string objectType)
        {
            var listHandle = new ListHandle(Root ?? this, GetLinklist(propertyIndex));
            var metadata   = objectType == null ? null : realm.Metadata[objectType];

            return(new RealmList <T>(realm, listHandle, metadata));
        }
Example #3
0
        /// <summary>
        /// Returns the same collection as the one referenced when the <see cref="ThreadSafeReference.List{T}"/> was first created,
        /// but resolved for the current Realm for this thread.
        /// </summary>
        /// <param name="reference">The thread-safe reference to the thread-confined <see cref="IList{T}"/> to resolve in this <see cref="Realm"/>.</param>
        /// <typeparam name="T">The type of the objects, contained in the collection.</typeparam>
        /// <returns>
        /// A thread-confined instance of the original <see cref="IList{T}"/> resolved for the current thread or <c>null</c>
        /// if the list's parent object has been deleted after the reference was created.
        /// </returns>
        public IList <T> ResolveReference <T>(ThreadSafeReference.List <T> reference)
        {
            var listPtr    = SharedRealmHandle.ResolveReference(reference);
            var listHandle = new ListHandle(SharedRealmHandle, listPtr);

            if (!listHandle.IsValid)
            {
                return(null);
            }

            return(new RealmList <T>(this, listHandle, reference.Metadata));
        }
Example #4
0
        /// <summary>
        /// Returns the same collection as the one referenced when the <see cref="ThreadSafeReference.List{T}"/> was first created,
        /// but resolved for the current Realm for this thread.
        /// </summary>
        /// <param name="reference">The thread-safe reference to the thread-confined <see cref="IList{T}"/> to resolve in this <see cref="Realm"/>.</param>
        /// <typeparam name="T">The type of the object, contained in the collection.</typeparam>
        /// <returns>
        /// A thread-confined instance of the original <see cref="IList{T}"/> resolved for the current thread or <c>null</c>
        /// if the list's parent object has been deleted after the reference was created.
        /// </returns>
        public IList<T> ResolveReference<T>(ThreadSafeReference.List<T> reference) where T : RealmObject
        {
            var listPtr = SharedRealmHandle.ResolveReference(reference);
            var listHandle = new ListHandle(SharedRealmHandle);
            listHandle.SetHandle(listPtr);
            if (!listHandle.IsValid)
            {
                return null;
            }

            return new RealmList<T>(this, listHandle, reference.Metadata);
        }
        internal ListHandle TableLinkList(IntPtr propertyIndex)
        {
            var listHandle = new ListHandle(Root ?? this);

            // At this point sh is invalid due to its handle being uninitialized, but the root is set correctly
            // a finalize at this point will not leak anything and the handle will not do anything

            // now, set the TableView handle...
            RuntimeHelpers.PrepareConstrainedRegions(); // the following finally will run with no out-of-band exceptions
            try
            {
            }
            finally
            {
                listHandle.SetHandle(this.GetLinklist(propertyIndex));
            } // at this point we have atomically acquired a handle and also set the root correctly so it can be unbound correctly

            return(listHandle);
        }
Example #6
0
 public static extern bool get_is_frozen(ListHandle list, out NativeException ex);
Example #7
0
 public static extern IntPtr get_thread_safe_reference(ListHandle listHandle, out NativeException ex);
Example #8
0
 public static extern IntPtr move(ListHandle listHandle, IntPtr sourceIndex, IntPtr targetIndex, out NativeException ex);
Example #9
0
 public static extern void insert(ListHandle listHandle, IntPtr targetIndex, ObjectHandle objectHandle, out NativeException ex);
Example #10
0
 public static extern void insert_value(ListHandle listHandle, IntPtr targetIndex, PrimitiveValue value, out NativeException ex);
Example #11
0
 public static extern void add_value(ListHandle listHandle, PrimitiveValue value, out NativeException ex);
Example #12
0
 public static extern IntPtr get_object(ListHandle listHandle, IntPtr link_ndx, out NativeException ex);
Example #13
0
 public static extern IntPtr move(ListHandle listHandle, ObjectHandle objectHandle, IntPtr targetIndex, out NativeException ex);
Example #14
0
 public static extern IntPtr add_notification_callback(ListHandle listHandle, IntPtr managedListHandle, NotificationCallbackDelegate callback, out NativeException ex);
Example #15
0
 public static extern IntPtr size(ListHandle listHandle, out NativeException ex);
Example #16
0
 public static extern IntPtr find(ListHandle listHandle, ObjectHandle objectHandle, out NativeException ex);
Example #17
0
 public static extern IntPtr get(ListHandle listHandle, IntPtr link_ndx, out NativeException ex);
Example #18
0
 public static extern void clear(ListHandle listHandle, out NativeException ex);
Example #19
0
 public static extern void erase(ListHandle listHandle, IntPtr rowIndex, out NativeException ex);
Example #20
0
 public static extern void insert_binary(ListHandle listHandle, IntPtr targetIndex, IntPtr buffer, IntPtr bufferLength,
                                         [MarshalAs(UnmanagedType.I1)] bool has_value, out NativeException ex);
Example #21
0
 public static extern void get_value(ListHandle listHandle, IntPtr link_ndx, out PrimitiveValue value, out NativeException ex);
Example #22
0
 public static extern IntPtr get_string(ListHandle listHandle, IntPtr link_ndx, IntPtr buffer, IntPtr bufsize,
                                        [MarshalAs(UnmanagedType.I1)] out bool isNull, out NativeException ex);
Example #23
0
 public static extern void erase(ListHandle listHandle, IntPtr rowIndex, out NativeException ex);
Example #24
0
 public static extern IntPtr add_embedded(ListHandle listHandle, out NativeException ex);
Example #25
0
 public static extern IntPtr size(ListHandle listHandle, out NativeException ex);
Example #26
0
 public static extern IntPtr insert_embedded(ListHandle listHandle, IntPtr targetIndex, out NativeException ex);
Example #27
0
 public static extern void add(ListHandle listHandle, ObjectHandle objectHandle, out NativeException ex);
Example #28
0
 public static extern IntPtr find_value(ListHandle listHandle, PrimitiveValue value, out NativeException ex);
Example #29
0
 public static extern void add_object(ListHandle listHandle, ObjectHandle objectHandle, out NativeException ex);
Example #30
0
 public static extern void clear(ListHandle listHandle, out NativeException ex);
Example #31
0
 public static extern void add_primitive(ListHandle listHandle, IntPtr value, out NativeException ex);
Example #32
0
 public static extern IntPtr add_notification_callback(ListHandle listHandle, IntPtr managedListHandle, NotificationCallbackDelegate callback, out NativeException ex);
Example #33
0
 public static extern void add_string(ListHandle listHandle, [MarshalAs(UnmanagedType.LPWStr)] string value, IntPtr valueLength,
                                      [MarshalAs(UnmanagedType.I1)] bool has_value, out NativeException ex);
Example #34
0
 public static extern bool get_is_valid(ListHandle listHandle, out NativeException ex);
Example #35
0
 public static extern void set_primitive(ListHandle listHandle, IntPtr targetIndex, IntPtr value, out NativeException ex);
Example #36
0
 public static extern IntPtr snapshot(ListHandle list, out NativeException ex);
Example #37
0
 public static extern void insert_object(ListHandle listHandle, IntPtr targetIndex, ObjectHandle objectHandle, out NativeException ex);
Example #38
0
 public static extern IntPtr freeze(ListHandle handle, SharedRealmHandle frozen_realm, out NativeException ex);
Example #39
0
 public static extern void insert_string(ListHandle listHandle, IntPtr targetIndex, [MarshalAs(UnmanagedType.LPWStr)] string value,
                                         IntPtr valueLen, [MarshalAs(UnmanagedType.I1)] bool has_value, out NativeException ex);