示例#1
0
 public OnClickListenerAnonymousInnerClassHelper(EntryDialogFragment outerInstance, com.bxl.postest.settings.EntryInfo entryInfo, bool isModifying, Spinner deviceCategorySpinner, Spinner productNameSpinner, Spinner deviceBusSpinner)
 {
     this.outerInstance         = outerInstance;
     this.entryInfo             = entryInfo;
     this.isModifying           = isModifying;
     this.deviceCategorySpinner = deviceCategorySpinner;
     this.productNameSpinner    = productNameSpinner;
     this.deviceBusSpinner      = deviceBusSpinner;
 }
示例#2
0
        public override bool onOptionsItemSelected(MenuItem item)
        {
            switch (item.ItemId)
            {
            case R.id.action_add_entry:
                EntryDialogFragment.showDialog(SupportFragmentManager, "Add entry", null);
                return(true);

            default:
                return(base.onOptionsItemSelected(item));
            }
        }
示例#3
0
        internal static void showDialog(FragmentManager manager, string title, EntryInfo entryInfo)
        {
            Bundle args = new Bundle();

            args.putString(KEY_TITLE, title);
            args.putParcelable(KEY_ENTRY_INFO, entryInfo);

            EntryDialogFragment dialogFragment = new EntryDialogFragment();

            dialogFragment.Arguments = args;
            dialogFragment.show(manager, typeof(EntryDialogFragment).Name);
        }
示例#4
0
        public override bool onContextItemSelected(MenuItem item)
        {
            AdapterContextMenuInfo info = (AdapterContextMenuInfo)item.MenuInfo;
            string logicalName          = ((TextView)info.targetView).Text.ToString();

            switch (item.ItemId)
            {
            case R.id.context_modify_entry:
                int    deviceCategory = bxlConfigLoader.getDeviceCategory(logicalName);
                string dc             = null;
                switch (deviceCategory)
                {
                case BXLConfigLoader.DEVICE_CATEGORY_CASH_DRAWER:
                    dc = Resources.getStringArray(R.array.device_categories)[0];
                    break;

                case BXLConfigLoader.DEVICE_CATEGORY_MSR:
                    dc = Resources.getStringArray(R.array.device_categories)[1];
                    break;

                case BXLConfigLoader.DEVICE_CATEGORY_POS_PRINTER:
                    dc = Resources.getStringArray(R.array.device_categories)[2];
                    break;

                case BXLConfigLoader.DEVICE_CATEGORY_SMART_CARD_RW:
                    dc = Resources.getStringArray(R.array.device_categories)[3];
                    break;
                }

                int    deviceBus = bxlConfigLoader.getDeviceBus(logicalName);
                string db        = null;
                switch (deviceBus)
                {
                case BXLConfigLoader.DEVICE_BUS_BLUETOOTH:
                    db = Resources.getStringArray(R.array.device_bus)[0];
                    break;

                case BXLConfigLoader.DEVICE_BUS_ETHERNET:
                    db = Resources.getStringArray(R.array.device_bus)[1];
                    break;

                case BXLConfigLoader.DEVICE_BUS_USB:
                    db = Resources.getStringArray(R.array.device_bus)[2];
                    break;

                case BXLConfigLoader.DEVICE_BUS_WIFI:
                    db = Resources.getStringArray(R.array.device_bus)[3];
                    break;

                case BXLConfigLoader.DEVICE_BUS_WIFI_DIRECT:
                    db = Resources.getStringArray(R.array.device_bus)[4];
                    break;
                }

                EntryInfo entryInfo = new EntryInfo(logicalName, dc, bxlConfigLoader.getProductName(logicalName), db, bxlConfigLoader.getAddress(logicalName));
                EntryDialogFragment.showDialog(SupportFragmentManager, "Modify entry", entryInfo);
                return(true);

            case R.id.context_remove_entry:
                if (bxlConfigLoader.removeEntry(logicalName))
                {
                    arrayAdapter.remove(logicalName);
                }
                else
                {
                    Toast.makeText(this, "Remove failed", Toast.LENGTH_SHORT).show();
                }
                return(true);

            default:
                return(base.onContextItemSelected(item));
            }
        }
示例#5
0
 public OnClickListenerAnonymousInnerClassHelper2(EntryDialogFragment outerInstance)
 {
     this.outerInstance = outerInstance;
 }