Exemple #1
0
        public override void ParseJObject(Object obj)
        {
            JObject         wydarzenie     = JsonObject.Value <JObject> ("wydarzenie");
            IInterpellation interpellation = obj as IInterpellation;

            interpellation.DokumentId = int.Parse(wydarzenie.Value <JValue> ("dokument_id").Value as string);
            JArray teksty = JsonObject.Value <JArray> ("teksty");

            interpellation.Teksty.Clear();

            foreach (var item in teksty)
            {
                string tekst = (item as JObject).Value <string> ("html");
                interpellation.Teksty.Add(tekst);
            }
        }
        private async void GetData()
        {
            IPeopleRepository repository = PeopleRepository.Instance;

            try {
                interpellation = await repository.GetPoselInterpellation(id);

                string text = interpellation.Teksty.First();
                if (text != null)
                {
                    text = "Brak tekstu interpelacji";
                }
                textView.TextFormatted = Html.FromHtml(text);


                if (viewSwitcher.CurrentView != contentLayout)
                {
                    viewSwitcher.ShowPrevious();
                }
            } catch (ApiRequestException ex) {
                (Activity as BaseActivity).ShowErrorDialog(ex.Message);
            }
        }