internal static void showDialog(FragmentManager manager, string title, string[] items) { ListDialogFragment listDialogFragment = new ListDialogFragment(); Bundle args = new Bundle(); args.putString(KEY_TITLE, title); args.putStringArray(KEY_ITEMS, items); listDialogFragment.Arguments = args; listDialogFragment.show(manager, TAG); }
public override void onClick(View v) { switch (v.Id) { case R.id.buttonAddEscapeSequence: ListDialogFragment.showDialog(FragmentManager, "Escape sequences", ESCAPE_SEQUENCES); break; case R.id.buttonPrintNormal: try { posPrinter.printNormal(POSPrinterConst.PTR_S_RECEIPT, sendToPrinterEditText.Text.ToString()); } catch (JposException e) { Console.WriteLine(e.ToString()); Console.Write(e.StackTrace); MessageDialogFragment.showDialog(FragmentManager, "Excepction", e.Message); } break; case R.id.buttonCutPaper: try { posPrinter.cutPaper(90); } catch (JposException e) { Console.WriteLine(e.ToString()); Console.Write(e.StackTrace); MessageDialogFragment.showDialog(FragmentManager, "Excepction", e.Message); } break; case R.id.buttonCharacterSet: try { string characterSetList = posPrinter.CharacterSetList; List <string> arrayList = new List <string>(); foreach (string token in characterSetList.Split(",", true)) { arrayList.Add(token); } string[] items = arrayList.ToArray(); ListDialogFragment.showDialog(FragmentManager, getString([email protected]_set), items); } catch (JposException e) { Console.WriteLine(e.ToString()); Console.Write(e.StackTrace); MessageDialogFragment.showDialog(FragmentManager, "Excepction", e.Message); } break; } }
public OnClickListenerAnonymousInnerClassHelper(ListDialogFragment outerInstance, string title, string[] items) { this.outerInstance = outerInstance; this.title = title; this.items = items; }