Beispiel #1
0
        public static void DeleteOutlet(Outlet outlet)
        {
            if (outlet == null)
            {
                return;
            }
            if (outlet.Type.Equals(Outlet.outlet_type_facebook, StringComparison.OrdinalIgnoreCase))
            {
                return;
            }

            var realm = RealmManager.SharedInstance.GetRealm(null);
            var cards = RealmServices.GetMyCards(false);

            realm.Write(() =>
            {
                outlet.Deleted = true;

                //delete any card that has no outlets
                foreach (var card in cards)
                {
                    if (card.Outlets.Where(c => c.Deleted == false).Count() == 0)
                    {
                        card.Deleted = true;
                    }
                }
            });
        }
Beispiel #2
0
        public List <Card> GetMyCards(bool forceToFront)
        {
            var cards = RealmServices.GetMyCards(forceToFront);

            if (CrossDeviceInfo.Current.Platform == Platform.Android)
            {
                cards.Add(null);
            }

            return(cards);
        }