Beispiel #1
0
        private void Button_Click(object sender, EventArgs e)
        {
            Android.App.AlertDialog.Builder alertDialog = new Android.App.AlertDialog.Builder(this);
            Android.App.AlertDialog         alert       = alertDialog.Create();

            if (SelectedManufacturers.Count == 0 || SelectedPriceRanges.Count == 0)
            {
                alert.SetTitle("Error");
                alert.SetMessage("Enter all data");
            }
            else
            {
                Choice.SelectedManufacturers = GetResultFromCheckBoxGroup(ref SelectedManufacturers);
                Choice.SelectedPriceRanges   = GetResultFromCheckBoxGroup(ref SelectedPriceRanges);
                bool result = database.Add(Choice);

                if (result)
                {
                    alert.SetMessage("Your choice is save.");
                }
                else
                {
                    alert.SetMessage("Your choice is not save.");
                }

                alert.SetTitle("Save");
            }
            alert.SetButton("OK", (c, ev) =>
            {
                alert.Dispose();
            });
            alert.Show();
        }
 public void ShowConfirmDelete(string alerTitle, string alertMessage, string id)
 {
     Android.App.AlertDialog.Builder showDialog = new Android.App.AlertDialog.Builder(this);
     Android.App.AlertDialog         Alert      = showDialog.Create();
     Alert.SetTitle(alerTitle);
     Alert.SetMessage(alertMessage);
     Alert.SetButton("YES", delegate
     {
         try
         {
             string URL = "https://download-tracker.herokuapp.com/movies/" + id;
             DeleteMovie(URL);
         }
         catch (Exception e)
         {
             Console.WriteLine(e.Message);
         }
     });
     Alert.SetButton2("NO", delegate
     {
         Alert.Dismiss();
         Alert.Dispose();
         return;
     });
     Alert.Show();
 }
 protected override void Dispose(bool disposing)
 {
     _createdDialog.Dispose();
     _createdDialog = null;
     _checkBoxList.Clear();
     _checkBoxList       = null;
     _closeButton.Click -= CloseButtonOnClick;
     base.Dispose(disposing);
 }
Beispiel #4
0
 /// <summary>
 /// Event Name      : OnBackPressed
 /// Author          : Sanket Prajapati
 /// Creation Date   : 2 Dec 2017
 /// Purpose         : backup button avoid Create password and customer password screen
 /// Revision        :
 /// </summary>
 public override void OnBackPressed()
 {
     dialog = new Android.App.AlertDialog.Builder(new ContextThemeWrapper(this, Resource.Style.AlertDialogCustom));
     alert  = dialog.Create();
     alert.SetMessage(StringResource.msgBackButtonDisable);
     alert.SetButton(StringResource.msgOK, (c, ev) =>
     {
         alert.Dispose();
     });
     alert.Show();
 }
Beispiel #5
0
 /// <summary>
 /// Method Name     : AlertMessage
 /// Author          : Sanket Prajapati
 /// Creation Date   : 14 Dec 2017
 /// Purpose         : Show Alert message
 /// Revision        :
 /// </summary>
 public void AlertMessage(String StrErrorMessage)
 {
     dialog = new Android.App.AlertDialog.Builder(new ContextThemeWrapper(this, Resource.Style.AlertDialogCustom));
     alert  = dialog.Create();
     alert.SetMessage(StrErrorMessage);
     alert.SetButton(StringResource.msgOK, (c, ev) =>
     {
         alert.Dispose();
     });
     alert.Show();
 }
        private void AttachSocketEvents(AlertDialog alert)
        {
            // Whenever the server emits "login", log the login message
            socket.On("login", data =>
            {
                if (alert != null)
                {
                    alert.Dismiss();
                    alert.Dispose();
                    alert = null;
                }

                var d = Data.FromData(data);
                connected = true;
                // Display the welcome message
                AddMessage("Welcome to Socket.IO Chat – ", true);
                AddParticipantsMessage(d.numUsers);
            });
            // Whenever the server emits "new message", update the chat body
            socket.On("new message", data =>
            {
                var d = Data.FromData(data);
                AddMessage(d.message, username: d.username);
            });
            // Whenever the server emits "user joined", log it in the chat body
            socket.On("user joined", data =>
            {
                var d = Data.FromData(data);
                AddMessage(d.username + " joined");
                AddParticipantsMessage(d.numUsers);
            });
            // Whenever the server emits "user left", log it in the chat body
            socket.On("user left", data =>
            {
                var d = Data.FromData(data);
                AddMessage(d.username + " left");
                AddParticipantsMessage(d.numUsers);
                UpdateChatTyping(d.username, true);
            });
            // Whenever the server emits "typing", show the typing message
            socket.On("typing", data =>
            {
                var d = Data.FromData(data);
                UpdateChatTyping(d.username, false);
            });
            // Whenever the server emits "stop typing", kill the typing message
            socket.On("stop typing", data =>
            {
                var d = Data.FromData(data);
                UpdateChatTyping(d.username, true);
            });
        }