Ejemplo n.º 1
0
        private void usunPrzedmiot(int index)
        {
            if (File.Exists(listaPrzedmiotow[index].zdjecie))
            {
                File.Delete(listaPrzedmiotow[index].zdjecie);
            }
            listaPrzedmiotow.RemoveAt(index);
            var adapter = new PrzedmiotAdapter(Context, Resource.Layout.Przedmiot, listaPrzedmiotow);

            lista.Adapter = adapter;
            ZapisOdczytTelefon.ZapiszDoPliku(listaPrzedmiotow);
        }
Ejemplo n.º 2
0
        private void Dialog_poDodaniuPrzedmiotu(object sender, Dialog_Dodaj.PoDodaniuPrzedmiotuEvent e)
        {
            if (!(listaPrzedmiotow[pozycja].zdjecie == e.przedmiot.zdjecie))
            {
                if (File.Exists(listaPrzedmiotow[pozycja].zdjecie))
                {
                    File.Delete(listaPrzedmiotow[pozycja].zdjecie);
                }
            }
            listaPrzedmiotow.Add(e.przedmiot);
            ZapisOdczytTelefon.ZapiszDoPliku(listaPrzedmiotow);
            var adapter = new PrzedmiotAdapter(Context, Resource.Layout.Przedmiot, listaPrzedmiotow);

            lista.Adapter = adapter;
            listaPrzedmiotow.RemoveAt(pozycja);
        }
Ejemplo n.º 3
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);
            var view = inflater.Inflate(Resource.Layout.Dialog_wyswietl, container, false);

            lista = view.FindViewById <ListView>(Resource.Id.listView1);

            var adapter = new PrzedmiotAdapter(Context, Resource.Layout.Przedmiot, listaPrzedmiotow);

            lista.Adapter = adapter;

            lista.ItemClick += Lista_ItemClick;
            RegisterForContextMenu(lista);
            lista.SetOnCreateContextMenuListener(this);



            return(view);
        }