private void ProblemIdeaList_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { ProblemIdea problemIdea = null; ProblemSolvingIdeasDialogFragment ideaFragment = null; Log.Info(TAG, "ProblemIdeaList_ItemLongClick: selected item - " + e.Position.ToString() + ", problemID - " + _problemID.ToString()); problemIdea = GlobalData.ProblemSolvingItems.Find(prob => prob.ProblemID == _problemID).ProblemSteps.Find(step => step.ProblemStepID == _problemStepID).ProblemStepIdeas[e.Position]; if (problemIdea != null) { ideaFragment = new ProblemSolvingIdeasDialogFragment(this, "Edit Idea", _problemID, problemIdea.ProblemStepID, problemIdea.ProblemIdeaID, problemIdea.ProblemIdeaText.Trim()); } var fragmentTransaction = FragmentManager.BeginTransaction(); if (fragmentTransaction != null) { ideaFragment.Show(fragmentTransaction, ideaFragment.Tag); } }
private void Add() { try { ProblemSolvingIdeasDialogFragment ideaFragment = null; Log.Info(TAG, "Add_Click: passing -1 for ideaID, stepID is " + _problemStepID.ToString() + ", problemID is " + _problemID.ToString()); ideaFragment = new ProblemSolvingIdeasDialogFragment(this, "Add Idea", _problemID, _problemStepID, -1); var fragmentTransaction = FragmentManager.BeginTransaction(); if (fragmentTransaction != null) { ideaFragment.Show(fragmentTransaction, ideaFragment.Tag); } } catch (Exception ex) { Log.Error(TAG, "Add_Click: Exception - " + ex.Message); if (GlobalData.ShowErrorDialog) { ErrorDisplay.ShowErrorAlert(this, ex, GetString(Resource.String.ErrorProblemSolvingIdeasActivityAdd), "ProblemSolvingIdeasActivity.Add_Click"); } } }