Realm Xamarin  v0.81.0
Realm for Xamarin
Static Public Member Functions | List of all members
Realms.CollectionNotificationsExtensions Class Reference

A set of extensions methods exposing notification-related functionality over collections. More...

Static Public Member Functions

static IRealmCollection< T > AsRealmCollection< T > (this IQueryable< T > results)
 A convenience method that casts IQueryable{T} to IRealmCollection<T> which implements INotifyCollectionChanged. More...
 
static IRealmCollection< T > AsRealmCollection< T > (this IList< T > list)
 A convenience method that casts IList{T} to IRealmCollection<T> which implements INotifyCollectionChanged. More...
 
static void Move< T > (this IList< T > list, T item, int index)
 Move the specified item to a new position within the list. More...
 
static IDisposable SubscribeForNotifications< T > (this IQueryable< T > results, NotificationCallbackDelegate< T > callback)
 A convenience method that casts IQueryable{T} to IRealmCollection<T> and subscribes for change notifications. More...
 
static IDisposable SubscribeForNotifications< T > (this IList< T > results, NotificationCallbackDelegate< T > callback)
 A convenience method that casts IList{T} to IRealmCollection<T> and subscribes for change notifications. More...
 
static INotifyCollectionChanged ToNotifyCollectionChanged< T > (this IOrderedQueryable< T > results, Action< Exception > errorCallback)
 A convenience method that casts IQueryable{T} to IRealmCollection<T> which implements INotifyCollectionChanged. More...
 
static INotifyCollectionChanged ToNotifyCollectionChanged< T > (this IOrderedQueryable< T > results, Action< Exception > errorCallback, bool coalesceMultipleChangesIntoReset)
 A convenience method that casts IQueryable{T} to IRealmCollection<T> which implements INotifyCollectionChanged. More...
 

Detailed Description

A set of extensions methods exposing notification-related functionality over collections.

Member Function Documentation

§ AsRealmCollection< T >() [1/2]

static IRealmCollection<T> Realms.CollectionNotificationsExtensions.AsRealmCollection< T > ( this IQueryable< T >  results)
static

A convenience method that casts IQueryable{T} to IRealmCollection<T> which implements INotifyCollectionChanged.

Parameters
resultsThe IQueryable<T> to observe for changes.
Template Parameters
TType of the RealmObject in the results.
See also
IRealmCollection<T>.SubscribeForNotifications
Returns
The collection, implementing INotifyCollectionChanged.
Type Constraints
T :RealmObject 

§ AsRealmCollection< T >() [2/2]

static IRealmCollection<T> Realms.CollectionNotificationsExtensions.AsRealmCollection< T > ( this IList< T >  list)
static

A convenience method that casts IList{T} to IRealmCollection<T> which implements INotifyCollectionChanged.

Parameters
listThe IList<T> to observe for changes.
Template Parameters
TType of the RealmObject in the list.
See also
IRealmCollection<T>.SubscribeForNotifications
Returns
The collection, implementing INotifyCollectionChanged.
Type Constraints
T :RealmObject 

§ Move< T >()

static void Realms.CollectionNotificationsExtensions.Move< T > ( this IList< T >  list,
item,
int  index 
)
static

Move the specified item to a new position within the list.

Parameters
listThe list where the move should occur.
itemThe item that will be moved.
indexThe new position to which the item will be moved.
Template Parameters
TType of the RealmObject in the list.

This extension method will work for standalone lists as well by calling Remove and then Insert.

Exceptions
ArgumentOutOfRangeExceptionThrown if the index is less than 0 or greater than Count - 1.
Type Constraints
T :RealmObject 

§ SubscribeForNotifications< T >() [1/2]

static IDisposable Realms.CollectionNotificationsExtensions.SubscribeForNotifications< T > ( this IQueryable< T >  results,
NotificationCallbackDelegate< T >  callback 
)
static

A convenience method that casts IQueryable{T} to IRealmCollection<T> and subscribes for change notifications.

Parameters
resultsThe IQueryable<T> to observe for changes.
Template Parameters
TType of the RealmObject in the results.
See also
IRealmCollection<T>.SubscribeForNotifications
Parameters
callbackThe callback to be invoked with the updated IRealmCollection<T>.
Returns
A subscription token. It must be kept alive for as long as you want to receive change notifications. To stop receiving notifications, call IDisposable.Dispose.
Type Constraints
T :RealmObject 

§ SubscribeForNotifications< T >() [2/2]

static IDisposable Realms.CollectionNotificationsExtensions.SubscribeForNotifications< T > ( this IList< T >  results,
NotificationCallbackDelegate< T >  callback 
)
static

A convenience method that casts IList{T} to IRealmCollection<T> and subscribes for change notifications.

Parameters
resultsThe IList<T> to observe for changes.
Template Parameters
TType of the RealmObject in the results.
See also
IRealmCollection<T>.SubscribeForNotifications
Parameters
callbackThe callback to be invoked with the updated IRealmCollection<T>.
Returns
A subscription token. It must be kept alive for as long as you want to receive change notifications. To stop receiving notifications, call IDisposable.Dispose.
Type Constraints
T :RealmObject 

§ ToNotifyCollectionChanged< T >() [1/2]

static INotifyCollectionChanged Realms.CollectionNotificationsExtensions.ToNotifyCollectionChanged< T > ( this IOrderedQueryable< T >  results,
Action< Exception >  errorCallback 
)
static

A convenience method that casts IQueryable{T} to IRealmCollection<T> which implements INotifyCollectionChanged.

Parameters
resultsThe IQueryable<T> to observe for changes.
errorCallbackThe parameter is not used.
Template Parameters
TType of the RealmObject in the results.
Returns
The collection, implementing INotifyCollectionChanged.
See also
IRealmCollection<T>.SubscribeForNotifications
Type Constraints
T :RealmObject 

§ ToNotifyCollectionChanged< T >() [2/2]

static INotifyCollectionChanged Realms.CollectionNotificationsExtensions.ToNotifyCollectionChanged< T > ( this IOrderedQueryable< T >  results,
Action< Exception >  errorCallback,
bool  coalesceMultipleChangesIntoReset 
)
static

A convenience method that casts IQueryable{T} to IRealmCollection<T> which implements INotifyCollectionChanged.

Parameters
resultsThe IQueryable<T> to observe for changes.
errorCallbackThe parameter is not used.
coalesceMultipleChangesIntoResetThe parameter is not used.
Template Parameters
TType of the RealmObject in the results.
Returns
The collection, implementing INotifyCollectionChanged.
See also
IRealmCollection<T>.SubscribeForNotifications
Type Constraints
T :RealmObject