Example #1
0
 private void Toolbar_ItemEnabledChanged(MyToolbar toolbar, MyToolbar.SlotArgs args)
 {
     if (args.SlotNumber.HasValue)
     {
         var idx = args.SlotNumber.Value;
         m_toolbarItemsGrid.GetItemAt(idx).Enabled = toolbar.IsEnabled(toolbar.SlotToIndex(idx));
     }
     else
     {
         for (int i = 0; i < m_toolbarItemsGrid.ColumnsCount; ++i)
         {
             m_toolbarItemsGrid.GetItemAt(i).Enabled = toolbar.IsEnabled(toolbar.SlotToIndex(i));
         }
     }
 }
 private void Toolbar_ItemEnabledChanged(MyToolbar toolbar, MyToolbar.SlotArgs args)
 {
     if (args.SlotNumber.HasValue)
     {
         var idx = args.SlotNumber.Value;
         m_toolbarItemsGrid.GetItemAt(idx).Enabled = toolbar.IsEnabled(toolbar.SlotToIndex(idx));
     }
     else
     {
         for (int i = 0; i < m_toolbarItemsGrid.ColumnsCount; ++i)
         {
             m_toolbarItemsGrid.GetItemAt(i).Enabled = toolbar.IsEnabled(toolbar.SlotToIndex(i));
         }
     }
 }