Example #1
0
 public void AddObserversForServer()
 {
     try
     {
         firebaseClient.Child("notes").OrderByValue().StartAt(curUser.Email).AsObservable <NoteData>().Subscribe(item =>
         {
             UpdateNoteEventArgs args = new UpdateNoteEventArgs
             {
                 Data = item.Object
             };
             OnUpdateNote(args);
         });
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
     }
 }
Example #2
0
        //public async void LoadNotesFromServer()
        //{
        //	try
        //	{
        //		var notes = await firebaseClient.Child("notes").OrderByValue().StartAt(curUser.Email).OnceAsync<NoteData>();

        //		if (notes.Count > 0)
        //		{
        //			foreach (var item in notes)
        //			{
        //				UpdateNoteEventArgs args = new UpdateNoteEventArgs
        //				{
        //					Data = item.Object
        //				};
        //				OnUpdateNote(args);
        //			}
        //		}
        //	}
        //	catch (Exception ex)
        //	{
        //		Console.WriteLine(ex);
        //	}
        //}

        protected virtual void OnUpdateNote(UpdateNoteEventArgs e)
        {
            UpdateNote?.Invoke(this, e);
        }
Example #3
0
 private void Fm_UpdateNote(object sender, UpdateNoteEventArgs e)
 {
     noteManager.UpdateNote(e.Data);
     notesListBox.Invalidate();
 }