public override bool OnContextItemSelected(IMenuItem item) { AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)item.MenuInfo; string itemName = (string)item.TitleFormatted.ToString(); // Rename the ADF from API storage if (itemName.Equals(mAPISpaceMenuStrings[0])) { showSetNameDialog(mUUIDList[info.Position]); } // Delete the ADF from API storage and update the API ADF Listview else if (itemName.Equals(mAPISpaceMenuStrings[1])) { mADFDataSource.deleteADFandUpdateList(mUUIDList[info.Position]); // Update the API ADF Listview mUUIDList = mADFDataSource.FullUUIDList; mUUIDNames = mADFDataSource.UUIDNames; mADFAdapter = new ADFUUIDArrayAdapter(this, mUUIDList, mUUIDNames); mUUIDListView.Adapter = mADFAdapter; } // Export the ADF into application package folder and update the // Listview else if (itemName.Equals(mAPISpaceMenuStrings[2])) { try { mADFDataSource.Tango.ExportAreaDescriptionFile(mUUIDList[info.Position], mAppSpaceADFFolder); } catch (TangoErrorException) { Toast.MakeText(this, Resource.String.adf_exists_app_space, Android.Widget.ToastLength.Short).Show(); } } // Delete an ADF from App space and update the App space ADF Listview else if (itemName.Equals(mAppSpaceMenuStrings[0])) { File file = new File(mAppSpaceADFFolder + File.Separator + mAppSpaceUUIDList[info.Position]); file.Delete(); // Update App space ADF ListView mAppSpaceUUIDList = AppSpaceADFList; mAppSpaceADFAdapter = new ADFUUIDArrayAdapter(this, mAppSpaceUUIDList, null); mAppSpaceUUIDListView.Adapter = mAppSpaceADFAdapter; } // Import an ADF into API private Storage and update the API ADF // Listview else if (itemName.Equals(mAppSpaceMenuStrings[1])) { try { mADFDataSource.Tango.ImportAreaDescriptionFile(mAppSpaceADFFolder + File.Separator + mAppSpaceUUIDList[info.Position]); } catch (TangoErrorException) { Toast.MakeText(this, Resource.String.adf_exists_api_space, Android.Widget.ToastLength.Short).Show(); } } return(true); }
public override bool OnContextItemSelected(IMenuItem item) { AdapterView.AdapterContextMenuInfo acmi = (AdapterView.AdapterContextMenuInfo)item.MenuInfo; ClickView cv = (ClickView)acmi.TargetView; return(cv.OnContextItemSelected(item)); }
public override bool OnMenuItemSelected(int featureId, IMenuItem item) { AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)item.MenuInfo; var model = Cast(_disressListView.GetItemAtPosition(info.Position)); switch (item.ItemId) { case Resource.Id.distressRespond: Toast.MakeText(this.ApplicationContext, "Respond", ToastLength.Short).Show(); RespondDisaster(model.Id); return(true); case Resource.Id.distressViewMap: var activity2 = new Intent(this, typeof(MapActivity)); activity2.PutExtra("lat", model.Lat.ToString(CultureInfo.CurrentCulture)); activity2.PutExtra("lng", model.Lng.ToString(CultureInfo.CurrentCulture)); StartActivity(activity2); return(true); case Resource.Id.distressCancel: Toast.MakeText(this.ApplicationContext, "Cancel", ToastLength.Short).Show(); return(true); } return(base.OnMenuItemSelected(featureId, item)); }
public override bool OnContextItemSelected(IMenuItem item) { AdapterView.AdapterContextMenuInfo info = item.MenuInfo as AdapterView.AdapterContextMenuInfo; int actionId = item.ItemId; NoteItem note = Notes[info.Position]; // Opción: Reproducir if (actionId == 0) { DibbiAudio.PreparePlay(note.Filename); DibbiPlayer.State = PlayerState.NoteAudio; DibbiPlayer.Title = note.Description; DibbiPlayer.Show(FragmentManager, "player_dialog"); } // Opción: Eliminar if (actionId == 1) { // Eliminar nota de la base de datos. DibbiData.removeNote(note); // Eliminar de la lista Notes.Remove(note); NotesAdapter.NotifyDataSetChanged(); Toast.MakeText(this, "Nota eliminada", ToastLength.Short).Show(); } return(base.OnContextItemSelected(item)); }
public override bool OnContextItemSelected(IMenuItem item) { AdapterView.AdapterContextMenuInfo mi = (AdapterView.AdapterContextMenuInfo)item.MenuInfo; switch (item.ItemId) { case Resource.Id.miNew: //add new var customerDetailsScreen = new Intent(this, typeof(CustomerDetails)); StartActivity(customerDetailsScreen); return(true); case Resource.Id.miEdit: //edit var customerDetailsScreenEdit = new Intent(this, typeof(CustomerDetails)); customerDetailsScreenEdit.PutExtra("CustID", _customerInfoList[mi.Position].CustID.ToString()); StartActivity(customerDetailsScreenEdit); return(true); case Resource.Id.miDelete: //delete return(true); default: return(base.OnContextItemSelected(item)); } }
public override void OnCreateContextMenu(IContextMenu menu, View v, IContextMenuContextMenuInfo menuInfo) { AdapterView.AdapterContextMenuInfo acmi = (AdapterView.AdapterContextMenuInfo)menuInfo; ClickView cv = (ClickView)acmi.TargetView; cv.OnCreateMenu(menu, menuInfo); }
public override void OnCreateContextMenu(IContextMenu menu, View view, IContextMenuContextMenuInfo menuInfo) { base.OnCreateContextMenu(menu, view, menuInfo); AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)menuInfo; Tunnel.Client client = listAdapter[info.Position]; menu.SetHeaderTitle("Client " + client.ID + " at " + client.Address); menu.Add(Menu.None, 0, 0, "Throw off"); }
public override void OnCreateContextMenu(IContextMenu menu, View view, IContextMenuContextMenuInfo menuInfo) { if (view.Id == Resource.Id.ArticleList) { ListView listView = (ListView)view; AdapterView.AdapterContextMenuInfo acmi = (AdapterContextMenuInfo)menuInfo; menu.Add(Menu.None, 1, Menu.None, Resource.String.ArticleList_Lagerbestand); // Lagerbestand menu.Add(Menu.None, 2, Menu.None, Resource.String.ArticleList_ToShoppingList); // Auf Einkaufszettel } }
public override void OnCreateContextMenu(IContextMenu menu, View v, IContextMenuContextMenuInfo menuInfo) { if (v.Id != Resource.Id.MyFriendsListView) return; info = (AdapterView.AdapterContextMenuInfo)menuInfo; menu.SetHeaderTitle(Resource.String.ContextMenuTitle); var menuItems = Resources.GetStringArray(Resource.Array.ContextMenu); for (var i = 0; i < menuItems.Length; i++) { menu.Add(Menu.None, i, i, menuItems[i]); } }
public override void OnCreateContextMenu(IContextMenu menu, View view, IContextMenuContextMenuInfo menuInfo) { if (view.Id == Resource.Id.ListNotes) { AdapterView.AdapterContextMenuInfo info = menuInfo as AdapterView.AdapterContextMenuInfo; menu.SetHeaderTitle(Notes[info.Position].Description); menu.Add(Menu.None, 0, 0, "Reproducir"); menu.Add(Menu.None, 1, 1, "Eliminar"); } base.OnCreateContextMenu(menu, view, menuInfo); }
public override void OnCreateContextMenu(IContextMenu menu, View view, IContextMenuContextMenuInfo menuInfo) { if (view.Id == Resource.Id.StorageItemView) { ListView listView = (ListView)view; AdapterView.AdapterContextMenuInfo acmi = (AdapterContextMenuInfo)menuInfo; //ArticleListView obj = (ArticleListView)listView.GetItemAtPosition(acmi.Position); menu.Add(Menu.None, 1, Menu.None, Resource.String.StorageItem_Artikelangaben); menu.Add(Menu.None, 2, Menu.None, Resource.String.StorageItem_ToShoppingList); } }
public override bool OnContextItemSelected(IMenuItem item) { AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)item.MenuInfo; CodeProjectMember memberToDelete = members [info.Position]; CodeProjectDatabase db = new CodeProjectDatabase(); db.DeleteMember(memberToDelete.Id); members = db.GetMembers(); ListAdapter = new CodeProjectMemberAdapter(this.Activity, members); return(true); }
public override bool OnContextItemSelected(IMenuItem item) { AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)item.MenuInfo; switch (item.ItemId) { case Resource.Id.delete: Util.GetDatabaseMgr().DeleteInvestmentIndex(info.Position); InitializeList(); return(true); default: return(base.OnContextItemSelected(item)); } }
public override void OnCreateContextMenu(IContextMenu menu, View v, IContextMenuContextMenuInfo menuInfo) { if (v.Id != Resource.Id.MyFriendsListView) { return; } info = (AdapterView.AdapterContextMenuInfo)menuInfo; menu.SetHeaderTitle(Resource.String.ContextMenuTitle); var menuItems = Resources.GetStringArray(Resource.Array.ContextMenu); for (var i = 0; i < menuItems.Length; i++) { menu.Add(Menu.None, i, i, menuItems[i]); } }
public override bool OnContextItemSelected(IMenuItem item) { AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)item.MenuInfo; int position = info.Position; CrimeAdapter adapter = (CrimeAdapter)ListAdapter; Crime crime = adapter.GetItem(position); switch (item.ItemId) { case Resource.Id.menu_item_delete_crime: CrimeLab.GetInstance(Activity).DeleteCrime(crime); adapter.Remove(crime); return(true); } return(base.OnContextItemSelected(item)); }
public override bool OnContextItemSelected(IMenuItem item) { if (item.ItemId == Menu.First) { AdapterView.AdapterContextMenuInfo acmi = (AdapterView.AdapterContextMenuInfo)item.MenuInfo; TextView tv = (TextView)acmi.TargetView; String filename = (string)tv.Tag; App.Kp2a.FileDbHelper.DeleteFile(filename); RefreshList(); return(true); } return(base.OnContextItemSelected(item)); }
// Handle stop deletion public override bool OnContextItemSelected(IMenuItem item) { AdapterView.AdapterContextMenuInfo adapterContextMenu = (AdapterView.AdapterContextMenuInfo)item.MenuInfo; Stop stop = (Stop)stopListView.GetItemAtPosition(adapterContextMenu.Position); switch (item.ItemId) { case Resource.Id.deleteStop: db.DeleteStop(stop); Toast.MakeText(this, Resources.GetString(Resource.String.stop_deleted), ToastLength.Long).Show(); adapter.RemoveItem(adapterContextMenu.Position); adapter.NotifyDataSetChanged(); return(true); default: return(base.OnContextItemSelected(item));; } }
public override void OnCreateContextMenu(IContextMenu menu, View v, IContextMenuContextMenuInfo menuInfo) { ContextContext.Clear(); switch (v.Id) { case Resource.Id.MainListView: AdapterView.AdapterContextMenuInfo acmi = (AdapterView.AdapterContextMenuInfo)menuInfo; GameInfo info = (GameInfo)MainListView.GetItemAtPosition(acmi.Position); if (info.Id != -1) { menu.SetHeaderTitle(info.Name); ContextContext[menu.Add(Resource.String.Play)] = () => OpenGamePlay(info); } break; } base.OnCreateContextMenu(menu, v, menuInfo); }
public override void OnCreateContextMenu(IContextMenu menu, View v, IContextMenuContextMenuInfo menuInfo) { base.OnCreateContextMenu(menu, v, menuInfo); // TODO: Is this required?? AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)menuInfo; if (v.Id == Resource.Id.uuidlistviewAPI) { menu.SetHeaderTitle(mUUIDList[info.Position]); menu.Add(mAPISpaceMenuStrings[0]); menu.Add(mAPISpaceMenuStrings[1]); menu.Add(mAPISpaceMenuStrings[2]); } if (v.Id == Resource.Id.uuidlistviewApplicationSpace) { menu.SetHeaderTitle(mAppSpaceUUIDList[info.Position]); menu.Add(mAppSpaceMenuStrings[0]); menu.Add(mAppSpaceMenuStrings[1]); } }
private void DeleteItem(IMenuItem item) { AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)item.MenuInfo; try { Sal1050EntityWebGoodSalPrice element = (Sal1050EntityWebGoodSalPrice)listItem.ElementAt(info.Position); mTVLookUpCustomPriceTotal.Text = (double.Parse(mTVLookUpCustomPriceTotal.Text) - element.Price * element.Quantity).ToString(); listItem.RemoveAt(info.Position); using (dbHelper = new NmdMobileDBAdapter(this)) { dbHelper.OpenOrCreateDatabase(((SharedEnviroment)ApplicationContext).ActionArgument); dbHelper.ExecuteNonQuery("Delete From WebSalPerformaDtl Where FormNo=" + tvSerial.Text + " And Seq =" + (info.Position + 1) + " And SerialDprt=" + serialDprt + " And FormDate=" + tvCurrentDate.Text); } //adapter.RemoveItem(element); //dBHelper.ExecuteNonQuery("Update WebSalPerformaDtl Set Seq=" + --seq + " Where FormNo=" + mTV_Serial_FactorForooshGah.Text + " And Seq =" + (info.Position + 2) + " And SerialDprt=" + serialDprt + " And FormDate=" + mTVCurrentDate_FactorForooshGah.Text); } catch (Exception e) { ExceptionHandler.toastMsg(this, e.Message); ExceptionHandler.logDActivity(e.ToString(), ((SharedEnviroment)ApplicationContext).Logging, ((SharedEnviroment)ApplicationContext).TAG); } adapter.NotifyDataSetChanged(); }
public override bool OnContextItemSelected(IMenuItem item) { AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)item.MenuInfo; TblEntry itemData; switch (item.ItemId) { case Resource.Id.edit: itemData = listViewEntry.GetItemAtPosition(info.Position).Cast <TblEntry> (); ItemSelected(itemData.ID); return(true); case Resource.Id.delete: itemData = listViewEntry.GetItemAtPosition(info.Position).Cast <TblEntry>(); Util.GetDatabaseMgr().DeleteEntryId(itemData.ID); InitializeList(); return(true); default: return(base.OnContextItemSelected(item)); } }