public void DeleteRow(KendoGrid grid, string value, int searchColumn) { var rows = grid.DataItems; HtmlAnchor deleteButton = null; foreach (var row in rows) { if (row[searchColumn].InnerText == value) { // It works only on Internet Explorer on my machine deleteButton = row.Find.ByExpression<HtmlAnchor>("class=~k-grid-delete"); deleteButton.ScrollToVisible(); this.Browser.RefreshDomTree(); var deleteRectangle = deleteButton.GetRectangle(); var currentManager = Manager.Current; AlertDialog alertDialog = new AlertDialog(this.Browser, DialogButton.OK); currentManager.DialogMonitor.AddDialog(alertDialog); currentManager.Desktop.Mouse.Click(MouseClickType.LeftClick, deleteRectangle); this.Browser.Desktop.KeyBoard.KeyPress(Keys.Return); } } }
public void Verify_Deleting_CodedStep() { AlertDialog alertDialog = new AlertDialog(ActiveBrowser, DialogButton.OK); Manager.DialogMonitor.AddDialog(alertDialog); Manager.DialogMonitor.Start(); HtmlInputImage deleteButton = Find.ById<HtmlInputImage>("RadGrid1_ctl00_ctl04_gbccolumn"); deleteButton.Click(); alertDialog.WaitUntilHandled(); }
public void DeleteRow(string value, int searchColumn) { var rows = this.KendoTable.DataItems; HtmlAnchor deleteButton = null; foreach (var row in rows) { if (row[searchColumn].InnerText == value) { deleteButton = row.Find.ByExpression<HtmlAnchor>("class=~k-grid-delete"); deleteButton.ScrollToVisible(); this.Browser.RefreshDomTree(); var currentManager = Manager.Current; var deleteRectangle = deleteButton.GetRectangle(); AlertDialog alertDialog = new AlertDialog(this.Browser, DialogButton.OK); currentManager.DialogMonitor.AddDialog(alertDialog); currentManager.Desktop.Mouse.Click(MouseClickType.LeftClick, deleteRectangle); alertDialog.WaitUntilHandled(5000); } } }
private void showFontTableDialog() { if (mFontTableDialog == null) { mFontTableDialog = (new AlertDialog.Builder(MainActivity.this)).setItems(FONT_TABLE_ITEMS, new OnClickListenerAnonymousInnerClassHelper3(this)) .create(); } mFontTableDialog.show(); }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: static void showPrintDensityDialog(android.app.AlertDialog dialog, final android.content.Context context) internal static void showPrintDensityDialog(AlertDialog dialog, Context context) { if (dialog == null) { dialog = (new AlertDialog.Builder(context)).setTitle("Print density").setSingleChoiceItems(PRINT_DENSITY_ITEMS, 1, new OnClickListenerAnonymousInnerClassHelper17(dialog)) .setPositiveButton("OK", new OnClickListenerAnonymousInnerClassHelper18(dialog)) .setNegativeButton("Cancel", new OnClickListenerAnonymousInnerClassHelper19(dialog)) .create(); } mDensity = BixolonPrinter.PRINT_DENSITY_DEFAULT; dialog.show(); }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: static void showCodePageDialog(android.app.AlertDialog dialog, final android.content.Context context, final android.os.Handler handler) internal static void showCodePageDialog(AlertDialog dialog, Context context, Handler handler) { if (dialog == null) { dialog = (new AlertDialog.Builder(context)).setTitle("Code page").setItems(CODE_PAGE_ITEMS, new OnClickListenerAnonymousInnerClassHelper12(dialog, context, handler)) .create(); } dialog.show(); }
internal static void showBsCodePageDialog(AlertDialog dialog, Context context) { if (dialog == null) { string[] items = new string[CODE_PAGE_ITEMS.Length - 4]; for (int i = 0; i < items.Length; i++) { items[i] = CODE_PAGE_ITEMS[i]; } dialog = (new AlertDialog.Builder(context)).setItems(items, new OnClickListenerAnonymousInnerClassHelper24(dialog)) .create(); } dialog.show(); }
private void ShowKeyboard(EditText userInput, AlertDialog dialog) { userInput.RequestFocus(); userInput.SelectAll(); dialog.Window.SetSoftInputMode(SoftInput.StateAlwaysVisible); }
protected override void OnPreExecute() { alert1 = new AlertDialog.Builder(cont).Create(); alert1.SetTitle("Status"); }
private void Control_Click(object sender, EventArgs e) { Picker model = Element; var RCKWLLFont = Typeface.CreateFromAsset(Xamarin.Forms.Forms.Context.ApplicationContext.Assets, "RCKWLL.ttf"); var picker = new NumberPicker(Context); if (model.Items != null && model.Items.Any()) { picker.MaxValue = model.Items.Count - 1; picker.MinValue = 0; picker.SetDisplayedValues(model.Items.ToArray()); picker.WrapSelectorWheel = false; picker.DescendantFocusability = Android.Views.DescendantFocusability.BlockDescendants; picker.Value = model.SelectedIndex; } var layout = new LinearLayout(Context) { Orientation = Orientation.Vertical }; layout.AddView(picker); ElementController.SetValueFromRenderer(VisualElement.IsFocusedProperty, true); //Create a custom title element TextView title = new TextView(Context) { Text = model.Title, Typeface = RCKWLLFont, Gravity = Android.Views.GravityFlags.Center, }; title.TextSize = 20; title.SetTextColor(Android.Graphics.Color.White); title.SetBackgroundColor(Android.Graphics.Color.Rgb(234, 49, 117)); title.SetHeight(100); var builder = new AlertDialog.Builder(Context); builder.SetView(layout); builder.SetCustomTitle(title); builder.SetNegativeButton("CANCEL", (s, a) => { ElementController.SetValueFromRenderer(VisualElement.IsFocusedProperty, false); // It is possible for the Content of the Page to be changed when Focus is changed. // In this case, we'll lose our Control. Control?.ClearFocus(); _dialog = null; }); builder.SetPositiveButton("OK", (s, a) => { ElementController.SetValueFromRenderer(Picker.SelectedIndexProperty, picker.Value); // It is possible for the Content of the Page to be changed on SelectedIndexChanged. // In this case, the Element & Control will no longer exist. if (Element != null) { if (model.Items.Count > 0 && Element.SelectedIndex >= 0) { Control.Text = model.Items[Element.SelectedIndex]; } ElementController.SetValueFromRenderer(VisualElement.IsFocusedProperty, false); // It is also possible for the Content of the Page to be changed when Focus is changed. // In this case, we'll lose our Control. Control?.ClearFocus(); } _dialog = null; }); _dialog = builder.Create(); _dialog.DismissEvent += (ssender, args) => { ElementController?.SetValueFromRenderer(VisualElement.IsFocusedProperty, false); }; _dialog.Show(); }
public OnClickListenerAnonymousInnerClassHelper4(AlertDialog dialog, BixolonLabelPrinter printer, View layout) { this.dialog = dialog; this.printer = printer; this.layout = layout; }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: static void showWifiDialog(android.app.AlertDialog dialog, android.content.Context context, final com.bixolon.labelprinter.BixolonLabelPrinter printer) internal static void showWifiDialog(AlertDialog dialog, Context context, BixolonLabelPrinter printer) { if (dialog == null) { LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.view.View layout = inflater.inflate(R.layout.dialog_wifi, null); View layout = inflater.inflate(R.layout.dialog_wifi, null); dialog = (new AlertDialog.Builder(context)).setView(layout).setTitle("Wi-Fi Connect").setPositiveButton("OK", new OnClickListenerAnonymousInnerClassHelper4(dialog, printer, layout)) .setNegativeButton("Cancel", new OnClickListenerAnonymousInnerClassHelper5(dialog)) .create(); } dialog.show(); }
public AlertButton GenericAlert (Window parent, MessageDescription message) { var dialog = new AlertDialog (message) { TransientFor = parent ?? GetDefaultModalParent () }; return dialog.Run (); }
private void showSetTimeDialog() { if (mSetTimeDialog == null) { mView = mLayoutInflater.inflate(R.layout.dialog_set_time, null); mSetTimeDialog = (new AlertDialog.Builder(MainActivity.this)).setView(mView).setPositiveButton("Set", new OnClickListenerAnonymousInnerClassHelper4(this)) .setNegativeButton("Cancel", new OnClickListenerAnonymousInnerClassHelper5(this)) .create(); } mSetTimeDialog.show(); }
private void ButtonBuscar_Click(object sender, EventArgs e) { //Android.App.AlertDialog.Builder dialog = new AlertDialog.Builder(this); //AlertDialog alert = dialog.Create(); //alert.SetTitle("Error"); //alert.SetMessage("Algo salió mal"); //alert.SetIcon(Resource.Drawable.alert); //alert.SetButton("OK", (c, ev) => //{ // // Ok button click task //}); //alert.SetButton2("CANCEL", (c, ev) => { }); //alert.Show(); _dataSet = new Mensajero(); if (_irDesde.Text.Length > 0 && _viajarA.Text.Length > 0) { if (_dataSet.vuelosDisponibles(fechaDeVuelo, FechaDeVueloRetorno, _irDesde.Text.Substring(_irDesde.Length() - 4, 3), _viajarA.Text.Substring(_viajarA.Length() - 4, 3)) != null) { vuelos = _dataSet.vuelosDisponibles(fechaDeVuelo, FechaDeVueloRetorno, _irDesde.Text.Substring(_irDesde.Length() - 4, 3), _viajarA.Text.Substring(_viajarA.Length() - 4, 3)); if (vuelos.Count < 1) { Android.App.AlertDialog.Builder dialog = new AlertDialog.Builder(this); AlertDialog alert = dialog.Create(); alert.SetTitle("Disculpe la molestia"); alert.SetMessage("No hay vuelos disponibles"); alert.SetButton("OK", (c, ev) => { // Ok button click task }); alert.Show(); return; } Intent _intent = new Intent(this, typeof(VueloDisponibleActivity)); _intent.PutExtra("Vuelo", JsonConvert.SerializeObject(vuelos)); StartActivity(_intent); } else { Android.App.AlertDialog.Builder dialog = new AlertDialog.Builder(this); AlertDialog alert = dialog.Create(); alert.SetTitle("Error"); alert.SetMessage("Algo salió mal"); alert.SetButton("OK", (c, ev) => { // Ok button click task }); alert.Show(); } } else { Android.App.AlertDialog.Builder dialog = new AlertDialog.Builder(this); AlertDialog alert = dialog.Create(); alert.SetTitle("Error"); alert.SetMessage("LLenar correctamente los campos Origen y Destino de Viaje"); alert.SetButton("OK", (c, ev) => { // Ok button click task }); alert.Show(); } }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: static void showPrinterInformationDialog(android.app.AlertDialog dialog, android.content.Context context, final com.bixolon.labelprinter.BixolonLabelPrinter printer) internal static void showPrinterInformationDialog(AlertDialog dialog, Context context, BixolonLabelPrinter printer) { if (dialog == null) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final CharSequence[] ITEMS = { "Model name", "Firmware version" }; CharSequence[] ITEMS = new CharSequence[] {"Model name", "Firmware version"}; dialog = (new AlertDialog.Builder(context)).setTitle("Get printer ID").setItems(ITEMS, new OnClickListenerAnonymousInnerClassHelper6(dialog, printer)) .create(); } dialog.show(); }
// Prompt for portal item information private void ShowOAuthConfigDialog() { // Create a dialog to get OAuth information (client id, redirect url, etc.) AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this); // Create the layout LinearLayout dialogLayout = new LinearLayout(this) { Orientation = Orientation.Vertical }; // Create a text box for entering the client id LinearLayout clientIdLayout = new LinearLayout(this) { Orientation = Orientation.Horizontal }; TextView clientIdLabel = new TextView(this) { Text = "Client ID:" }; _clientIdText = new EditText(this); if (!String.IsNullOrEmpty(_appClientId)) { _clientIdText.Text = _appClientId; } clientIdLayout.AddView(clientIdLabel); clientIdLayout.AddView(_clientIdText); // Create a text box for entering the redirect url LinearLayout redirectUrlLayout = new LinearLayout(this) { Orientation = Orientation.Horizontal }; TextView redirectUrlLabel = new TextView(this) { Text = "Redirect:" }; _redirectUrlText = new EditText(this) { Hint = "https://my.redirect/url" }; if (!String.IsNullOrEmpty(_oAuthRedirectUrl)) { _redirectUrlText.Text = _oAuthRedirectUrl; } redirectUrlLayout.AddView(redirectUrlLabel); redirectUrlLayout.AddView(_redirectUrlText); // Create a button to dismiss the dialog (and proceed with updating the values) Button okButton = new Button(this) { Text = "Save" }; // Handle the click event for the OK button okButton.Click += OnCloseOAuthDialog; // Add the controls to the dialog dialogLayout.AddView(clientIdLayout); dialogLayout.AddView(redirectUrlLayout); dialogLayout.AddView(okButton); dialogBuilder.SetView(dialogLayout); dialogBuilder.SetTitle("Configure OAuth"); // Show the dialog _configOAuthDialog = dialogBuilder.Show(); }
public OnClickListenerAnonymousInnerClassHelper6(AlertDialog dialog, BixolonLabelPrinter printer) { this.dialog = dialog; this.printer = printer; }
private void StopEditTransaction(object sender, EventArgs e) { // Create a dialog to prompt the user to commit or rollback AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this); // Create the layout LinearLayout dialogLayout = new LinearLayout(this); dialogLayout.Orientation = Orientation.Vertical; // Create a button to commit edits Button commitButton = new Button(this); commitButton.Text = "Commit"; // Handle the click event for the Commit button commitButton.Click += (s, args) => { // See if there is a transaction active for the geodatabase if (_localGeodatabase.IsInTransaction) { // If there is, commit the transaction to store the edits (this will also end the transaction) _localGeodatabase.CommitTransaction(); _messageTextBlock.Text = "Edits were committed to the local geodatabase."; } _stopEditDialog.Dismiss(); }; // Create a button to rollback edits Button rollbackButton = new Button(this); rollbackButton.Text = "Rollback"; // Handle the click event for the Rollback button rollbackButton.Click += (s, args) => { // See if there is a transaction active for the geodatabase if (_localGeodatabase.IsInTransaction) { // If there is, rollback the transaction to discard the edits (this will also end the transaction) _localGeodatabase.RollbackTransaction(); _messageTextBlock.Text = "Edits were rolled back and not stored to the local geodatabase."; } _stopEditDialog.Dismiss(); }; // Create a button to cancel and return to the transaction Button cancelButton = new Button(this); cancelButton.Text = "Cancel"; // Handle the click event for the Cancel button rollbackButton.Click += (s, args) => _stopEditDialog.Dismiss(); // Add the controls to the dialog dialogLayout.AddView(cancelButton); dialogLayout.AddView(rollbackButton); dialogLayout.AddView(commitButton); dialogBuilder.SetView(dialogLayout); dialogBuilder.SetTitle("Stop Editing"); // Show the dialog _stopEditDialog = dialogBuilder.Show(); }
internal static void showSetPrintingTypeDialog(AlertDialog dialog, Context context) { mmCheckedItem = 0; if (dialog == null) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final CharSequence[] ITEMS = { "Direct thermal", "Thermal transter" }; CharSequence[] ITEMS = new CharSequence[] {"Direct thermal", "Thermal transter"}; dialog = (new AlertDialog.Builder(context)).setTitle([email protected]_printing_type).setSingleChoiceItems(ITEMS, 0, new OnClickListenerAnonymousInnerClassHelper7(dialog)) .setPositiveButton("OK", new OnClickListenerAnonymousInnerClassHelper8(dialog)) .setNegativeButton("Cancel", new OnClickListenerAnonymousInnerClassHelper9(dialog)) .create(); } dialog.show(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.activity_company); data = new DatabaseHelper(ApplicationContext); userId = Intent.GetStringExtra("UserId"); company = FindViewById <EditText> (Resource.Id.edtCompany); listCompany = FindViewById <ListView> (Resource.Id.lvCompany); GetCompany(); Button brnAddCompany = FindViewById <Button> (Resource.Id.btnAddCompany); brnAddCompany.Click += delegate { String wcompany = company.Text; if (!wcompany.Equals("")) { stockList.Add(wcompany); MbusheListen(); company.Text = ""; } else { Toast.MakeText(BaseContext, "Shënoni kompaninë ", ToastLength.Long).Show(); return; } }; Button btnSaveCompanies = FindViewById <Button> (Resource.Id.btnSaveCompanies); btnSaveCompanies.Click += delegate { try { if (stockList.Count > 0) { for (int j = 0; j < stockList.Count; j++) { String name = stockList [j]; if (!CheckNameInList(name)) { data.RegisterCompany(Convert.ToInt32(userId), name); } } Toast.MakeText(BaseContext, "Të dhënat u ruajtën me sukses! ", ToastLength.Long).Show(); } } catch (Exception) { } Intent conn = new Intent(ApplicationContext, typeof(ConnectionsActivity)); conn.PutExtra("UserId", (string)userId); conn.PutExtra("LogIn", "LogIn"); StartActivity(conn); }; listCompany.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => { string selectedFromList = listCompany.GetItemAtPosition(e.Position).ToString(); AlertDialog.Builder answer = new AlertDialog.Builder(this); AlertDialog alert = answer.Create(); alert.SetTitle("Question?"); alert.SetIcon(Resource.Drawable.Icon); alert.SetMessage("Do you want to delete this company !! "); alert.SetButton("Yes", (s, ev) => { try { stockList.Remove(selectedFromList); List <Company> companies = data.GetCompanyId(selectedFromList); data.deleteCompanyForCompanyId(companies [0].CompanyId); List <string> lista = new List <string> (); for (int i = 0; i < stockList.Count; i++) { stockList.RemoveAt(i); } GetCompany(); } catch (Exception) { Toast.MakeText(BaseContext, "Gabim në të dhëna ", ToastLength.Long).Show(); return; } }); alert.SetButton2("No", (s, ev) => { return; }); alert.Show(); }; }
public OnClickListenerAnonymousInnerClassHelper12(AlertDialog dialog, EditText editText, RadioGroup radioGroup) { this.dialog = dialog; this.editText = editText; this.radioGroup = radioGroup; }
async void AddressChangeRequest() { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.SetMessage(TranslationHelper.GetString("changeAddressInAccordanceWithTheMarkedPoint", _ci)); builder.SetPositiveButton(TranslationHelper.GetString("replace", _ci), async(object sender1, DialogClickEventArgs e1) => { var res_ = await ReverseGeocodeToConsoleAsync(); InitializeReverseValues(); }); builder.SetCancelable(true); builder.SetNegativeButton(TranslationHelper.GetString("doNotReplace", _ci), (object sender1, DialogClickEventArgs e1) => { }); AlertDialog dialog = builder.Create(); CameFromMap = false; if (!String.IsNullOrEmpty(FullCompanyAddressStatic)) { dialog.Show(); return; } if (!String.IsNullOrEmpty(FullCompanyAddressTemp)) { dialog.Show(); return; } if (!String.IsNullOrEmpty(Country)) { dialog.Show(); return; } if (!String.IsNullOrEmpty(Region)) { dialog.Show(); return; } if (!String.IsNullOrEmpty(City)) { dialog.Show(); return; } if (!String.IsNullOrEmpty(Index)) { dialog.Show(); return; } if (!String.IsNullOrEmpty(Notation)) { dialog.Show(); return; } if (!String.IsNullOrEmpty(CountryTemp)) { dialog.Show(); return; } if (!String.IsNullOrEmpty(RegionTemp)) { dialog.Show(); return; } if (!String.IsNullOrEmpty(CityTemp)) { dialog.Show(); return; } if (!String.IsNullOrEmpty(IndexTemp)) { dialog.Show(); return; } if (!String.IsNullOrEmpty(NotationTemp)) { dialog.Show(); return; } if (!String.IsNullOrEmpty(_countryEt.Text)) { dialog.Show(); return; } if (!String.IsNullOrEmpty(_regionEt.Text)) { dialog.Show(); return; } if (!String.IsNullOrEmpty(_cityEt.Text)) { dialog.Show(); return; } if (!String.IsNullOrEmpty(_detailAddressEt.Text)) { dialog.Show(); return; } if (!String.IsNullOrEmpty(_indexEt.Text)) { dialog.Show(); return; } if (!String.IsNullOrEmpty(_notationEt.Text)) { dialog.Show(); return; } string res = null; try { res = await ReverseGeocodeToConsoleAsync(); } catch (Exception ex) { if (!_methods.IsConnected()) { NoConnectionActivity.ActivityName = this; StartActivity(typeof(NoConnectionActivity)); Finish(); return; } } if (String.IsNullOrEmpty(res)) { if (!_methods.IsConnected()) { NoConnectionActivity.ActivityName = this; StartActivity(typeof(NoConnectionActivity)); Finish(); return; } } InitializeReverseValues(); }
internal static void showSetBufferModeDialog(AlertDialog dialog, Context context) { mmCheckedItem = 0; if (dialog == null) { dialog = (new AlertDialog.Builder(context)).setTitle("Set buffer mode").setSingleChoiceItems(new string[] {"false", "true"}, 0, new OnClickListenerAnonymousInnerClassHelper18()) .setPositiveButton("OK", new OnClickListenerAnonymousInnerClassHelper19(dialog)) .setNegativeButton("Cancel", new OnClickListenerAnonymousInnerClassHelper20(dialog)) .create(); } dialog.show(); }
public OnClickListenerAnonymousInnerClassHelper6(AlertDialog dialog, Context context, View layout) { this.dialog = dialog; this.context = context; this.layout = layout; }
internal static void showSetSpeedDialog(AlertDialog dialog, Context context) { mmCheckedItem = 0; if (dialog == null) { string[] items = new string[] {"2.5 ips", "3.0 ips", "4.0 ips", "5.0 ips", "6.0 ips", "7.0 ips", "8.0 ips"}; dialog = (new AlertDialog.Builder(context)).setTitle("Set speed").setSingleChoiceItems(items, 0, new OnClickListenerAnonymousInnerClassHelper21()) .setPositiveButton("OK", new OnClickListenerAnonymousInnerClassHelper22(dialog)) .setNegativeButton("Cancel", new OnClickListenerAnonymousInnerClassHelper23(dialog)) .create(); } dialog.show(); }
internal static void showPrinterIdDialog(AlertDialog dialog, Context context) { if (dialog == null) { dialog = (new AlertDialog.Builder(context)).setTitle("Get printer ID").setItems(PRINTER_ID_ITEMS, new OnClickListenerAnonymousInnerClassHelper13(dialog)) .create(); } dialog.show(); }
internal static void showSetOrientationDialog(AlertDialog dialog, Context context) { mmCheckedItem = 0; if (dialog == null) { dialog = (new AlertDialog.Builder(context)).setTitle("Set orientation").setSingleChoiceItems(new string[] {"Print from top to bottom (default)", "Print from bottom to top"}, 0, new OnClickListenerAnonymousInnerClassHelper26()) .setPositiveButton("OK", new OnClickListenerAnonymousInnerClassHelper27(dialog)) .setNegativeButton("Cancel", new OnClickListenerAnonymousInnerClassHelper28(dialog)) .create(); } dialog.show(); }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: static void showDirectIoDialog(android.app.AlertDialog dialog, final android.content.Context context) internal static void showDirectIoDialog(AlertDialog dialog, Context context) { if (dialog == null) { LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.view.View view = inflater.inflate(R.layout.dialog_direct_io, null); View view = inflater.inflate(R.layout.dialog_direct_io, null); dialog = (new AlertDialog.Builder(context)).setView(view).setTitle("Direct IO").setPositiveButton("OK", new OnClickListenerAnonymousInnerClassHelper20(dialog, context, view)) .setNegativeButton("Cancel", new OnClickListenerAnonymousInnerClassHelper21(dialog)) .create(); } dialog.show(); }
public OnClickListenerAnonymousInnerClassHelper31(AlertDialog dialog, View view) { this.dialog = dialog; this.view = view; }
private static AlertDialogInfo CreateDialog( string content, string title, string okText = null, string cancelText = null, Action <bool> afterHideCallbackWithResponse = null) { var tcs = new TaskCompletionSource <bool>(); var builder = new AlertDialog.Builder(ActivityBase.CurrentActivity); builder.SetMessage(content); builder.SetTitle(title); AlertDialog dialog = null; builder.SetPositiveButton(okText ?? "OK", (d, index) => { tcs.TrySetResult(true); // ReSharper disable AccessToModifiedClosure if (dialog != null) { dialog.Dismiss(); dialog.Dispose(); } if (afterHideCallbackWithResponse != null) { afterHideCallbackWithResponse(true); } // ReSharper restore AccessToModifiedClosure }); if (cancelText != null) { builder.SetNegativeButton(cancelText, (d, index) => { tcs.TrySetResult(false); // ReSharper disable AccessToModifiedClosure if (dialog != null) { dialog.Dismiss(); dialog.Dispose(); } if (afterHideCallbackWithResponse != null) { afterHideCallbackWithResponse(false); } // ReSharper restore AccessToModifiedClosure }); } builder.SetOnDismissListener(new OnDismissListener(() => { tcs.TrySetResult(false); if (afterHideCallbackWithResponse != null) { afterHideCallbackWithResponse(false); } })); dialog = builder.Create(); return(new AlertDialogInfo { Dialog = dialog, Tcs = tcs }); }
internal static void showAutoCutterDialog(AlertDialog dialog, Context context) { if (dialog == null) { LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View view = inflater.inflate(R.layout.dialog_set_auto_cutter, null); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.widget.EditText editText = (android.widget.EditText) view.findViewById(R.id.editText1); EditText editText = (EditText) view.findViewById(R.id.editText1); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.widget.RadioGroup radioGroup = (android.widget.RadioGroup) view.findViewById(R.id.radioGroup1); RadioGroup radioGroup = (RadioGroup) view.findViewById(R.id.radioGroup1); radioGroup.OnCheckedChangeListener = new OnCheckedChangeListenerAnonymousInnerClassHelper2(editText); dialog = (new AlertDialog.Builder(context)).setTitle([email protected]_action).setView(view).setPositiveButton("OK", new OnClickListenerAnonymousInnerClassHelper33(dialog, editText, radioGroup)) .setNegativeButton("Cancel", new OnClickListenerAnonymousInnerClassHelper34(dialog)) .create(); } dialog.show(); }
public bool CheckMedia(string type) { if (type.Equals("Image")) { //int c = await database.GetMediaCount(type, taskId); //List<Compliance> list = dbHelper.GetCompliance(type, taskid) ; List <ComplianceJoinTable> list = dbHelper.GetComplianceJoinTable(taskid); if (list.Count == 0) { Java.IO.File path = Android.OS.Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryPictures); fileName1 = new Java.IO.File(path, "OPDApp"); if (!fileName1.Exists()) { fileName1.Mkdirs(); } imageName = Utility.fileName(); Intent intent = new Intent(MediaStore.ActionImageCapture); fileImagePath = new Java.IO.File(fileName1, string.Format(imageName, Guid.NewGuid())); imageURL = fileImagePath.AbsolutePath; intent.PutExtra(MediaStore.ExtraOutput, Android.Net.Uri.FromFile(fileImagePath)); intent.AddFlags(ActivityFlags.GrantReadUriPermission); StartActivityForResult(intent, 0); } else { int a = list[0].max_numbers; if (a > imageCount) { return(true); } else { AlertDialog.Builder dialog = new AlertDialog.Builder(this); AlertDialog alert = dialog.Create(); alert.SetTitle("Compliance"); alert.SetMessage("You have reached Maximum Limit"); alert.SetButton("OK", (c, ev) => { // Ok button click task }); alert.Show(); // await DisplayAlert("Compliance", " You Reached Maximum Limit", "OK"); // return false; } } } if (type.Equals("Video")) { //int c = await database.GetMediaCount(type, taskId); //List<Compliance> list = dbHelper.GetCompliance(type, taskid) ; List <ComplianceJoinTable> list = dbHelper.GetComplianceJoinTable(taskid); if (list.Count == 0) { Intent intent = new Intent(MediaStore.ActionVideoCapture); intent.PutExtra(MediaStore.ExtraOutput, path); intent.PutExtra(MediaStore.ExtraVideoQuality, 1); // intent.PutExtra(MediaStore.ExtraDurationLimit, 10); StartActivityForResult(intent, 0); } else { int a = list[0].max_numbers; if (a > videocount) { return(true); } else { AlertDialog.Builder dialog = new AlertDialog.Builder(this); AlertDialog alert = dialog.Create(); alert.SetTitle("Compliance"); alert.SetMessage("You have reached Maximum Limit"); alert.SetButton("OK", (c, ev) => { // Ok button click task }); alert.Show(); // await DisplayAlert("Compliance", " You Reached Maximum Limit", "OK"); // return false; } } } if (type.Equals("Audio")) { //int c = await database.GetMediaCount(type, taskId); //List<Compliance> list = dbHelper.GetCompliance(type, taskid) ; List <ComplianceJoinTable> list = dbHelper.GetComplianceJoinTable(taskid); int a = list[0].max_numbers; if (a > audiocount) { return(true); } else { AlertDialog.Builder dialog = new AlertDialog.Builder(this); AlertDialog alert = dialog.Create(); alert.SetTitle("Compliance"); alert.SetMessage("You have reached Maximum Limit"); alert.SetButton("OK", (c, ev) => { // Ok button click task }); alert.Show(); // await DisplayAlert("Compliance", " You Reached Maximum Limit", "OK"); // return false; } } return(false); }
public async Task <int> CheckCredentials(string datatoken, string userid, string password) { //Check username and password System.Diagnostics.Debug.WriteLine("We are inside the outer task"); ProgressDialog pd = new ProgressDialog(Activity); pd.SetMessage("Checking username and password"); pd.SetCancelable(false); pd.Show(); AlertDialog.Builder builder = new AlertDialog.Builder((Activity)); await Task.Run(() => { Debug.WriteLine("We are checking username"); HttpWebResponse resp; try { DataSetLocationResolver dslr = new DataSetLocationResolver(); dslr.ResolveFromToken(datatoken, out baseurl, out dataset); System.Diagnostics.Debug.WriteLine("Base url :" + baseurl); AccountStorage.SetContext(Activity); AccountStorage.Set(userid, password, baseurl, dataset); var req = WebRequest.CreateHttp(AccountStorage.BaseUrl + "api/v1/datasets/" + AccountStorage.DataSet + "/"); req.Method = "GET"; req.AllowAutoRedirect = false; string credential = userid + ":" + password; req.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes(credential))); // req.Get resp = (HttpWebResponse)req.GetResponse(); if (resp.StatusCode == HttpStatusCode.OK) { if (resp.GetResponseStream().CanRead) { Stream data = resp.GetResponseStream(); var reader = new StreamReader(data); string responseStr = reader.ReadToEnd(); Debug.WriteLine(responseStr); if (responseStr.Contains("auth-required")) { Debug.WriteLine("Wrong credentials 2"); AccountStorage.ClearStorage(); Activity.RunOnUiThread(() => { if (pd.IsShowing) { pd.Dismiss(); } builder.SetTitle("Wrong Credentials") .SetMessage("Please check your username and password and try again.") .SetNeutralButton("Okay", (sender2, args2) => { builder.Dispose(); }) .SetCancelable(false); AlertDialog alert = builder.Create(); alert.Show(); Debug.WriteLine("We should have shown the dialog now"); }); } else if (responseStr.Contains("permission-denied")) { Debug.WriteLine("permission issue"); AccountStorage.ClearStorage(); Activity.RunOnUiThread(() => { if (pd.IsShowing) { pd.Dismiss(); } builder.SetTitle("Access Denied") .SetMessage("You donot have access to this dataset") .SetNeutralButton("Okay", (sender2, args2) => { builder.Dispose(); }) .SetCancelable(false); AlertDialog alert = builder.Create(); alert.Show(); }); } else if (responseStr.Contains("dataset")) { Debug.WriteLine("Username and password was correct"); Activity.RunOnUiThread(() => { pd.SetMessage("Getting Account Info"); pd.SetCancelable(false); if (!pd.IsShowing) { pd.Show(); } }); Task.Run(() => { //LOAD METHOD TO GET ACCOUNT INFO Debug.WriteLine("We are going to store the values"); Debug.WriteLine("We have stored the values"); Debug.WriteLine(AccountStorage.BaseUrl); Debug.WriteLine(AccountStorage.DataSet); Debug.WriteLine(AccountStorage.Password); Debug.WriteLine(AccountStorage.UserId); // Switch to next screen //HIDE PROGRESS DIALOG Activity.RunOnUiThread(() => { if (pd.IsShowing) { pd.Dismiss(); } Toast.MakeText(Activity, "Logged in", ToastLength.Short).Show(); ((MainActivity)Activity).FragmentManager.PopBackStack(); ((MainActivity)Activity).SetDrawerState(true); ((MainActivity)Activity).SwitchToFragment( MainActivity.FragmentTypes.Home); }); }); } } } } catch (WebException e) { Debug.WriteLine("We have a problem"); Activity.RunOnUiThread(() => { if (pd.IsShowing) { pd.Dismiss(); } }); using (WebResponse response = e.Response) { HttpWebResponse httpResponse = (HttpWebResponse)response; Console.WriteLine("Error code: {0}", httpResponse.StatusCode); if (httpResponse.StatusCode == HttpStatusCode.Unauthorized) { Debug.WriteLine("Wrong credentials"); AccountStorage.ClearStorage(); Activity.RunOnUiThread(() => { try { builder.SetTitle("Unauthorized") .SetMessage( "Please check your username and password and data token and try again.") .SetNeutralButton("Okay", (sender2, args2) => { builder.Dispose(); }) .SetCancelable(false); AlertDialog alert = builder.Create(); alert.Show(); } catch (Exception e2) { Debug.WriteLine("We have hit an error while showing the dialog :" + e2.Message); AccountStorage.ClearStorage(); } }); } } } catch (Exception e) { // Catching any generic exception Debug.WriteLine("We have hit a generic exception :" + e.Message); AccountStorage.ClearStorage(); Activity.RunOnUiThread(() => { AlertDialog.Builder builder2 = new AlertDialog.Builder(Activity); builder2.SetTitle("Error occured") .SetMessage(e.Message + ". Please report this error to the developers. We are sorry for the inconvenience.") .SetNeutralButton("Okay", (sender2, args2) => { builder2.Dispose(); }) .SetCancelable(false); AlertDialog alert2 = builder2.Create(); alert2.Show(); }); } return(true); }); // pd.Dismiss(); System.Diagnostics.Debug.WriteLine("We are done with the outer task"); return(0); }
public string ShowKeyboardInput( string defaultText) { var waitHandle = new EventWaitHandle(false, EventResetMode.AutoReset); OnKeyboardWillShow(); IsVisible = true; CCGame.Activity.RunOnUiThread(() => { var alert = new AlertDialog.Builder(Game.Activity); var input = new EditText(Game.Activity) { Text = defaultText }; // Set the input fields input filter to accept only uppercase input.SetFilters(new Android.Text.IInputFilter[] { new Android.Text.InputFilterAllCaps() }); if (defaultText != null) { input.SetSelection(defaultText.Length); } alert.SetView(input); alert.SetPositiveButton("Ok", (dialog, whichButton) => { ContentText = input.Text; waitHandle.Set(); IsVisible = false; OnKeyboardWillHide(); }); alert.SetNegativeButton("Cancel", (dialog, whichButton) => { ContentText = null; waitHandle.Set(); IsVisible = false; OnKeyboardWillHide(); }); alert.SetCancelable(false); alertDialog = alert.Create(); alertDialog.Show(); OnKeyboardDidShow(); }); waitHandle.WaitOne(); if (alertDialog != null) { alertDialog.Dismiss(); alertDialog.Dispose(); alertDialog = null; } OnReplaceText(new CCIMEKeybardEventArgs(contentText, contentText.Length)); IsVisible = false; return(contentText); }
private Widget CreateThemeEditor() { var pane = new Widget { Layout = new VBoxLayout { Spacing = 10 }, Padding = contentPadding }; var themeEditor = new ColorThemeEditor() { Layout = new VBoxLayout { Spacing = 10 }, Padding = contentPadding }; bool firstCall = true; pane.AddChangeWatcher(() => themeEditor.Version, _ => { if (firstCall) { firstCall = false; return; } themeChanged = true; }); var darkIcons = CreateDarkIconsSwitch(pane); var loadDarkButton = new ThemedButton("Dark preset") { Clicked = () => { AppUserPreferences.Instance.LimeColorTheme = Theme.ColorTheme.CreateDarkTheme(); AppUserPreferences.Instance.ColorTheme = ColorTheme.CreateDarkTheme(); themeEditor.Rebuild(); themeChanged = true; } }; var loadLightButton = new ThemedButton("Light preset") { Clicked = () => { AppUserPreferences.Instance.LimeColorTheme = Theme.ColorTheme.CreateLightTheme(); AppUserPreferences.Instance.ColorTheme = ColorTheme.CreateLightTheme(); themeEditor.Rebuild(); themeChanged = true; } }; var saveButton = new ThemedButton("Save theme") { Clicked = () => { var dlg = new FileDialog { AllowedFileTypes = new string[] { "theme" }, Mode = FileDialogMode.Save }; if (dlg.RunModal()) { string path = dlg.FileName; var serializer = new Yuzu.Json.JsonSerializer(); try { var limeTheme = AppUserPreferences.Instance.LimeColorTheme; var theme = AppUserPreferences.Instance.ColorTheme; using (var fileStream = new FileStream(path, FileMode.OpenOrCreate)) { serializer.ToStream(new List <object> { limeTheme, theme }, fileStream); } } catch (System.Exception e) { AlertDialog.Show(e.Message); } } } }; var loadButton = new ThemedButton("Load theme") { Clicked = () => { var dlg = new FileDialog { AllowedFileTypes = new string[] { "theme" }, Mode = FileDialogMode.Open }; if (dlg.RunModal()) { string path = dlg.FileName; var deserializer = new Yuzu.Json.JsonDeserializer(); try { using (var fs = new FileStream(path, FileMode.OpenOrCreate)) { var read = deserializer.FromStream(new List <object>(), fs) as List <object>; AppUserPreferences.Instance.LimeColorTheme = (Theme.ColorTheme)read[0]; AppUserPreferences.Instance.ColorTheme = (ColorTheme)read[1]; } } catch (System.Exception e) { AlertDialog.Show(e.Message); } } themeEditor.Rebuild(); themeChanged = true; } }; var buttons = new Widget { Layout = new HBoxLayout { Spacing = 4 }, Nodes = { loadDarkButton, loadLightButton, saveButton, loadButton } }; pane.AddNode(buttons); pane.AddNode(themeEditor); return(pane); }
IEnumerator <object> CreateSplinePoint3DTask() { var input = SceneView.Instance.Input; while (true) { if (SceneView.Instance.InputArea.IsMouseOver()) { Utils.ChangeCursorIfDefault(MouseCursor.Hand); } CreateNodeRequestComponent.Consume <Node>(SceneView.Instance.Components); if (SceneView.Instance.Input.ConsumeKeyPress(Key.Mouse0)) { SplinePoint3D point; try { point = (SplinePoint3D)Core.Operations.CreateNode.Perform(typeof(SplinePoint3D), aboveSelected: false); } catch (InvalidOperationException e) { AlertDialog.Show(e.Message); yield break; } var spline = (Spline3D)Document.Current.Container; var vp = spline.Viewport; var ray = vp.ScreenPointToRay(SceneView.Instance.Input.MousePosition); var xyPlane = new Plane(new Vector3(0, 0, 1), 0).Transform(spline.GlobalTransform); var d = ray.Intersects(xyPlane); if (d.HasValue) { var pos = (ray.Position + ray.Direction * d.Value) * spline.GlobalTransform.CalcInverted(); Core.Operations.SetProperty.Perform(point, nameof(SplinePoint3D.Position), pos); Document.Current.History.BeginTransaction(); try { while (input.IsMousePressed()) { Document.Current.History.RevertActiveTransaction(); ray = vp.ScreenPointToRay(SceneView.Instance.Input.MousePosition); d = ray.Intersects(xyPlane); if (d.HasValue) { var tangent = (ray.Position + ray.Direction * d.Value) * spline.GlobalTransform.CalcInverted() - point.Position; Core.Operations.SetProperty.Perform(point, nameof(SplinePoint3D.TangentA), tangent); Core.Operations.SetProperty.Perform(point, nameof(SplinePoint3D.TangentB), -tangent); } yield return(null); } } finally { if (point.TangentA.Length < 0.01f) { Core.Operations.SetProperty.Perform(point, nameof(SplinePoint3D.TangentA), new Vector3(1, 0, 0)); Core.Operations.SetProperty.Perform(point, nameof(SplinePoint3D.TangentB), new Vector3(-1, 0, 0)); } Document.Current.History.EndTransaction(); } } } if (SceneView.Instance.Input.WasMousePressed(1)) { break; } yield return(null); } Utils.ChangeCursorIfDefault(MouseCursor.Default); }
public PreferencesDialog() { window = new Window(new WindowOptions { ClientSize = new Vector2(800, 600), FixedSize = false, Title = "Preferences", MinimumDecoratedSize = new Vector2(400, 300), Visible = false }); Frame = new ThemedFrame { Padding = new Thickness(8), LayoutCell = new LayoutCell { StretchY = float.MaxValue }, Layout = new StackLayout(), }; Content = new TabbedWidget(); Content.AddTab("General", CreateGeneralPane(), true); Content.AddTab("Appearance", CreateColorsPane()); Content.AddTab("Theme", CreateThemePane()); Content.AddTab("Keyboard shortcuts", CreateKeyboardPane()); Content.AddTab("Toolbar", toolbarModelEditor = new ToolbarModelEditor()); rootWidget = new ThemedInvalidableWindowWidget(window) { Padding = new Thickness(8), Layout = new VBoxLayout(), Nodes = { Content, new Widget { Layout = new HBoxLayout { Spacing = 8 }, LayoutCell = new LayoutCell(Alignment.LeftCenter), Padding = new Thickness { Top = 5 }, Nodes = { (resetButton = new ThemedButton { Text = "Reset To Defaults", MinMaxWidth = 150f }), new Widget { MinMaxHeight = 0 }, (okButton = new ThemedButton { Text = "Ok" }), (cancelButton = new ThemedButton { Text = "Cancel" }), } } } }; HotkeyRegistry.CurrentProfile.Save(); okButton.Clicked += () => { saved = true; SaveAfterEdit(); window.Close(); VisualHintsPanel.Refresh(); Core.UserPreferences.Instance.Save(); if (themeChanged) { AlertDialog.Show("Color theme changes will be applied after Tangerine restart."); } }; resetButton.Clicked += () => { if (new AlertDialog($"Are you sure you want to reset to defaults?", "Yes", "Cancel").Show() == 0) { ResetToDefaults(); } }; cancelButton.Clicked += () => { window.Close(); Core.UserPreferences.Instance.Load(); }; rootWidget.FocusScope = new KeyboardFocusScope(rootWidget); rootWidget.LateTasks.AddLoop(() => { if (rootWidget.Input.ConsumeKeyPress(Key.Escape)) { window.Close(); Core.UserPreferences.Instance.Load(); } }); okButton.SetFocus(); window.Closed += () => { if (saved) { foreach (var profile in HotkeyRegistry.Profiles) { profile.Save(); } HotkeyRegistry.CurrentProfile = currentProfile; } else { foreach (var profile in HotkeyRegistry.Profiles) { profile.Load(); } HotkeyRegistry.CurrentProfile = HotkeyRegistry.CurrentProfile; } }; foreach (var command in HotkeyRegistry.CurrentProfile.Commands) { command.Command.Shortcut = new Shortcut(Key.Unknown); } window.ShowModal(); }
protected void OnDestroy() { _instance = null; }
void InternalSetPage(Page page) { if (!Forms.IsInitialized) { throw new InvalidOperationException("Call Forms.Init (Activity, Bundle) before this"); } if (_canvas != null) { _canvas.SetPage(page); return; } var busyCount = 0; MessagingCenter.Subscribe(this, Page.BusySetSignalName, (Page sender, bool enabled) => { busyCount = Math.Max(0, enabled ? busyCount + 1 : busyCount - 1); UpdateProgressBarVisibility(busyCount > 0); }); UpdateProgressBarVisibility(busyCount > 0); MessagingCenter.Subscribe(this, Page.AlertSignalName, (Page sender, AlertArguments arguments) => { AlertDialog alert = new AlertDialog.Builder(this).Create(); alert.SetTitle(arguments.Title); alert.SetMessage(arguments.Message); if (arguments.Accept != null) { alert.SetButton((int)DialogButtonType.Positive, arguments.Accept, (o, args) => arguments.SetResult(true)); } alert.SetButton((int)DialogButtonType.Negative, arguments.Cancel, (o, args) => arguments.SetResult(false)); alert.CancelEvent += (o, args) => { arguments.SetResult(false); }; alert.Show(); }); MessagingCenter.Subscribe(this, Page.ActionSheetSignalName, (Page sender, ActionSheetArguments arguments) => { var builder = new AlertDialog.Builder(this); builder.SetTitle(arguments.Title); string[] items = arguments.Buttons.ToArray(); builder.SetItems(items, (sender2, args) => { arguments.Result.TrySetResult(items[args.Which]); }); if (arguments.Cancel != null) { builder.SetPositiveButton(arguments.Cancel, delegate { arguments.Result.TrySetResult(arguments.Cancel); }); } if (arguments.Destruction != null) { builder.SetNegativeButton(arguments.Destruction, delegate { arguments.Result.TrySetResult(arguments.Destruction); }); } AlertDialog dialog = builder.Create(); builder.Dispose(); //to match current functionality of renderer we set cancelable on outside //and return null dialog.SetCanceledOnTouchOutside(true); dialog.CancelEvent += (sender3, e) => { arguments.SetResult(null); }; dialog.Show(); }); _canvas = new Platform(this); if (_application != null) { _application.Platform = _canvas; } _canvas.SetPage(page); _layout.AddView(_canvas.GetViewGroup()); }
public DialogInformacaoDroid() { var dialogBuilder = new AlertDialog.Builder(CrossCurrentActivity.Current.Activity); _dialog = dialogBuilder.Create(); }
/// <summary> /// Dismisses the text / icon dialog /// </summary> public void DismissDialog() { iconDialog?.Dismiss(); iconDialog = null; }
public override void ShowError(string message) { Application.InvokeOnMainThread(() => AlertDialog.Show(message)); }
/// <summary> /// Dismisses the text input dialog /// </summary> public void DismissInputDialog() { inputDialog?.Dismiss(); inputDialog = null; }
public FlexibleAlertDialog(AlertDialog alertDialog) { _legacyAlertDialog = alertDialog; }
/// <summary> /// Dismisses the searchable list dialog /// </summary> public void DismissSearchListDialog() { searchList?.Dismiss(); searchList = null; }
void IPickerRenderer.OnClick() { Picker model = Element; if (_dialog != null) { return; } var picker = new NumberPicker(Context); if (model.Items != null && model.Items.Any()) { picker.MaxValue = model.Items.Count - 1; picker.MinValue = 0; picker.SetDisplayedValues(model.Items.ToArray()); picker.WrapSelectorWheel = false; picker.DescendantFocusability = DescendantFocusability.BlockDescendants; picker.Value = model.SelectedIndex; } var layout = new LinearLayout(Context) { Orientation = Orientation.Vertical }; layout.AddView(picker); ElementController.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, true); var builder = new AlertDialog.Builder(Context); builder.SetView(layout); if (!Element.IsSet(Picker.TitleColorProperty)) { builder.SetTitle(model.Title ?? ""); } else { var title = new SpannableString(model.Title ?? ""); title.SetSpan(new ForegroundColorSpan(model.TitleColor.ToAndroid()), 0, title.Length(), SpanTypes.ExclusiveExclusive); builder.SetTitle(title); } builder.SetNegativeButton(global::Android.Resource.String.Cancel, (s, a) => { ElementController.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, false); _dialog = null; }); builder.SetPositiveButton(global::Android.Resource.String.Ok, (s, a) => { ElementController.SetValueFromRenderer(Picker.SelectedIndexProperty, picker.Value); // It is possible for the Content of the Page to be changed on SelectedIndexChanged. // In this case, the Element & Control will no longer exist. if (Element != null) { if (model.Items.Count > 0 && Element.SelectedIndex >= 0) { Control.Text = model.Items[Element.SelectedIndex]; } ElementController.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, false); } _dialog = null; }); _dialog = builder.Create(); _dialog.DismissEvent += (sender, args) => { ElementController?.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, false); }; _dialog.Show(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.PlannenView); RelatiePlannenModel relatiePlannenModel = new RelatiePlannenModel(); string id = Intent.GetStringExtra("id"); string userId = Intent.GetStringExtra("userId"); TextView titel = FindViewById <TextView>(Resource.Id.txtReceptTitel); TextView beschrijving = FindViewById <TextView>(Resource.Id.txtReceptBeschrijving); ImageButton favorieten = FindViewById <ImageButton>(Resource.Id.favorietenReceptBtn); Models.PlannenModel model = new Models.PlannenModel(); Plannen plannen = model.GetSingleData(id); titel.Text = plannen.titel; beschrijving.Text = plannen.tip; favorieten.Click += delegate { if (string.IsNullOrEmpty(userId)) { messageHandler(3, null); } else { if (relatiePlannenModel.checkIfExists(userId, id)) { relatiePlannenModel.deleteFavoriet(userId, id); messageHandler(2, loginModel.requestUser(userId)); } else { relatiePlannenModel.setFavoriet(userId, id); messageHandler(1, loginModel.requestUser(userId)); } } }; void messageHandler(int switchId, Gebruiker gebruiker) { switch (switchId) { case 1: Android.App.AlertDialog.Builder popupMessage1 = new AlertDialog.Builder(this); AlertDialog alert1 = popupMessage1.Create(); alert1.SetTitle("Favoriet toegevoegd!"); alert1.SetMessage("Het plan is aan de favorieten toegevoegd van gebruiker " + gebruiker.gebruikersnaam + "."); alert1.SetButton("OK", (c, ev) => { }); alert1.Show(); break; case 2: Android.App.AlertDialog.Builder popupMessage2 = new AlertDialog.Builder(this); AlertDialog alert2 = popupMessage2.Create(); alert2.SetTitle("Favoriet verwijderd!"); alert2.SetMessage("Het plan is uit de favorieten gehaald van gebruiker " + gebruiker.gebruikersnaam + "."); alert2.SetButton("OK", (c, ev) => { }); alert2.Show(); break; case 3: Android.App.AlertDialog.Builder popupMessage3 = new AlertDialog.Builder(this); AlertDialog alert3 = popupMessage3.Create(); alert3.SetTitle("Favoriet toevoegen mislukt!"); alert3.SetMessage("U moet ingelogd zijn om gebruik te maken van deze functie."); alert3.SetButton("OK", (c, ev) => { }); alert3.Show(); break; } } }
internal static void showPrintColorDialog(AlertDialog dialog, Context context) { if (dialog == null) { dialog = (new AlertDialog.Builder(context)).setTitle("Print color").setItems(PRINT_COLOR_ITEMS, new OnClickListenerAnonymousInnerClassHelper25(dialog)) .create(); } dialog.show(); }
public async Task <string> GetFileOrDirectoryAsync(String dir) { File dirFile = new File(dir); while (!dirFile.Exists() || !dirFile.IsDirectory) { dir = dirFile.Parent; dirFile = new File(dir); Log.Debug("~~~~~", "dir=" + dir); } Log.Debug("~~~~~", "dir=" + dir); //m_sdcardDirectory try { dir = new File(dir).CanonicalPath; } catch (IOException ioe) { return(_result); } _mDir = dir; _mSubdirs = GetDirectories(dir); AlertDialog.Builder dialogBuilder = CreateDirectoryChooserDialog(dir, _mSubdirs, (sender, args) => { String mDirOld = _mDir; String sel = "" + ((AlertDialog)sender).ListView.Adapter.GetItem(args.Which); if (sel[sel.Length - 1] == '/') { sel = sel.Substring(0, sel.Length - 1); } // Navigate into the sub-directory if (sel.Equals("..")) { _mDir = _mDir.Substring(0, _mDir.LastIndexOf("/")); if ("".Equals(_mDir)) { _mDir = "/"; } } else { _mDir += "/" + sel; } _selectedFileName = DefaultFileName; if ((new File(_mDir).IsFile)) // If the selection is a regular file { _mDir = mDirOld; _selectedFileName = sel; } UpdateDirectory(); }); dialogBuilder.SetPositiveButton("OK", (sender, args) => { // Current directory chosen // Call registered listener supplied with the chosen directory { if (_selectType == _fileOpen || _selectType == _fileSave) { _selectedFileName = _inputText.Text + ""; _result = _mDir + "/" + _selectedFileName; _autoResetEvent.Set(); } else { _result = _mDir; _autoResetEvent.Set(); } } }); dialogBuilder.SetNegativeButton("Cancel", (sender, args) => {}); _dirsDialog = dialogBuilder.Create(); _dirsDialog.CancelEvent += (sender, args) => { _autoResetEvent.Set(); }; _dirsDialog.DismissEvent += (sender, args) => { _autoResetEvent.Set(); }; // Show directory chooser dialog _autoResetEvent = new AutoResetEvent(false); _dirsDialog.Show(); await Task.Run(() => { _autoResetEvent.WaitOne(); }); return(_result); }
public OnClickListenerAnonymousInnerClassHelper10(AlertDialog dialog, View layout) { this.dialog = dialog; this.layout = layout; }
void OnClick() { Picker model = Element; var picker = new NumberPicker(Context); if (model.Items != null && model.Items.Any()) { picker.MaxValue = model.Items.Count - 1; picker.MinValue = 0; picker.SetDisplayedValues(model.Items.ToArray()); picker.WrapSelectorWheel = false; picker.DescendantFocusability = DescendantFocusability.BlockDescendants; picker.Value = model.SelectedIndex; } var layout = new LinearLayout(Context) { Orientation = Orientation.Vertical }; layout.AddView(picker); ElementController.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, true); var builder = new AlertDialog.Builder(Context); builder.SetView(layout); builder.SetTitle(model.Title ?? ""); builder.SetNegativeButton(global::Android.Resource.String.Cancel, (s, a) => { ElementController.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, false); // It is possible for the Content of the Page to be changed when Focus is changed. // In this case, we'll lose our Control. Control?.ClearFocus(); _dialog = null; }); builder.SetPositiveButton(global::Android.Resource.String.Ok, (s, a) => { ElementController.SetValueFromRenderer(Picker.SelectedIndexProperty, picker.Value); // It is possible for the Content of the Page to be changed on SelectedIndexChanged. // In this case, the Element & Control will no longer exist. if (Element != null) { if (model.Items.Count > 0 && Element.SelectedIndex >= 0) { Control.Text = model.Items[Element.SelectedIndex]; } ElementController.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, false); // It is also possible for the Content of the Page to be changed when Focus is changed. // In this case, we'll lose our Control. Control?.ClearFocus(); } _dialog = null; }); _dialog = builder.Create(); _dialog.DismissEvent += (sender, args) => { ElementController.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, false); }; _dialog.Show(); }
public OnClickListenerAnonymousInnerClassHelper12(AlertDialog dialog, Context context, Handler handler) { this.dialog = dialog; this.context = context; this.handler = handler; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Match); AdView adView = FindViewById <AdView>(Resource.Id.adView); AdRequest adRequest = new AdRequest.Builder().Build(); adView.LoadAd(adRequest); Button saveTeams = FindViewById <Button>(Resource.Id.btnMatchSave); Button rePickTeams = FindViewById <Button>(Resource.Id.btnMatchRePick); ImageButton cancelMatch = FindViewById <ImageButton>(Resource.Id.btnCancelMatch); ImageButton deleteMatch = FindViewById <ImageButton>(Resource.Id.btnDeleteMatch); ImageButton shareMatch = FindViewById <ImageButton>(Resource.Id.btnShareMatch); string mode = Intent.GetStringExtra("Mode"); if (mode == "Create") { string playerDataString = Intent.GetStringExtra("selectedPlayerData"); selectedPlayers = JsonHelper.FromJSON <PlayerData>(playerDataString); match = mLogic.PickTeams(selectedPlayers); deleteMatch.Visibility = ViewStates.Gone; } else { Guid matchID = Guid.Parse(mode); match = mLogic.SelectByID(matchID); rePickTeams.Visibility = ViewStates.Gone; } ListView teamListView = FindViewById <ListView>(Resource.Id.listTeams); teamListView.Adapter = new TeamListAdapter(this, match.Teams, mode); saveTeams.Click += (sender, args) => { if (mode == "Create") { mLogic.Create(match); } else { mLogic.Update(match); } StartActivity(typeof(MatchListActivity)); Finish(); }; rePickTeams.Click += (sender, args) => { match = mLogic.PickTeams(selectedPlayers, true, true); teamListView.Adapter = new TeamListAdapter(this, match.Teams, "Create"); Toast.MakeText(this, "Teams Regenerated.", ToastLength.Short).Show(); }; cancelMatch.Click += (sender, args) => { if (mode != "Create") { StartActivity(typeof(MatchListActivity)); } Finish(); }; deleteMatch.Click += (sender, args) => { int totalTeams = match.Teams.Count; AlertDialog.Builder builder = new AlertDialog.Builder(this); AlertDialog alertDialog = builder.Create(); alertDialog.SetTitle("Delete Match?"); alertDialog.SetIcon(Android.Resource.Drawable.IcMenuDelete); string message = string.Format("Are you sure you wish to delete this match from {0} for {1} teams?", match.DatePicked.ToShortDateString(), totalTeams.ToString()); alertDialog.SetMessage(message); alertDialog.SetButton("OK", (s, ev) => { mLogic.Delete(match.MatchID); Toast.MakeText(this, "Match deleted.", ToastLength.Short).Show(); Intent intent = new Intent(this, typeof(SelectionActivity)); intent.SetFlags(ActivityFlags.ClearTop); StartActivity(intent); Intent intent2 = new Intent(this, typeof(MatchListActivity)); StartActivity(intent2); Finish(); }); alertDialog.SetButton2("Cancel", (s, ev) => { }); alertDialog.Show(); }; shareMatch.Click += (sender, args) => { if (CrossShare.IsSupported) { CrossShare.Current.Share(new ShareMessage { Title = "I just picked these teams using Team Picker!", Text = StringHelper.WriteMatch(match) }, new ShareOptions { ChooserTitle = "Share Teams" }); } }; }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET: //ORIGINAL LINE: static void showPrintSpeedDialog(android.app.AlertDialog dialog, final android.content.Context context) internal static void showPrintSpeedDialog(AlertDialog dialog, Context context) { if (dialog == null) { dialog = (new AlertDialog.Builder(context)).setTitle("Print speed").setSingleChoiceItems(PRINT_SPEED_ITEMS, 0, new OnClickListenerAnonymousInnerClassHelper14(dialog)) .setPositiveButton("OK", new OnClickListenerAnonymousInnerClassHelper15(dialog)) .setNegativeButton("Cancel", new OnClickListenerAnonymousInnerClassHelper16(dialog)) .create(); } mSpeed = BixolonPrinter.PRINT_SPEED_HIGH; dialog.show(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Qrdialog); ipadre = ""; IPAddress[] localIPs = Dns.GetHostAddresses(Dns.GetHostName()); foreach (IPAddress ip in localIPs) { if (ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork && ip.ToString() != "localhost") { ipadre = ip.ToString(); } } imagenview = new ImageView(this); FloatingActionButton btn = FindViewById <FloatingActionButton>(Resource.Id.floatingActionButton1); ImageView volver = FindViewById <ImageView>(Resource.Id.imageView4); imagenview.SetImageBitmap(GetQRCode()); LinearLayout ll = FindViewById <LinearLayout>(Resource.Id.linearlayout0); LinearLayout ll2 = FindViewById <LinearLayout>(Resource.Id.linearLayout4); playpause = FindViewById <ImageView>(Resource.Id.imageView5); textboxtitulo = FindViewById <TextView>(Resource.Id.textView2); lista = FindViewById <ListView>(Resource.Id.listView1); // ll.SetBackgroundColor(Android.Graphics.Color.DarkGray); // ll2.SetBackgroundColor(Android.Graphics.Color.Black); tr = new Thread(new ThreadStart(cojerstream)); tr.Start(); textboxtitulo.Selected = true; var adaptadol = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleListItem1, new List <string> { "No hay dispositivos conectados.." }); RunOnUiThread(() => { var parcelable = lista.OnSaveInstanceState(); lista.Adapter = adaptadol; lista.OnRestoreInstanceState(parcelable); }); alerta = new AlertDialog.Builder(this).SetView(imagenview) .SetTitle("Vincular nuevo dispositivo").SetMessage("Para conectarse entre al modo control remoto de la app desde el otro dispositivo\n") .SetPositiveButton("Entendido!", (ax, ass) => { alerta.Dismiss(); }) .SetCancelable(false) .Create(); // animar2(ll2); AnimationHelper.AnimateFAB(btn); UiHelper.SetBackgroundAndRefresh(this); lista.ItemClick += (se, del) => { }; btn.Click += delegate { alerta.Show(); }; volver.Click += delegate { animar(volver); tr.Abort(); this.Finish(); }; playpause.Click += delegate { animar(playpause); YoutubePlayerServerActivity.gettearinstancia().imgPlay.PerformClick(); }; // ll2.SetBackgroundColor(Android.Graphics.Color.ParseColor("#2b2e30")); }
public OnClickListenerAnonymousInnerClassHelper19(AlertDialog dialog) { this.dialog = dialog; }
public void ShowPublish() { AlertDialog.Builder builder = new AlertDialog.Builder(this); LayoutInflater liView = LayoutInflater; customView = liView.Inflate(Resource.Layout.PublishLayout, null, true); customView.FindViewById <TextView>(Resource.Id.lblNombre).Text = nombre; customView.FindViewById <TextView>(Resource.Id.lblPuesto).Text = puesto; ImageView imgPerfil = customView.FindViewById <ImageView>(Resource.Id.imgPerfil); if (foto != null) { imgPerfil.SetImageBitmap(BitmapFactory.DecodeByteArray(foto, 0, foto.Length)); } else { imgPerfil.SetImageResource(Resource.Mipmap.ic_profile_empty); } customView.FindViewById <TextView>(Resource.Id.lblFecha).Text = DateTime.Now.ToString("d"); customView.FindViewById <ImageButton>(Resource.Id.imgPicture).Visibility = ViewStates.Gone; customView.FindViewById <ImageButton>(Resource.Id.btnDeleteImage).Visibility = ViewStates.Gone; customView.FindViewById <ImageButton>(Resource.Id.imgPicture).Click += delegate { AndHUD.Shared.ShowImage(this, Drawable.CreateFromPath(_file.ToPath().ToString())); }; customView.FindViewById <EditText>(Resource.Id.txtPublicacion).TextChanged += (sender, e) => { if (!string.IsNullOrEmpty(((EditText)sender).Text)) { customView.FindViewById <Button>(Resource.Id.btnPublishApply).Enabled = true; } else { customView.FindViewById <Button>(Resource.Id.btnPublishApply).Enabled = false; } }; customView.FindViewById <ImageButton>(Resource.Id.btnDeleteImage).Click += delegate { ImageButton imgPicture = customView.FindViewById <ImageButton>(Resource.Id.imgPicture); imgPicture.SetImageURI(null); imgPicture.Visibility = ViewStates.Gone; _file = null; customView.FindViewById <ImageButton>(Resource.Id.btnDeleteImage).Visibility = ViewStates.Gone; }; customView.FindViewById <ImageButton>(Resource.Id.btnTakePicture).Click += delegate { CreateDirectoryForPictures(); IsThereAnAppToTakePictures(); Intent intent = new Intent(MediaStore.ActionImageCapture); _file = new File(_dir, String.Format("{0}.jpg", Guid.NewGuid())); intent.PutExtra(MediaStore.ExtraOutput, Android.Net.Uri.FromFile(_file)); StartActivityForResult(intent, TakePicture); }; customView.FindViewById <ImageButton>(Resource.Id.btnAttachImage).Click += delegate { var imageIntent = new Intent(); imageIntent.SetType("image/*"); imageIntent.SetAction(Intent.ActionGetContent); StartActivityForResult( Intent.CreateChooser(imageIntent, "Select photo"), PickImageId); }; customView.FindViewById <Button>(Resource.Id.btnPublishApply).Click += async delegate { try { System.IO.MemoryStream stream = new System.IO.MemoryStream(); bitmap?.Compress(Bitmap.CompressFormat.Jpeg, 0, stream); byte[] bitmapData = stream?.ToArray(); if (new EscritorioController().SetPost(localStorage.Get("Usuario_Id"), localStorage.Get("Usuario_Tipo"), customView.FindViewById <EditText>(Resource.Id.txtPublicacion).Text, bitmapData)) { page = 0; posts = DashboardController.GetMuroPosts(localStorage.Get("Usuario_Id"), localStorage.Get("Usuario_Tipo")); await FillPosts(); dialog.Dismiss(); customView.FindViewById <ImageView>(Resource.Id.imgPicture).Visibility = ViewStates.Gone; customView.FindViewById <ImageButton>(Resource.Id.btnDeleteImage).Visibility = ViewStates.Gone; } else { Toast.MakeText(this, Resource.String.str_general_save_error, ToastLength.Short); } } catch (Exception e) { SlackLogs.SendMessage(e.Message, GetType().Name, "ShowPublish"); } dialog.Dismiss(); }; builder.SetView(customView); builder.Create(); dialog = builder.Show(); dialog.Window.SetGravity(GravityFlags.Top | GravityFlags.Center); }
public OnClickListenerAnonymousInnerClassHelper20(AlertDialog dialog, Context context, View view) { this.dialog = dialog; this.context = context; this.view = view; }
private void showInternationalCodeSetDialog() { if (mInternationalCodeSetDialog == null) { mInternationalCodeSetDialog = (new AlertDialog.Builder(MainActivity.this)).setItems(INTERNATIONAL_CODE_SET_ITEMS, new OnClickListenerAnonymousInnerClassHelper2(this)) .create(); } mInternationalCodeSetDialog.show(); }