コード例 #1
0
        public void AlertPositiveButtonSelect(object sender, DialogClickEventArgs e, string instanceId)
        {
            if (instanceId == "remove")
            {
                try
                {
                    Imagery image = GlobalData.ImageListItems[_selectedItemIndex];
                    image.Remove();

                    GlobalData.ImageListItems.Remove(image);
                    UpdateGridAdapter();
                    _selectedItemIndex = -1;
                }
                catch (Exception er)
                {
                    Log.Error(TAG, "AlertPositiveButtonSelect (Remove instance): Exception - " + er.Message);
                    if (GlobalData.ShowErrorDialog)
                    {
                        ErrorDisplay.ShowErrorAlert(this, er, "Removing image", "ImageryActivity.AlertPositiveButtonSelect(Remove instance)");
                    }
                }
            }
            if (instanceId == "comment")
            {
                try
                {
                    GenericTextDialogFragment textFragment = new GenericTextDialogFragment(this, "Image Comment", GetString(Resource.String.ImageryActivityCommentGenericTitle));
                    FragmentTransaction       transaction  = FragmentManager.BeginTransaction();
                    textFragment.Show(transaction, textFragment.Tag);
                }
                catch (Exception ex)
                {
                    Log.Error(TAG, "AlertPositiveButtonSelect (Comment instance): Exception - " + ex.Message);
                    if (GlobalData.ShowErrorDialog)
                    {
                        ErrorDisplay.ShowErrorAlert(this, ex, "Adding comment to image selection", "ImageryActivity.AlertPositiveButtonSelect(Comment instance)");
                    }
                }
            }
            if (instanceId == "useMic")
            {
                PermissionsHelper.RequestApplicationPermission(this, ConstantsAndTypes.AppPermission.UseMicrophone);
            }
        }