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

            listHandle.SetHandle(GetLinklist(propertyIndex));
            return(listHandle);
        }
コード例 #2
0
ファイル: ObjectHandle.cs プロジェクト: vitors/realm-dotnet
        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));
        }
コード例 #3
0
ファイル: Realm.cs プロジェクト: aYasutakaOhtake/realm-dotnet
        /// <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));
        }
コード例 #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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
 public static extern bool get_is_frozen(ListHandle list, out NativeException ex);
コード例 #7
0
 public static extern IntPtr get_thread_safe_reference(ListHandle listHandle, out NativeException ex);
コード例 #8
0
 public static extern IntPtr move(ListHandle listHandle, IntPtr sourceIndex, IntPtr targetIndex, out NativeException ex);
コード例 #9
0
ファイル: ListHandle.cs プロジェクト: realm/realm-dotnet
 public static extern void insert(ListHandle listHandle, IntPtr targetIndex, ObjectHandle objectHandle, out NativeException ex);
コード例 #10
0
 public static extern void insert_value(ListHandle listHandle, IntPtr targetIndex, PrimitiveValue value, out NativeException ex);
コード例 #11
0
 public static extern void add_value(ListHandle listHandle, PrimitiveValue value, out NativeException ex);
コード例 #12
0
 public static extern IntPtr get_object(ListHandle listHandle, IntPtr link_ndx, out NativeException ex);
コード例 #13
0
ファイル: ListHandle.cs プロジェクト: realm/realm-dotnet
 public static extern IntPtr move(ListHandle listHandle, ObjectHandle objectHandle, IntPtr targetIndex, out NativeException ex);
コード例 #14
0
ファイル: ListHandle.cs プロジェクト: realm/realm-dotnet
 public static extern IntPtr add_notification_callback(ListHandle listHandle, IntPtr managedListHandle, NotificationCallbackDelegate callback, out NativeException ex);
コード例 #15
0
ファイル: ListHandle.cs プロジェクト: realm/realm-dotnet
 public static extern IntPtr size(ListHandle listHandle, out NativeException ex);
コード例 #16
0
ファイル: ListHandle.cs プロジェクト: realm/realm-dotnet
 public static extern IntPtr find(ListHandle listHandle, ObjectHandle objectHandle, out NativeException ex);
コード例 #17
0
ファイル: ListHandle.cs プロジェクト: realm/realm-dotnet
 public static extern IntPtr get(ListHandle listHandle, IntPtr link_ndx, out NativeException ex);
コード例 #18
0
ファイル: ListHandle.cs プロジェクト: realm/realm-dotnet
 public static extern void clear(ListHandle listHandle, out NativeException ex);
コード例 #19
0
ファイル: ListHandle.cs プロジェクト: realm/realm-dotnet
 public static extern void erase(ListHandle listHandle, IntPtr rowIndex, out NativeException ex);
コード例 #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);
コード例 #21
0
 public static extern void get_value(ListHandle listHandle, IntPtr link_ndx, out PrimitiveValue value, out NativeException ex);
コード例 #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);
コード例 #23
0
 public static extern void erase(ListHandle listHandle, IntPtr rowIndex, out NativeException ex);
コード例 #24
0
 public static extern IntPtr add_embedded(ListHandle listHandle, out NativeException ex);
コード例 #25
0
 public static extern IntPtr size(ListHandle listHandle, out NativeException ex);
コード例 #26
0
 public static extern IntPtr insert_embedded(ListHandle listHandle, IntPtr targetIndex, out NativeException ex);
コード例 #27
0
ファイル: ListHandle.cs プロジェクト: realm/realm-dotnet
 public static extern void add(ListHandle listHandle, ObjectHandle objectHandle, out NativeException ex);
コード例 #28
0
 public static extern IntPtr find_value(ListHandle listHandle, PrimitiveValue value, out NativeException ex);
コード例 #29
0
 public static extern void add_object(ListHandle listHandle, ObjectHandle objectHandle, out NativeException ex);
コード例 #30
0
 public static extern void clear(ListHandle listHandle, out NativeException ex);
コード例 #31
0
 public static extern void add_primitive(ListHandle listHandle, IntPtr value, out NativeException ex);
コード例 #32
0
 public static extern IntPtr add_notification_callback(ListHandle listHandle, IntPtr managedListHandle, NotificationCallbackDelegate callback, out NativeException ex);
コード例 #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);
コード例 #34
0
 public static extern bool get_is_valid(ListHandle listHandle, out NativeException ex);
コード例 #35
0
 public static extern void set_primitive(ListHandle listHandle, IntPtr targetIndex, IntPtr value, out NativeException ex);
コード例 #36
0
 public static extern IntPtr snapshot(ListHandle list, out NativeException ex);
コード例 #37
0
 public static extern void insert_object(ListHandle listHandle, IntPtr targetIndex, ObjectHandle objectHandle, out NativeException ex);
コード例 #38
0
 public static extern IntPtr freeze(ListHandle handle, SharedRealmHandle frozen_realm, out NativeException ex);
コード例 #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);