public async static Task addComment(string formation, string comment) { Task addCommentTask; if (commentDictionary.ContainsKey(formation)) { addCommentTask = Task.Run(() => { commentDictionary[formation].Add(comment); }); } else { addCommentTask = Task.Run(() => { List <string> commentList = new List <string>(); commentList.Add(comment); commentDictionary.Add(formation, commentList); }); } await addCommentTask; AppEventHandler.emitNoteUpdate(ADD_OPERATION, formation, comment); AppEventHandler.emitInfoTextUpdate("Comment for formation " + formation + " added"); }
public async static Task removeComment(string formation, string comment) { await Task.Run(() => { commentDictionary[formation].Remove(comment); }); AppEventHandler.emitNoteUpdate(REMOVE_OPERATION, formation, comment); AppEventHandler.emitInfoTextUpdate("Comment for formation " + formation + " removed"); }
public override mainApp.Dialog OnCreateDialog(Bundle savedInstanceState) { mainApp.AlertDialog.Builder builder = new mainApp.AlertDialog.Builder(Activity); string formation = Arguments.GetString(FORMATION); string comment = Arguments.GetString(COMMENT); builder .SetTitle("Confirm delete") .SetMessage("Are you sure you want to remove a comment \"" + comment + "\" for formation " + formation) .SetPositiveButton("Delete", async(senderAlert, args) => { Dismiss(); await FSNotesHandler.removeComment(formation, comment); }) .SetNegativeButton("Cancel", (senderAlert, args) => { AppEventHandler.emitInfoTextUpdate("Delete cancelled"); }); return(builder.Create()); }
public void OnItemCheckedStateChanged(ActionMode mode, int position, long id, bool isChecked) { AppEventHandler.emitInfoTextUpdate("State changed at pos: " + position + ", isChecked: " + isChecked); }