public void Replace(ViewModel_Table vm)
        {
            string          tableno  = vm.TableNo;
            ViewModel_Table toupdate = _list.Find(x => x.TableNo == tableno);

            if (toupdate != null)
            {
                toupdate.CopyFrom(vm);
            }
        }
        public ViewModel_Table GetLatest(ViewModel_Table vm)
        {
            if (vm == null)
            {
                return(vm);
            }
            var fresh = _list.Find(x => x.TableNo == vm.TableNo);

            if (fresh != null)
            {
                return(fresh);
            }
            return(null);
        }
示例#3
0
 public void CopyFrom(ViewModel_Table vm_table)
 {
     _flop1.CopyFrom(vm_table.Flop1);
     _flop2.CopyFrom(vm_table.Flop2);
     _flop3.CopyFrom(vm_table.Flop3);
     _turn.CopyFrom(vm_table.Turn);
     _river.CopyFrom(vm_table.River);
     _board        = vm_table.Board;
     this.UserName = vm_table.UserName;
     //ListOfSeats = vm_table.ListOfSeats; // shouldn't this be a copy too ???
     foreach (var seat in ListOfSeats)
     {
         seat.CopyFrom(vm_table.ListOfSeats.Find(x => x.SeatNo == seat.SeatNo));
     }
 }