private void ShowChoosingAdvertisementsKindDialog() { Action <string> methodAfterSelect = (s) => { ShowAdvertisementList(s.GetEnumValueByDisplayName <AdvertisementsKind>()); }; var kindNames = Enum.GetValues(typeof(AdvertisementsKind)).GetAllItemsDisplayNames(); AlertsService.ShowSingleSelectListString(this, kindNames.ToArray(), methodAfterSelect, this.advertisementsSearchModel.AdvertisementsKind.GetDisplayName(), "Wybierz listê og³oszeñ"); }
private void BtnAdvertsStatus_Click(object sender, EventArgs e) { Action <string> action = (status) => { this.advertisementsSearchModel.ExpiredAdvertisements = status == expiredStatus ? true : false; SetupSelectedAdvertStatus(); }; var statuses = new string[] { activeStatus, expiredStatus }; AlertsService.ShowSingleSelectListString(this, statuses, action, this.textViewSelectedAdvertsStatus.Text); }
private void BtnSorting_Click(object sender, EventArgs e) { Action <string> actionAfterSelect = (selctedSortingByName) => { this.advertisementsSearchModel.SortingBy = selctedSortingByName.GetEnumValueByDisplayName <SortingBy>(); SetupSelectedSortingByView(); }; var sortingByNames = Enum.GetValues(typeof(SortingBy)).GetAllItemsDisplayNames(); AlertsService.ShowSingleSelectListString(this, sortingByNames.ToArray(), actionAfterSelect, this.advertisementsSearchModel.SortingBy.GetDisplayName(), dialogTitle: "Wybierz rodzaj sortowania"); }
private void BtnTransaction_Click(object sender, EventArgs e) { Action <string> action = (transactionKindName) => { var selectedKind = transactionKindName.GetEnumValueByDisplayName <TransactionKind>(); this.advertisementsSearchModel.TransactionKind = selectedKind; SetupSelectedTransactionKind(); }; var transactionKindsNames = Enum.GetValues(typeof(TransactionKind)).GetAllItemsDisplayNames(); AlertsService.ShowSingleSelectListString(this, transactionKindsNames.ToArray(), action, this.textViewSelectedTransactionKind.Text); }
private void BtnDistance_Click(object sender, EventArgs e) { string[] itemList = Resources.GetStringArray(Resource.Array.notifications_radius); AlertsService.ShowSingleSelectListString(this, itemList, selectedText => { var resultRadius = 0; var selectedRadius = selectedText.Split(new char[] { ' ' })[0]; int.TryParse(selectedRadius, out resultRadius); if (resultRadius == 0) { resultRadius = ValueConsts.MAX_DISTANCE_VALUE; } advertisementsSearchModel.CoordinatesModel.MaxDistance = resultRadius; SetupSelectedMaxDistanceView(); }); }
private void ImgBtnRadius_Click(object sender, EventArgs e) { string[] itemList = activity.Resources.GetStringArray(Resource.Array.notifications_radius); AlertsService.ShowSingleSelectListString(activity, itemList, selectedText => { var resultRadius = 0; var selectedRadius = selectedText.Split(new char[] { ' ' })[0]; int.TryParse(selectedRadius, out resultRadius); if (resultRadius == 0) { resultRadius = ValueConsts.MAX_DISTANCE_VALUE; } appSettings.LocationSettings.MaxDistance = resultRadius; SetAppSettings(appSettings); this.textViewNotificationsRadius.Text = selectedText; }, dialogTitle: "Wybierz dystans"); }
private void ReportWrongAdvert() { Action reportActionConfirmed = () => { Action <string> actionOnReasonSelected = async(reason) => { this.progress.ShowProgressDialog("Zg³aszanie og³oszenia naruszaj¹cego regulamin"); await this.feedbackService.ReportWrongAdvertisement(this.advertisement.Id, reason); this.progress.CloseProgressDialog(); AlertsService.ShowShortToast(this, "Og³oszenie zosta³o zg³oszone adminom"); }; string[] itemList = Resources.GetStringArray(Resource.Array.report_wrong_advert_reasons); AlertsService.ShowSingleSelectListString(this, itemList, actionOnReasonSelected, dialogTitle: "Wybierz powód"); }; AlertsService.ShowConfirmDialog(this, "Czy na pewno chcesz zg³osiæ to og³oszenie jako naruszenie regulaminu?", reportActionConfirmed); }
private void TakePhoto(int photoNr) { var takingPhotoKindNames = Enum.GetValues(typeof(GetPhotoKind)).GetAllItemsDisplayNames(); AlertsService.ShowSingleSelectListString(this, takingPhotoKindNames.ToArray(), s => { var selectedTakingPhotoKind = s.GetEnumValueByDisplayName <GetPhotoKind>(); switch (selectedTakingPhotoKind) { case GetPhotoKind.TakeNewPhotoFromCamera: TakePhotoFromCamera(photoNr); break; case GetPhotoKind.TakeExistingPhotoFromStorage: TakePhotoFromStorage(photoNr); break; default: break; } }, dialogTitle: "Wybierz Ÿród³o"); }