Example #1
0
        private async void DisplayActionSheetDestruicao()
        {
            //Outra forma de gerenciar retorno de mensagens:
            //O legal disso é que podemos passar o ICommand como parâmetro e

            var opcaoA = ActionSheetButton.CreateButton("Opção A", new DelegateCommand(() =>
            {
                this.OpcaoEscolhida = "A opção selecionada foi: Opção A";
            }));

            var opcaoB = ActionSheetButton.CreateButton("Opção B", new DelegateCommand(() =>
            {
                this.OpcaoEscolhida = "A opção selecionada foi: Opção B";
            }));

            var opcaoC = ActionSheetButton.CreateButton("Opção B", new DelegateCommand(() =>
            {
                this.OpcaoEscolhida = "A opção selecionada foi: Opção C";
            }));

            var cancelar = ActionSheetButton.CreateCancelButton("Cancelar", new DelegateCommand(() =>
            {
                this.OpcaoEscolhida = "A opção selecionada foi: Cancelar";
            }));

            var excluir = ActionSheetButton.CreateDestroyButton("Excluir!!", new DelegateCommand(() =>
            {
                this.OpcaoEscolhida = "A opção selecionada foi: Excluir!!";
            }));

            await this._pageDialogService.DisplayActionSheetAsync("Prism", opcaoA, opcaoB, opcaoC, cancelar, excluir);
        }
        private async Task <bool> ExecuteValidateUserCityCommand()
        {
            var buttons = new List <IActionSheetButton>
            {
                ActionSheetButton.CreateButton("---Select city---", () => {
                    UserCity.Value = "---Select city---";
                }),
                ActionSheetButton.CreateCancelButton("Cancel", () =>
                {
                    UserCity.Value = "---Select city---";
                })
            };

            foreach (var item in CityList)
            {
                buttons.Add(ActionSheetButton.CreateButton(item.CityName, () =>
                {
                    UserCity.Value = item.CityName;
                    CurrentCity    = item;
                }));
            }
            await PageDialogService.DisplayActionSheetAsync(null, buttons.ToArray());

            if (!(UserCity.Value == "---Select city---"))
            {
                return(_userCity.Validate());
            }
            else
            {
                return(_userCity.Validate());
            }
        }
        private async void ShowPatientActionsAsync()
        {
            IActionSheetButton editPatientBtn         = ActionSheetButton.CreateButton("Edit patient", new DelegateCommand(() => { NavigateToPage("EditPatientPage"); }));
            IActionSheetButton callPatientBtn         = ActionSheetButton.CreateButton("Call patient", new DelegateCommand(() => { CallPatient(); }));
            IActionSheetButton scheduleAppointmentBtn = ActionSheetButton.CreateButton("Schedule appointment", new DelegateCommand(() => { ScheduleAppointmentAsync(); }));

            await _dialogService.DisplayActionSheetAsync("Patient actions", editPatientBtn, callPatientBtn, scheduleAppointmentBtn);
        }
Example #4
0
        private void AddImage()
        {
            IActionSheetButton TakePicture = ActionSheetButton.CreateButton("Take Picture Form Camera", new DelegateCommand(ButtonTakePicter));
            IActionSheetButton GetPicture  = ActionSheetButton.CreateButton("Get Picture From Gallery", new DelegateCommand(ButtonGetPicture));
            IActionSheetButton Cancel      = ActionSheetButton.CreateCancelButton("Cancel", new DelegateCommand(() => { return; }));

            dialog.DisplayActionSheetAsync("What do you want to do with : ", Cancel, TakePicture, GetPicture);
        }
        private async void ShowActions(AppointmentDTO appointmentDTO)
        {
            IActionSheetButton editAppointmentBtn   = ActionSheetButton.CreateButton("Edit appointment", new DelegateCommand(() => { EditAppointment(appointmentDTO); }));
            IActionSheetButton deleteAppointmentBtn = ActionSheetButton.CreateButton("Delete appointment", new DelegateCommand(() => { DeleteAppointment(appointmentDTO.Id); }));
            IActionSheetButton callPatientBtn       = ActionSheetButton.CreateButton("Call patient", new DelegateCommand(() => { CallPatient(appointmentDTO.Phone); }));

            await _dialogService.DisplayActionSheetAsync("Appointment actions", editAppointmentBtn, callPatientBtn, deleteAppointmentBtn);
        }
Example #6
0
        private async void AddImage(object obj)
        {
            var list = new List <IActionSheetButton>();

            list.Add(ActionSheetButton.CreateButton("Galeria", AddImageFromGallery));
            list.Add(ActionSheetButton.CreateButton("Camara", AddImageFromCamera));

            await _dialogService.DisplayActionSheetAsync("Añadir image", list.ToArray());
        }
Example #7
0
        private async void DisplayActionSheetUsingActionSheetButtons()
        {
            var option1Action = ActionSheetButton.CreateButton("Option 1", new DelegateCommand(() => { Debug.WriteLine("Option 1"); }));
            var option2Action = ActionSheetButton.CreateButton("Option 2", new DelegateCommand(() => { Debug.WriteLine("Option 2"); }));
            var cancelAction  = ActionSheetButton.CreateCancelButton("Cancel", new DelegateCommand(() => { Debug.WriteLine("Cancel"); }));
            var destroyAction = ActionSheetButton.CreateDestroyButton("Destroy", new DelegateCommand(() => { Debug.WriteLine("Destroy"); }));

            await _pageDialogService.DisplayActionSheetAsync("ActionSheet with ActionSheetButtons", option1Action, option2Action, cancelAction, destroyAction);
        }
        public async Task DisplayActionSheet_OtherButtonPressed_UsingCommand()
        {
            var service       = new PageDialogServiceMock("other", _applicationProvider);
            var buttonPressed = false;
            var command       = new DelegateCommand(() => buttonPressed = true);
            var button        = ActionSheetButton.CreateButton("other", command);
            await service.DisplayActionSheetAsync(null, button);

            Assert.True(buttonPressed);
        }
        public async Task DisplayActionSheet_NullButtonAndOtherButtonPressed()
        {
            var service       = new PageDialogServiceMock("other");
            var buttonPressed = false;
            var command       = new DelegateCommand(() => buttonPressed = true);
            var button        = ActionSheetButton.CreateButton("other", command);
            await service.DisplayActionSheet(null, button, null);

            Assert.True(buttonPressed);
        }
Example #10
0
        async void OnChangeColor()
        {
            var modelList = new List <IActionSheetButton>();

            foreach (var model in SelectedListingItem.ListingModels.ListingModels)
            {
                modelList.Add(ActionSheetButton.CreateButton(model, () => OnModelSelected(model)));
            }

            await _dialogService.DisplayActionSheetAsync($"Select {SelectedListingItem.ListingModels.ModelType}", modelList.ToArray());
        }
Example #11
0
        private void PickStaffCommand(Offer obj)
        {
            IActionSheetButton Used   = ActionSheetButton.CreateButton("Use Offer", new DelegateCommand(() => { }));
            IActionSheetButton Share  = ActionSheetButton.CreateButton("Share Offer For Friend", new DelegateCommand <Offer>(ShareOffer));
            IActionSheetButton Cancel = ActionSheetButton.CreateCancelButton("Cancel", new DelegateCommand(() => { }));
            IActionSheetButton Delete = ActionSheetButton.CreateDestroyButton("Delete", new DelegateCommand(() => { }));

            var title = obj.NameOffer;

            dialog.DisplayActionSheetAsync("What do you want to do with : " + title, Cancel, Used, Share, Delete);
        }
        private void DisplayActionSheetUsingActionSheetButtons()
        {
            IActionSheetButton option1Action = ActionSheetButton.CreateButton("Option 1", new DelegateCommand(() => Debug.WriteLine("Option 1")));
            IActionSheetButton option2Action = ActionSheetButton.CreateButton("Option 2", new DelegateCommand(() => Debug.WriteLine("Option 2")));
            IActionSheetButton option3Action = ActionSheetButton.CreateButton("Option 3", new DelegateCommand(() => Debug.WriteLine("Option 3")));
            IActionSheetButton option4Action = ActionSheetButton.CreateButton("Option 4", new DelegateCommand(() => Debug.WriteLine("Option 4")));
            IActionSheetButton option5Action = ActionSheetButton.CreateButton("Option 5", new DelegateCommand(() => Debug.WriteLine("Option 5")));
            IActionSheetButton option6Action = ActionSheetButton.CreateButton("Option 6", new DelegateCommand(() => Debug.WriteLine("Option 6")));

            _pageDialogService.DisplayActionSheetAsync("ActionSheet with ActionSheetButtons", option1Action, option2Action, option3Action, option4Action, option5Action, option6Action);
        }
        private async void DisplayActionSheetUsingActionSheetButtons()
        {
            var buttons = new IActionSheetButton[]
            {
                ActionSheetButton.CreateButton("Option 1", WriteLine, "Option 1"),
                ActionSheetButton.CreateButton("Option 2", WriteLine, "Option 2"),
                ActionSheetButton.CreateCancelButton("Cancel", WriteLine, "Cancel"),
                ActionSheetButton.CreateDestroyButton("Destroy", WriteLine, "Destroy")
            };

            await _pageDialogService.DisplayActionSheetAsync("ActionSheet with ActionSheetButtons", buttons);
        }
        private async Task SelectRoleCommandExecuteAsync()
        {
            List <IActionSheetButton> buttons = new List <IActionSheetButton>();

            foreach (var item in AppRolesResult)
            {
                buttons.Add(ActionSheetButton.CreateButton(item.Name, new Action(() =>
                {
                    SelectedAppRole = item;
                })));
            }
            await PageDialogService.DisplayActionSheetAsync("Select Option", buttons.ToArray());
        }
Example #15
0
        public static async Task <T> PresentChoice <T>(
            this IPageDialogService pageDialogService, string title,
            ICollection <T> choices, Func <T, string> titleSelector, object anchor = null)
        {
            var choiceDict = choices.ToDictionary(titleSelector, c => c);

            var tcs     = new TaskCompletionSource <T>();
            var buttons = choiceDict.Select(x => ActionSheetButton.CreateButton(x.Key, () => tcs.TrySetResult(x.Value))).ToList();
            var cancel  = ActionSheetButton.CreateButton(CancelTitle, () => tcs.TrySetResult(default(T)));

            await pageDialogService.DisplayActionSheetAsync(title, buttons.Concat(new[] { cancel }).ToArray());

            return(await tcs.Task);
        }
Example #16
0
        private async void NotifyCar()
        {
            IsLoading = true;
            var notifyWithMessageCommand = new DelegateCommand <string>(NotifyWithTemplate);
            var actionSheetButtons       = new List <IActionSheetButton>();

            foreach (var message in TemplateConstants.TemplateMessageToName.Keys)
            {
                actionSheetButtons.Add(ActionSheetButton.CreateButton(message, notifyWithMessageCommand));
            }
            await _pageDialogService.DisplayActionSheetAsync("What happend?", actionSheetButtons.ToArray());

            IsLoading = false;
        }
        void SetWeightUnitsTapped()
        {
            var imperialPoundsAction = ActionSheetButton.CreateButton(WeightUnitEnum.ImperialPounds.ToSettingsName(),
                                                                      new DelegateCommand(() => { WeightUnitTypeSelected(WeightUnitEnum.ImperialPounds); }));
            var kilogramsAction = ActionSheetButton.CreateButton(WeightUnitEnum.Kilograms.ToSettingsName(),
                                                                 new DelegateCommand(() => { WeightUnitTypeSelected(WeightUnitEnum.Kilograms); }));
            var stonesPoundAction = ActionSheetButton.CreateButton(WeightUnitEnum.StonesAndPounds.ToSettingsName(),
                                                                   new DelegateCommand(() => { WeightUnitTypeSelected(WeightUnitEnum.StonesAndPounds); }));
            var cancelAction = ActionSheetButton.CreateCancelButton(Constants.Strings.Generic_Cancel,
                                                                    new DelegateCommand(() => { }));

            DialogService.DisplayActionSheetAsync(Constants.Strings.Settings_ChangeWeightUnitsActionSheet,
                                                  imperialPoundsAction, kilogramsAction, stonesPoundAction, cancelAction);
        }
        private void OnVideoTapped(YoutubeItem item)
        {
            // var navParams = new NavigationParameters();
            //navParams.Add("videoKey", item);
            //_navigationService.NavigateAsync(nameof(VideoDetails), navParams);
            IActionSheetButton Yes = ActionSheetButton.CreateButton("Yes", new DelegateCommand(() => {
                Task.Run(() => { Device.OpenUri(new Uri(item.Url)); });
            }));
            IActionSheetButton No = ActionSheetButton.CreateButton("No", new DelegateCommand(() => { Debug.WriteLine("No"); }));

            _page.DisplayActionSheetAsync("Using third party app for watching video!", Yes, No);

            Debug.WriteLine($"**** {this.GetType().Name}.{nameof(OnVideoTapped)}; {_videos}");
        }
        private IActionSheetButton[] CreateButtons()
        {
            var buttons = new List <IActionSheetButton>()
            {
                ActionSheetButton.CreateCancelButton("Cancel", () => Callback("Cancel")),
                ActionSheetButton.CreateDestroyButton("Destroy", () => Callback("Destroy"))
            };

            foreach (var text in Actions)
            {
                buttons.Add(ActionSheetButton.CreateButton(text, () => Callback(text)));
            }

            return(buttons.ToArray());
        }
Example #20
0
        public async Task ShowDialogs()
        {
            await _dialogService?.DisplayAlertAsync("Display Alert", "This is a Display Alert made with Prism", "OK");

            await _dialogService.DisplayActionSheetAsync("ActionSheet", "Cancel", "Destroy", "Button01", "Button02", "Button03");

            IActionSheetButton b1 = ActionSheetButton.CreateButton("Button1",
                                                                   async delegate { await _dialogService?.DisplayAlertAsync("Display Alert", "Button 1 Pressed", "OK"); });
            IActionSheetButton b2 = ActionSheetButton.CreateCancelButton("Cancel",
                                                                         async delegate { await _dialogService?.DisplayAlertAsync("Display Alert", "Cancel Pressed", "OK"); });
            IActionSheetButton b3 = ActionSheetButton.CreateDestroyButton("Destroy",
                                                                          async delegate { await _dialogService?.DisplayAlertAsync("Display Alert", "Destroy Pressed", "OK"); });

            await _dialogService.DisplayActionSheetAsync("ActionSheet with IActionSheetButton", b1, b2, b3);
        }
Example #21
0
 private async Task ExecuteImageTappedClickCommandAsync(ComplaintImagesDTO complaintImagesDTO)
 {
     List <IActionSheetButton> buttons = new List <IActionSheetButton>()
     {
         ActionSheetButton.CreateButton("View file", new Action(async() =>
         {
             await ViewFile(complaintImagesDTO);
         })),
         ActionSheetButton.CreateButton("Delete file", new Action(async() =>
         {
             await DeleteFile(complaintImagesDTO);
         })),
         ActionSheetButton.CreateCancelButton("Cancel", new Action(() => { }))
     };
     await PageDialogService.DisplayActionSheetAsync("Select Option", buttons.ToArray());
 }
        private async void DisplayActionSheetUsingActionSheetButtons()
        {
            IActionSheetButton option1Action = ActionSheetButton.CreateButton("Option 1", () =>
            {
                //Adding button with multi-line lambda Action
                int optionValue = 1;
                Debug.WriteLine($"Option {optionValue}");
            });
            IActionSheetButton option2Action = ActionSheetButton.CreateButton("Option 2", () => Debug.WriteLine("Option 2")); //Button with simple one-line lambda Action
            IActionSheetButton cancelAction  = ActionSheetButton.CreateCancelButton("Cancel", WriteResponse, "Cancel");       //Using Action<string> to call a method

            await _pageDialogService.DisplayActionSheetAsync("ActionSheet with ActionSheetButtons",
                                                             option1Action,
                                                             option2Action,
                                                             cancelAction,
                                                             ActionSheetButton.CreateDestroyButton("Destroy", WriteResponse, "Destroy")); //Inline button creation
        }
Example #23
0
        private async Task <bool> ExecuteSpeciesCommandAsync()
        {
            var buttons = new List <IActionSheetButton>()
            {
                ActionSheetButton.CreateButton("---Select species---", WriteLine, "Select option"),

                ActionSheetButton.CreateCancelButton("Cancel", WriteLine, "Cancel")
            };
            var Species = await _complaintService.GetAllSpecies(_settings.UserId);

            foreach (var item in Species)
            {
                buttons.Add(ActionSheetButton.CreateButton(item.SpeciesName, WriteLine, item.SpeciesName));
            }
            await PageDialogService.DisplayActionSheetAsync("Select species", buttons.ToArray());

            return(_species.Validate());
        }
        private async Task DisplayActionSheet_PressButton_UsingGenericAction(string text)
        {
            var service            = new PageDialogServiceMock(text, _applicationProvider);
            var cancelButtonModel  = new ButtonModel();
            var destroyButtonModel = new ButtonModel();
            var otherButtonModel   = new ButtonModel();
            var btns = new IActionSheetButton[]
            {
                ActionSheetButton.CreateButton("other", OnButtonPressed, otherButtonModel),
                ActionSheetButton.CreateCancelButton("cancel", OnButtonPressed, cancelButtonModel),
                ActionSheetButton.CreateDestroyButton("destroy", OnButtonPressed, destroyButtonModel)
            };
            await service.DisplayActionSheetAsync(null, btns);

            switch (text)
            {
            case "other":
                Assert.True(otherButtonModel.ButtonPressed);
                Assert.False(cancelButtonModel.ButtonPressed);
                Assert.False(destroyButtonModel.ButtonPressed);
                break;

            case "cancel":
                Assert.False(otherButtonModel.ButtonPressed);
                Assert.True(cancelButtonModel.ButtonPressed);
                Assert.False(destroyButtonModel.ButtonPressed);
                break;

            case "destroy":
                Assert.False(otherButtonModel.ButtonPressed);
                Assert.False(cancelButtonModel.ButtonPressed);
                Assert.True(destroyButtonModel.ButtonPressed);
                break;

            default:
                Assert.False(otherButtonModel.ButtonPressed);
                Assert.False(cancelButtonModel.ButtonPressed);
                Assert.False(destroyButtonModel.ButtonPressed);
                break;
            }
        }
#pragma warning restore CS0618 // Type or member is obsolete

        #endregion Obsolete ActionSheetButton using Commands

        private async Task DisplayActionSheet_PressButton_UsingAction(string text)
        {
            var  service              = new PageDialogServiceMock(text, _applicationProvider);
            bool cancelButtonPressed  = false;
            bool destroyButtonPressed = false;
            bool otherButtonPressed   = false;
            var  btns = new IActionSheetButton[]
            {
                ActionSheetButton.CreateButton("other", () => otherButtonPressed            = true),
                ActionSheetButton.CreateCancelButton("cancel", () => cancelButtonPressed    = true),
                ActionSheetButton.CreateDestroyButton("destroy", () => destroyButtonPressed = true)
            };
            await service.DisplayActionSheetAsync(null, btns);

            switch (text)
            {
            case "other":
                Assert.True(otherButtonPressed);
                Assert.False(cancelButtonPressed);
                Assert.False(destroyButtonPressed);
                break;

            case "cancel":
                Assert.False(otherButtonPressed);
                Assert.True(cancelButtonPressed);
                Assert.False(destroyButtonPressed);
                break;

            case "destroy":
                Assert.False(otherButtonPressed);
                Assert.False(cancelButtonPressed);
                Assert.True(destroyButtonPressed);
                break;

            default:
                Assert.False(otherButtonPressed);
                Assert.False(cancelButtonPressed);
                Assert.False(destroyButtonPressed);
                break;
            }
        }
        async void WeightUnitTypeSelected(WeightUnitEnum newUnits)
        {
            // already using this same setting, just return
            if (newUnits == SettingsService.WeightUnit)
            {
                return;
            }

            // see if there are existing weight entries not of this type
            IList <WeightEntry> allEntries = null;

            try
            {
                IncrementPendingRequestCount();
                allEntries = await DataService.GetAllWeightEntries();

                var weightsWithDifferentUnits = allEntries.Where(w => w.WeightUnit != newUnits);
                if (!weightsWithDifferentUnits.Any())
                {
                    var currentGoal = await DataService.GetGoal();

                    if (currentGoal == null)
                    {
                        SettingsService.WeightUnit = newUnits; // nothing to change, so just change the setting and return
                        SetupMenu();                           // refresh the menu to show the new setting
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                AnalyticsService.TrackFatalError($"{nameof(WeightUnitTypeSelected)} - an exception occurred getting all weights", ex);
                await DialogService.DisplayAlertAsync(Constants.Strings.Settings_ChangeWeightUnits_GetWeightsError_Title,
                                                      Constants.Strings.Settings_ChangeWeightUnits_GetWeightsError_Message,
                                                      Constants.Strings.Generic_OK);
            }
            finally
            {
                DecrementPendingRequestCount();
            }

            // if they are switching between pounds and stones/pounds we don't need to ask them how to convert as the data is stored
            // the same either way (just changes how presented), so just go straight to the conversion in this case
            if ((newUnits == WeightUnitEnum.ImperialPounds && SettingsService.WeightUnit == WeightUnitEnum.StonesAndPounds) ||
                (newUnits == WeightUnitEnum.StonesAndPounds && SettingsService.WeightUnit == WeightUnitEnum.ImperialPounds))
            {
                UpdateWeightEntriesAndGoalUnits(newUnits, false);
                return;
            }

            // show warning of needing to convert these values
            var convertAction = ActionSheetButton.CreateButton(Constants.Strings.Settings_ChangeWeightUnits_ConvertWarning_ConvertWeightValues,
                                                               new DelegateCommand(() => { UpdateWeightEntriesAndGoalUnits(newUnits, true); }));
            var changeUnitAction = ActionSheetButton.CreateButton(Constants.Strings.Settings_ChangeWeightUnits_ConvertWarning_ChangeUnits,
                                                                  new DelegateCommand(() => { UpdateWeightEntriesAndGoalUnits(newUnits, false); }));
            var cancelAction = ActionSheetButton.CreateCancelButton(Constants.Strings.Generic_Cancel,
                                                                    new DelegateCommand(() => { }));

            await DialogService.DisplayActionSheetAsync(Constants.Strings.Settings_ChangeWeightUnits_ConvertWarning,
                                                        convertAction, changeUnitAction, cancelAction);
        }
Example #27
0
        private async Task ExecuteUploadimagecommandAsync()
        {
            try
            {
                var cameraStatus = await CrossPermissions.Current.CheckPermissionStatusAsync <CameraPermission>();

                var storageStatus = await CrossPermissions.Current.CheckPermissionStatusAsync <StoragePermission>();

                var status = await CrossPermissions.Current.CheckPermissionStatusAsync <MediaLibraryPermission>();

                if (status != PermissionStatus.Granted)
                {
                    if (await CrossPermissions.Current.ShouldShowRequestPermissionRationaleAsync(Permission.MediaLibrary))
                    {
                        await PageDialogService.DisplayAlertAsync(null, "App needs permission to access the media library.", "OK");
                    }
                    status = await CrossPermissions.Current.RequestPermissionAsync <CameraPermission>();
                }
                if (status == PermissionStatus.Granted)
                {
                }
                if (cameraStatus != PermissionStatus.Granted)
                {
                    if (await CrossPermissions.Current.ShouldShowRequestPermissionRationaleAsync(Permission.Camera))
                    {
                        await PageDialogService.DisplayAlertAsync(null, "App needs permission to access the camera.", "OK");
                    }


                    cameraStatus = await CrossPermissions.Current.RequestPermissionAsync <CameraPermission>();
                }

                if (storageStatus != PermissionStatus.Granted)
                {
                    if (await CrossPermissions.Current.ShouldShowRequestPermissionRationaleAsync(Permission.Storage))
                    {
                        await PageDialogService.DisplayAlertAsync(null, "App needs permission to access the phone's local storage.", "OK");
                    }

                    storageStatus = await CrossPermissions.Current.RequestPermissionAsync <StoragePermission>();
                }

                if (status == PermissionStatus.Granted && cameraStatus == PermissionStatus.Granted)
                {
                    List <IActionSheetButton> buttons = new List <IActionSheetButton>()
                    {
                        ActionSheetButton.CreateButton("Gallery", new Action(async() =>
                        {
                            await UplaodImageFromGallery();
                        })),
                        ActionSheetButton.CreateButton("Camera", new Action(async() =>
                        {
                            await UplaodImageFromCamera();
                        })),
                        ActionSheetButton.CreateCancelButton("Cancel", new Action(() => { }))
                    };
                    await PageDialogService.DisplayActionSheetAsync("Select Option", buttons.ToArray());
                }
                else
                {
                    await PageDialogService.DisplayAlertAsync(null, "Sorry, permission is not granted to use the media library.", "OK");
                }
            }
            catch (Exception ex)
            {
                string st = ex.ToString();
            }
        }