Esempio n. 1
0
        private void Show(AlertDialogBuilder dm)
        {
            _context = dm.Context;
            builder  = new AlertDialog.Builder(_context);

            CreateDialog(builder, dm);
        }
Esempio n. 2
0
        private void CreateDialog(AlertDialog.Builder builder1, AlertDialogBuilder dialogMessage)
        {
            alertDialog = builder.Create();

            int    mes     = dialogMessage.IntMessage == default(int) ? 0 : dialogMessage.IntMessage;
            string message = string.Empty;

            if (mes > 0)
            {
                message = _context.GetString(dialogMessage.IntMessage);
            }

            int tit = dialogMessage.IntTitle == default(int) ? 0 : dialogMessage.IntTitle;

            if (tit > 0 || !string.IsNullOrEmpty(Title))
            {
                string title = !Title.IsBlank() ? Title : _context.GetString(tit);
                if (!string.IsNullOrEmpty(title))
                {
                    alertDialog.SetTitle(title);
                }
            }
            if (!Message.IsBlank())
            {
                message = Message;
            }
            alertDialog.SetMessage(message);
            alertDialog.SetCancelable(dialogMessage.Cancellable);
            string button1Text = GetButtonText(0);
            string button2Text = GetButtonText(1);
            string button3Text = GetButtonText(2);

            alertDialog.SetButton(
                button1Text,
                (sender, args) => _buttonsAndCallbacks[_buttonsAndCallbacks.Keys.ElementAt(0)]());

            if (button2Text.IsBlank() == false)
            {
                alertDialog.SetButton2(
                    button2Text,
                    (sender, args) => _buttonsAndCallbacks[_buttonsAndCallbacks.Keys.ElementAt(1)]());
            }

            if (button3Text.IsBlank() == false)
            {
                alertDialog.SetButton3(
                    button2Text,
                    (sender, args) => _buttonsAndCallbacks[_buttonsAndCallbacks.Keys.ElementAt(2)]());
            }

            alertDialog.Show();
        }
Esempio n. 3
0
 private static void Kill(AlertDialogBuilder builder)
 {
     _builders.Remove(builder);
     builder = null;
 }