// A click handler for the save map button
        private void SaveMapButtonClick(object sender, EventArgs e)
        {
            try
            {
                // Get information for the new portal item
                string   title       = _mapTitleTextbox.Text;
                string   description = _mapDescriptionTextbox.Text;
                string[] tags        = _tagsTextbox.Text.Split(',');

                // Make sure all required info was entered
                if (String.IsNullOrEmpty(title) || String.IsNullOrEmpty(description) || tags.Length == 0)
                {
                    throw new Exception("Please enter a title, description, and some tags to describe the map.");
                }

                // Create a new OnSaveMapEventArgs object to store the information entered by the user
                OnSaveMapEventArgs mapSavedArgs = new OnSaveMapEventArgs(title, description, tags);

                // Raise the OnSaveClicked event so the main activity can handle the event and save the map
                OnSaveClicked?.Invoke(this, mapSavedArgs);

                // Close the dialog
                Dismiss();
            }
            catch (Exception ex)
            {
                // Show the exception message (dialog will stay open so user can try again)
                AlertDialog.Builder alertBuilder = new AlertDialog.Builder(Activity);
                alertBuilder.SetTitle("Error");
                alertBuilder.SetMessage(ex.Message);
                alertBuilder.Show();
            }
        }
Example #2
0
        // A click handler for the save map button
        private void SaveButtonClicked(object sender, EventArgs e)
        {
            try
            {
                // Get information for the new portal item
                string   title       = MapTitleEntry.Text;
                string   description = MapDescriptionEntry.Text;
                string[] tags        = MapTagsEntry.Text.Split(',');

                // Make sure all required info was entered
                if (String.IsNullOrEmpty(title) || String.IsNullOrEmpty(description) || tags.Length == 0)
                {
                    throw new Exception("Please enter a title, description, and some tags to describe the map.");
                }

                // Create a new OnSaveMapEventArgs object to store the information entered by the user
                SaveMapEventArgs mapSavedArgs = new SaveMapEventArgs(title, description, tags);

                // Raise the OnSaveClicked event so the main activity can handle the event and save the map
                OnSaveClicked?.Invoke(this, mapSavedArgs);

                // Close the dialog
                Navigation.PopAsync();
            }
            catch (Exception ex)
            {
                // Show the exception message (dialog will stay open so user can try again)
                Application.Current.MainPage.DisplayAlert("Error", ex.Message, "OK");
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            var absenceActivity = new ActivityModel(
                TitleBoxSelector.Text, ReasonComboBoxSelector.Text,
                StartDateSelector.Value,
                EndDateSelector.Value);
            var sEvent = new SubmitEvent(absenceActivity);

            OnSaveClicked?.Invoke(this, sEvent);
        }
Example #4
0
        private void invoke_Add_Mode_Submit()
        {
            string title = projectIDSelector.Text, pLeader = leaderSelector.Text;

            var p = new ProjectModel()
            {
                ModelIdentity    = title,
                StartDate        = StartDateSelector.Value,
                EndDate          = EndDateSelector.Value,
                projectLeaderId  = pLeader,
                ShortDescription = DescriptionBoxSelector.Text
            };

            OnSaveClicked?.Invoke(this, new SubmitEvent(p));
        }
 protected void lbtnSave_Click(object sender, EventArgs e)
 {
     OnSaveClicked?.Invoke(sender, e);
 }
Example #6
0
 public void SaveClicked(string fileName, string path) => OnSaveClicked?.Invoke(fileName, path);