/// <summary> /// A convenience method that casts <see cref="IList{T}"/> to <see cref="IRealmCollection{T}"/> which implements /// <see cref="INotifyCollectionChanged"/>. /// </summary> /// <param name="list">The <see cref="IList{T}" /> to observe for changes.</param> /// <typeparam name="T">Type of the <see cref="RealmObject"/> in the list.</typeparam> /// <seealso cref="IRealmCollection{T}.SubscribeForNotifications"/> /// <returns>The collection, implementing <see cref="INotifyCollectionChanged"/>.</returns> public static IRealmCollection <T> AsRealmCollection <T>(this IList <T> list) where T : RealmObject { RealmPCLHelpers.ThrowProxyShouldNeverBeUsed(); return(null); }
/// <summary> /// A convenience method that casts <see cref="IList{T}" /> to <see cref="IRealmCollection{T}"/> and subscribes for change notifications. /// </summary> /// <param name="results">The <see cref="IList{T}" /> to observe for changes.</param> /// <typeparam name="T">Type of the <see cref="RealmObject"/> in the results.</typeparam> /// <seealso cref="IRealmCollection{T}.SubscribeForNotifications"/> /// <param name="callback">The callback to be invoked with the updated <see cref="IRealmCollection{T}" />.</param> /// <returns> /// A subscription token. It must be kept alive for as long as you want to receive change notifications. /// To stop receiving notifications, call <see cref="IDisposable.Dispose" />. /// </returns> public static IDisposable SubscribeForNotifications <T>(this IList <T> results, NotificationCallbackDelegate <T> callback) where T : RealmObject { RealmPCLHelpers.ThrowProxyShouldNeverBeUsed(); return(null); }
/// <summary> /// A convenience method that casts <see cref="IQueryable{T}"/> to <see cref="IRealmCollection{T}"/> which /// implements <see cref="INotifyCollectionChanged"/>. /// </summary> /// <param name="results">The <see cref="IQueryable{T}" /> to observe for changes.</param> /// <typeparam name="T">Type of the <see cref="RealmObject"/> in the results.</typeparam> /// <seealso cref="IRealmCollection{T}.SubscribeForNotifications"/> /// <returns>The collection, implementing <see cref="INotifyCollectionChanged"/>.</returns> public static IRealmCollection <T> AsRealmCollection <T>(this IQueryable <T> results) where T : RealmObject { RealmPCLHelpers.ThrowProxyShouldNeverBeUsed(); return(null); }
/// <summary> /// Move the specified item to a new position within the list. /// </summary> /// <param name="list">The list where the move should occur.</param> /// <param name="item">The item that will be moved.</param> /// <param name="index">The new position to which the item will be moved.</param> /// <typeparam name="T">Type of the <see cref="RealmObject"/> in the list.</typeparam> /// <remarks> /// This extension method will work for standalone lists as well by calling <see cref="ICollection{T}.Remove"/> /// and then <see cref="IList{T}.Insert"/>. /// </remarks> /// <exception cref="ArgumentOutOfRangeException">Thrown if the index is less than 0 or greater than <see cref="ICollection{T}.Count"/> - 1.</exception> public static void Move <T>(this IList <T> list, T item, int index) where T : RealmObject { RealmPCLHelpers.ThrowProxyShouldNeverBeUsed(); }
/// <summary> /// Wraps a <see cref="RealmResults{T}" /> in an implementation of <see cref="INotifyCollectionChanged" /> so that it may be used in MVVM databinding. /// </summary> /// <param name="results">The <see cref="RealmResults{T}"/ > to observe for changes.</param> /// <param name="errorCallback">An error callback that will be invoked if the observing thread raises an error.</param> /// <param name="coalesceMultipleChangesIntoReset"> /// When a lot of items have been added or removed at once it is more efficient to raise <see cref="INotifyCollectionChanged.CollectionChanged" /> once /// with <see cref="NotifyCollectionChangedAction.Reset" /> instead of multiple times for every single change. Pass <c>true</c> to opt-in to this behavior. /// </param> /// <returns>An <see cref="ObservableCollection{T}" />-like object useful for MVVM databinding.</returns> /// <seealso cref="RealmResults{T}.SubscribeForNotifications(RealmResults{T}.NotificationCallback)"/> public static INotifyCollectionChanged ToNotifyCollectionChanged <T>(this RealmResults <T> results, Action <Exception> errorCallback, bool coalesceMultipleChangesIntoReset) where T : RealmObject { RealmPCLHelpers.ThrowProxyShouldNeverBeUsed(); return(null); }
/// <summary> /// Apply an NSPredicate-based filter over a collection. It can be used to create /// more complex queries, that are currently unsupported by the LINQ provider and /// supports SORT and DISTINCT clauses in addition to filtering. /// </summary> /// <typeparam name="T">The type of the objects that will be filtered.</typeparam> /// <param name="results"> /// A Queryable collection, obtained by calling <see cref="Realm.All{T}"/>. /// </param> /// <param name="predicate">The predicate that will be applied.</param> /// <returns>A queryable observable collection of objects that match the predicate.</returns> /// <remarks> /// This method can be used in combination with LINQ filtering, but it is strongly recommended /// to avoid combining it if a <c>SORT</c> clause appears in the predicate. /// <para/> /// If you're not going to apply additional filters, it's recommended to use <see cref="AsRealmCollection{T}(IQueryable{T})"/> /// after applying the predicate. /// </remarks> /// <example> /// <code> /// var results1 = realm.All<Foo>("Bar.IntValue > 0"); /// var results2 = realm.All<Foo>("Bar.IntValue > 0 SORT(Bar.IntValue ASC Bar.StringValue DESC)"); /// var results3 = realm.All<Foo>("Bar.IntValue > 0 SORT(Bar.IntValue ASC Bar.StringValue DESC) DISTINCT(Bar.IntValue)"); /// </code> /// </example> /// <seealso href="https://github.com/realm/realm-js/blob/master/docs/tutorials/query-language.md"> /// Examples of the NSPredicate syntax /// </seealso> /// <seealso href="https://academy.realm.io/posts/nspredicate-cheatsheet/">NSPredicate Cheatsheet</seealso> public static IQueryable <T> Filter <T>(this IQueryable <T> results, string predicate) { RealmPCLHelpers.ThrowProxyShouldNeverBeUsed(); return(null); }
/// <summary> /// Move the specified item to a new position within the list. /// </summary> /// <param name="list">The list where the move should occur.</param> /// <param name="from">The index of the item that will be moved.</param> /// <param name="to">The new position to which the item will be moved.</param> /// <typeparam name="T">Type of the objects in the list.</typeparam> /// <remarks> /// This extension method will work for standalone lists as well by calling <see cref="IList{T}.RemoveAt"/> /// and then <see cref="IList{T}.Insert"/>. /// </remarks> /// <exception cref="ArgumentOutOfRangeException">Thrown if the index is less than 0 or greater than <see cref="ICollection{T}.Count"/> - 1.</exception> public static void Move <T>(this IList <T> list, int from, int to) { RealmPCLHelpers.ThrowProxyShouldNeverBeUsed(); }