From 304437b834e8c87687f68333ae67a13ee1377a73 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Wed, 12 Jun 2019 21:47:51 +0200 Subject: Adjust Codestyle --- dsa/FireBase/ObservableExtensions.cs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'dsa/FireBase/ObservableExtensions.cs') diff --git a/dsa/FireBase/ObservableExtensions.cs b/dsa/FireBase/ObservableExtensions.cs index bc46261..69730df 100644 --- a/dsa/FireBase/ObservableExtensions.cs +++ b/dsa/FireBase/ObservableExtensions.cs @@ -2,34 +2,28 @@ using System.Collections.ObjectModel; using Firebase.Database.Streaming; -namespace Firebase.Database -{ +namespace Firebase.Database { /// /// Extensions for . /// - public static class ObservableExtensions - { + public static class ObservableExtensions { /// /// Starts observing on given firebase observable and propagates event into an . /// /// The observable. /// Type of entity. /// The . - public static ObservableCollection AsObservableCollection(this IObservable> observable) - { + public static ObservableCollection AsObservableCollection(this IObservable> observable) { var collection = new ObservableCollection(); - observable.Subscribe(f => - { - if (f.EventType == FirebaseEventType.InsertOrUpdate) - { + observable.Subscribe(f => { + if (f.EventType == FirebaseEventType.InsertOrUpdate) { var i = collection.IndexOf(f.Object); if (i >= 0) collection.RemoveAt(i); collection.Add(f.Object); } - else - { + else { collection.Remove(f.Object); } }); -- cgit v1.2.3-70-g09d2