private void UpdateItemIcon(MyToolbar toolbar, MyToolbar.IndexArgs args)
 {
     if (toolbar.IsValidIndex(args.ItemIndex))
     {
         var slot = toolbar.IndexToSlot(args.ItemIndex);
         if (slot != -1)
         {
             m_toolbarItemsGrid.GetItemAt(slot).Icon = toolbar.GetItemIcon(args.ItemIndex);
         }
     }
     else
     {
         for (int i = 0; i < m_toolbarItemsGrid.ColumnsCount; ++i)
         {
             m_toolbarItemsGrid.GetItemAt(i).Icon = toolbar.GetItemIcon(toolbar.SlotToIndex(i));
         }
     }
 }
 private void UpdateItemIcon(MyToolbar toolbar, MyToolbar.IndexArgs args)
 {
     if (toolbar.IsValidIndex(args.ItemIndex))
     {
         var slot = toolbar.IndexToSlot(args.ItemIndex);
         if (slot != -1)
             m_toolbarItemsGrid.GetItemAt(slot).Icon = toolbar.GetItemIcon(args.ItemIndex);
     }
     else
     {
         for (int i = 0; i < m_toolbarItemsGrid.ColumnsCount; ++i)
         {
             m_toolbarItemsGrid.GetItemAt(i).Icon = toolbar.GetItemIcon(toolbar.SlotToIndex(i));
         }
     }
 }