using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
MyGroup _Btn = new MyGroup();
private void Form1_Load(object sender, EventArgs e)
{
for (int i = 0; i < toolStrip1.Items.Count; i++)
{
if (toolStrip1.Items[i].GetType().ToString() ==
"System.Windows.Forms.ToolStripButton")
{
_Btn.Items.Add(toolStrip1.Items[i]);
}
}
_Btn.EnabledAll(false);
}
}
public class MyGroup
{
public List<ToolStripItem> Items = new List<ToolStripItem>();
public void EnabledAll(bool b)
{
foreach (ToolStripItem _Items in this.Items)
{
_Items.Enabled = b;
}
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYzsKdXNpbmcgU3lzdGVtLkNvbXBvbmVudE1vZGVsOwp1c2luZyBTeXN0ZW0uRGF0YTsKdXNpbmcgU3lzdGVtLkRyYXdpbmc7CnVzaW5nIFN5c3RlbS5MaW5xOwp1c2luZyBTeXN0ZW0uVGV4dDsKdXNpbmcgU3lzdGVtLldpbmRvd3MuRm9ybXM7CgpuYW1lc3BhY2UgV2luZG93c0Zvcm1zQXBwbGljYXRpb24xCnsKICAgIHB1YmxpYyBwYXJ0aWFsIGNsYXNzIEZvcm0xIDogRm9ybQogICAgewogICAgICAgIHB1YmxpYyBGb3JtMSgpCiAgICAgICAgewogICAgICAgICAgICBJbml0aWFsaXplQ29tcG9uZW50KCk7CiAgICAgICAgfQogICAgICAgIE15R3JvdXAgX0J0biA9IG5ldyBNeUdyb3VwKCk7CiAgICAgICAgcHJpdmF0ZSB2b2lkIEZvcm0xX0xvYWQob2JqZWN0IHNlbmRlciwgRXZlbnRBcmdzIGUpCiAgICAgICAgewogICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHRvb2xTdHJpcDEuSXRlbXMuQ291bnQ7IGkrKykKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgaWYgKHRvb2xTdHJpcDEuSXRlbXNbaV0uR2V0VHlwZSgpLlRvU3RyaW5nKCkgPT0KICAgICAgICAgICAgICAgICAgICAiU3lzdGVtLldpbmRvd3MuRm9ybXMuVG9vbFN0cmlwQnV0dG9uIikKICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICBfQnRuLkl0ZW1zLkFkZCh0b29sU3RyaXAxLkl0ZW1zW2ldKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBfQnRuLkVuYWJsZWRBbGwoZmFsc2UpOwogICAgICAgIH0KICAgIH0KICAgIHB1YmxpYyBjbGFzcyBNeUdyb3VwCiAgICB7CiAgICAgICAgcHVibGljIExpc3Q8VG9vbFN0cmlwSXRlbT4gSXRlbXMgPSBuZXcgTGlzdDxUb29sU3RyaXBJdGVtPigpOwogICAgICAgIHB1YmxpYyB2b2lkIEVuYWJsZWRBbGwoYm9vbCBiKQogICAgICAgIHsKICAgICAgICAgICAgZm9yZWFjaCAoVG9vbFN0cmlwSXRlbSBfSXRlbXMgaW4gdGhpcy5JdGVtcykKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgX0l0ZW1zLkVuYWJsZWQgPSBiOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQoKfQo=