Exemplo n.º 1
0
        internal static ResultsHandle CreateResultsHandle(IntPtr resultsPtr)
        {
            var resultsHandle = new ResultsHandle();

            resultsHandle.SetHandle(resultsPtr);
            return(resultsHandle);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Returns the same query as the one referenced when the <see cref="ThreadSafeReference.Query{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="IQueryable{T}"/> to resolve in this <see cref="Realm"/>.</param>
 /// <typeparam name="T">The type of the object, contained in the query.</typeparam>
 /// <returns>A thread-confined instance of the original <see cref="IQueryable{T}"/> resolved for the current thread.</returns>
 public IQueryable<T> ResolveReference<T>(ThreadSafeReference.Query<T> reference) where T : RealmObject
 {
     var resultsPtr = SharedRealmHandle.ResolveReference(reference);
     var resultsHandle = new ResultsHandle();
     resultsHandle.SetHandle(resultsPtr);
     return new RealmResults<T>(this, resultsHandle, reference.Metadata);
 }
Exemplo n.º 3
0
        internal static ResultsHandle CreateResultsHandle(IntPtr resultsPtr)
        {
            var resultsHandle = new ResultsHandle();

            RuntimeHelpers.PrepareConstrainedRegions();
            try { /* Retain handle in a constrained execution region */ }
            finally
            {
                resultsHandle.SetHandle(resultsPtr);
            }
            return(resultsHandle);
        }