public void SetNote(ServerNote note, NotesTemplate _noteParent) { currentNote = note; parentNotes = _noteParent; if (!string.IsNullOrEmpty(note.userNote)) { noteEditor.Text = currentNote.userNote; } SetNote(); }
public void SetDetails() { if (BindingContext != null) { var note = BindingContext as ServerNote; id = note.noteID; currentNote = note; var dt = DateTime.ParseExact(note.noteDateTime, "MM/dd/yyyy hh:mm:ss tt", CultureInfo.CurrentCulture.DateTimeFormat); notesTime.Text = dt.ToString("hh:mm tt"); string s = ""; if (!string.IsNullOrEmpty(currentNote.userNote)) { if (currentNote.userNote.ToCharArray().Length > 50) { s = currentNote.userNote.Substring(0, 50); } else { s = currentNote.userNote; } } noteDescription.Text = s; switch (note.userNoteTag.noteTag) { case NoteTag.Exhibitor: noteTag.TextColor = Color.FromHex("#2bc33d"); break; case NoteTag.Speaker: noteTag.TextColor = Color.FromHex("#039dfd"); break; case NoteTag.Sponsor: noteTag.TextColor = Color.FromHex("#f59000"); break; case NoteTag.User: noteTag.TextColor = Color.FromHex("#eb346d"); break; case NoteTag.Session: noteTag.TextColor = Color.FromHex("#bc1eca"); break; } if (note.userNoteTag.noteTag != NoteTag.Note) { noteTag.Text = "Tagged with " + note.userNoteTag.noteTag.ToString().ToLower(); } else { tagIcon.Source = ""; noteTag.Text = ""; } } }