summaryrefslogtreecommitdiff
path: root/FireBase/ObservableExtensions.cs
diff options
context:
space:
mode:
authornatrixaeria <janng@gmx.de>2019-05-19 17:40:59 +0200
committernatrixaeria <janng@gmx.de>2019-05-19 17:40:59 +0200
commit1509b5ef3d7e9e71d9294e234ec0e39f2d831998 (patch)
tree78300ffff230958101b422a4e6026925b287822f /FireBase/ObservableExtensions.cs
parentc3bb858bb54dc8c64bbd48054c2c58dc0073f09c (diff)
parentc4d046858e0822b7c2c540ac2368b2c0e88e7a26 (diff)
Merge branch 'scribble' of https://github.com/TrueDoctor/DiscoBot into scribble
Diffstat (limited to 'FireBase/ObservableExtensions.cs')
-rw-r--r--FireBase/ObservableExtensions.cs24
1 files changed, 10 insertions, 14 deletions
diff --git a/FireBase/ObservableExtensions.cs b/FireBase/ObservableExtensions.cs
index 37c3ef7..bc46261 100644
--- a/FireBase/ObservableExtensions.cs
+++ b/FireBase/ObservableExtensions.cs
@@ -1,21 +1,20 @@
-namespace Firebase.Database
-{
- using System;
- using System.Collections.ObjectModel;
-
- using Firebase.Database.Streaming;
+using System;
+using System.Collections.ObjectModel;
+using Firebase.Database.Streaming;
+namespace Firebase.Database
+{
/// <summary>
- /// Extensions for <see cref="IObservable{T}"/>.
+ /// Extensions for <see cref="IObservable{T}" />.
/// </summary>
public static class ObservableExtensions
{
/// <summary>
- /// Starts observing on given firebase observable and propagates event into an <see cref="ObservableCollection{T}"/>.
+ /// Starts observing on given firebase observable and propagates event into an <see cref="ObservableCollection{T}" />.
/// </summary>
/// <param name="observable"> The observable. </param>
/// <typeparam name="T"> Type of entity. </typeparam>
- /// <returns> The <see cref="ObservableCollection{T}"/>. </returns>
+ /// <returns> The <see cref="ObservableCollection{T}" />. </returns>
public static ObservableCollection<T> AsObservableCollection<T>(this IObservable<FirebaseEvent<T>> observable)
{
var collection = new ObservableCollection<T>();
@@ -25,10 +24,7 @@
if (f.EventType == FirebaseEventType.InsertOrUpdate)
{
var i = collection.IndexOf(f.Object);
- if (i >= 0)
- {
- collection.RemoveAt(i);
- }
+ if (i >= 0) collection.RemoveAt(i);
collection.Add(f.Object);
}
@@ -41,4 +37,4 @@
return collection;
}
}
-}
+} \ No newline at end of file