/// <summary> /// Shows a dialog that will add a sensor to a manifold of the given side. /// </summary> /// <param name="analyzer">Analyzer.</param> /// <param name="index">Index.</param> private void ShowAddFromDialog(Analyzer analyzer, Analyzer.ESide side) { var ldb = new ListDialogBuilder(Activity); ldb.SetTitle(Resource.String.analyzer_add_from); ldb.AddItem(Resource.String.device_manager, () => { Toast.MakeText(Activity, "DEVICE MANAGER WAS REMOVED! IMPLEMENT DEVICE SELECTION LIST", ToastLength.Short).Show(); /* * var i = new Intent(Activity, typeof(DeviceManagerActivity)); * i.SetAction(Intent.ActionPick); * StartActivityForResult(i, EncodeManifoldSideRequest(side)); */ }); ldb.AddItem(Resource.String.sensor_create_manual_entry, () => { if (analyzer.IsSideFull(side)) { Toast.MakeText(Activity, string.Format(GetString(Resource.String.analyzer_cannot_set_manifold_side_full_1sarg), side.ToLocalizedString(Activity)), ToastLength.Long).Show(); } else { var d = new ManualSensorCreateDialog(Activity, SensorUtils.GetSensorTypeUnitMapping()).Show((sensor) => { analyzer.PutSensor(analyzer.NextEmptySensorIndex(side), sensor, false); analyzer.SetManifold(side, sensor); }); } }); ldb.Show(); }
/// <summary> /// Shows a dialog that will add a sensor to a sensor mount. /// </summary> /// <param name="analyzer">Analyzer.</param> /// <param name="index">Index.</param> private void ShowAddFromDialog(Analyzer analyzer, int index) { var ldb = new ListDialogBuilder(Activity); ldb.SetTitle(Resource.String.analyzer_add_from); ldb.AddItem(Resource.String.device_manager, () => { Toast.MakeText(Activity, "DEVICE MANAGER WAS REMOVED! IMPLEMENT DEVICE SELECTION LIST", ToastLength.Short).Show(); /* * var i = new Intent(Activity, typeof(DeviceManagerActivity)); * i.SetAction(Intent.ActionPick); * StartActivityForResult(i, EncodeSensorMountRequest(index)); */ }); ldb.AddItem(Resource.String.sensor_create_manual_entry, () => { var d = new ManualSensorCreateDialog(Activity, SensorUtils.GetSensorTypeUnitMapping()).Show((sensor) => { analyzer.PutSensor(index, sensor, false); }); }); ldb.Show(); }