Пример #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);
        }
Пример #2
0
 public void ScrollIntoView(datas d) {
     MessengerInstance.Send(new NotificationMessage<datas>(this,d,CardListNotificaions.ScrollTo));
 }
Пример #3
0
 /// <summary>
 /// 重新加载某个项
 /// </summary>
 /// <param name="data"></param>
 public void Reload(datas data) {
     ce.Entry(data).Reload();
 }
Пример #4
0
 public void Replace(datas from, datas to) {
     Remove(from);
     Add(to);
 }
Пример #5
0
 /// <summary>
 /// 删除卡片对象
 /// </summary>
 public void Remove(datas card) {
     ce.datas.Remove(card);
 }