Пример #1
0
        private void DeleteCheckedTimeEntries()
        {
            var adapter = ListView.Adapter as LogTimeEntriesAdapter;

            if (adapter == null)
            {
                return;
            }

            // Find models to delete:
            var checkedPositions = ListView.CheckedItemPositions;
            var arrSize          = checkedPositions.Size();
            var toDelete         = new List <TimeEntryModel> (arrSize);

            for (var i = 0; i < arrSize; i++)
            {
                var position  = checkedPositions.KeyAt(i);
                var isChecked = checkedPositions.Get(position);
                if (!isChecked)
                {
                    continue;
                }

                var data = adapter.GetEntry(position) as TimeEntryData;
                if (data != null)
                {
                    toDelete.Add((TimeEntryModel)data);
                }
            }

            // Delete models:
            var dia = new DeleteTimeEntriesPromptDialogFragment(toDelete);

            dia.Show(FragmentManager, "confirm_delete");
        }
Пример #2
0
        private void ConfirmTimeEntryDeletion(TimeEntryModel model)
        {
            var dia = new DeleteTimeEntriesPromptDialogFragment(new List <TimeEntryModel> ()
            {
                model
            });

            dia.Show(FragmentManager, "confirm_delete");
        }
        private void ConfirmTimeEntryDeletion(TimeEntryModel model)
        {
            // Make sure that the time entry being edited is persisted (so the changes would actually sync back)
            model.IsPersisted = true;

            var dia = new DeleteTimeEntriesPromptDialogFragment(new List <TimeEntryModel> ()
            {
                model
            });

            dia.Show(FragmentManager, "confirm_delete");
        }
        private void ConfirmTimeEntryDeletion (TimeEntryModel model)
        {
            // Make sure that the time entry being edited is persisted (so the changes would actually sync back)
            model.IsPersisted = true;

            var dia = new DeleteTimeEntriesPromptDialogFragment (new List<TimeEntryModel> () { model });
            dia.Show (FragmentManager, "confirm_delete");
        }
        private void DeleteCheckedTimeEntries ()
        {
            var adapter = ListView.Adapter as LogTimeEntriesAdapter;
            if (adapter == null)
                return;

            // Find models to delete:
            var checkedPositions = ListView.CheckedItemPositions;
            var arrSize = checkedPositions.Size ();
            var toDelete = new List<TimeEntryModel> (arrSize);

            for (var i = 0; i < arrSize; i++) {
                var position = checkedPositions.KeyAt (i);
                var isChecked = checkedPositions.Get (position);
                if (!isChecked)
                    continue;

                var model = adapter.GetEntry (position) as TimeEntryModel;
                if (model != null)
                    toDelete.Add (model);
            }

            // Delete models:
            var dia = new DeleteTimeEntriesPromptDialogFragment (toDelete);
            dia.Show (FragmentManager, "confirm_delete");
        }
 private void ConfirmTimeEntryDeletion (TimeEntryModel model)
 {
     var dia = new DeleteTimeEntriesPromptDialogFragment (new List<TimeEntryModel> () { model });
     dia.Show (FragmentManager, "confirm_delete");
 }