Esempio n. 1
0
        /// <summary>
        /// 增加新卡
        /// </summary>
        public void Add(datas card) {
            //如果datas里面有card,那么就抛出异常
            if (ce.datas.FirstOrDefault(c => c.id == card.id) != null)
                throw new Exception("卡密重复");

            ce.datas.Add(card);
        }
 public void ScrollIntoView(datas d) {
     MessengerInstance.Send(new NotificationMessage<datas>(this,d,CardListNotificaions.ScrollTo));
 }
Esempio n. 3
0
 /// <summary>
 /// 重新加载某个项
 /// </summary>
 /// <param name="data"></param>
 public void Reload(datas data) {
     ce.Entry(data).Reload();
 }
Esempio n. 4
0
 public void Replace(datas from, datas to) {
     Remove(from);
     Add(to);
 }
Esempio n. 5
0
 /// <summary>
 /// 删除卡片对象
 /// </summary>
 public void Remove(datas card) {
     ce.datas.Remove(card);
 }