Esempio n. 1
0
        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ñ");
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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");
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
 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();
     });
 }
Esempio n. 6
0
        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");
        }
Esempio n. 7
0
        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);
        }
Esempio n. 8
0
        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");
        }