コード例 #1
0
ファイル: UCHands.xaml.cs プロジェクト: As-Tomas/PsHandler
 public void AddHand(Hand hand)
 {
     Methods.UiInvoke(() =>
     {
         if (_handsInfo.All(a => a.Hand.HandNumber != hand.HandNumber))
         {
             _handsInfo.Add(new HandInfo(hand));
         }
         GridView_TablesInfo.ResetColumnWidths();
     });
 }
コード例 #2
0
ファイル: UCTables.xaml.cs プロジェクト: As-Tomas/PsHandler
 public void UpdateView(List <Table> tables)
 {
     Methods.UiInvoke(() =>
     {
         // remove non-existing
         foreach (var tableInfo in _tablesInfo.Where(ti => tables.All(t => t != ti.Table)).ToArray())
         {
             _tablesInfo.Remove(tableInfo);
         }
         // find of add new
         foreach (var table in tables)
         {
             TableInfo tableInfo = _tablesInfo.FirstOrDefault(ti => ti.Table == table);
             if (tableInfo == null)
             {
                 tableInfo = new TableInfo(table);
                 _tablesInfo.Add(tableInfo);
             }
             tableInfo.Update();
         }
         // fit grid view
         GridView_TablesInfo.ResetColumnWidths();
     });
 }